Commit cd9bb7e7 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block:
  [PATCH] elevator: elv_list_lock does not need irq disabling
  [BLOCK] Don't pin lots of memory in mempools
  cfq-iosched: speedup cic rb lookup
  ll_rw_blk: add io_context private pointer
  cfq-iosched: get rid of cfqq hash
  cfq-iosched: tighten queue request overlap condition
  cfq-iosched: improve sync vs async workloads
  cfq-iosched: never allow an async queue idling
  cfq-iosched: get rid of ->dispatch_slice
  cfq-iosched: don't pass unused preemption variable around
  cfq-iosched: get rid of ->cur_rr and ->cfq_list
  cfq-iosched: slice offset should take ioprio into account
  [PATCH] cfq-iosched: style cleanups and comments
  cfq-iosched: sort IDLE queues into the rbtree
  cfq-iosched: sort RT queues into the rbtree
  [PATCH] cfq-iosched: speed up rbtree handling
  cfq-iosched: rework the whole round-robin list concept
  cfq-iosched: minor updates
  cfq-iosched: development update
  cfq-iosched: improve preemption for cooperating tasks
parents 24a77daf 07e44708
This diff is collapsed.
...@@ -134,13 +134,13 @@ static struct elevator_type *elevator_get(const char *name) ...@@ -134,13 +134,13 @@ static struct elevator_type *elevator_get(const char *name)
{ {
struct elevator_type *e; struct elevator_type *e;
spin_lock_irq(&elv_list_lock); spin_lock(&elv_list_lock);
e = elevator_find(name); e = elevator_find(name);
if (e && !try_module_get(e->elevator_owner)) if (e && !try_module_get(e->elevator_owner))
e = NULL; e = NULL;
spin_unlock_irq(&elv_list_lock); spin_unlock(&elv_list_lock);
return e; return e;
} }
...@@ -965,10 +965,11 @@ void elv_unregister_queue(struct request_queue *q) ...@@ -965,10 +965,11 @@ void elv_unregister_queue(struct request_queue *q)
int elv_register(struct elevator_type *e) int elv_register(struct elevator_type *e)
{ {
char *def = ""; char *def = "";
spin_lock_irq(&elv_list_lock);
spin_lock(&elv_list_lock);
BUG_ON(elevator_find(e->elevator_name)); BUG_ON(elevator_find(e->elevator_name));
list_add_tail(&e->list, &elv_list); list_add_tail(&e->list, &elv_list);
spin_unlock_irq(&elv_list_lock); spin_unlock(&elv_list_lock);
if (!strcmp(e->elevator_name, chosen_elevator) || if (!strcmp(e->elevator_name, chosen_elevator) ||
(!*chosen_elevator && (!*chosen_elevator &&
...@@ -998,9 +999,9 @@ void elv_unregister(struct elevator_type *e) ...@@ -998,9 +999,9 @@ void elv_unregister(struct elevator_type *e)
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
} }
spin_lock_irq(&elv_list_lock); spin_lock(&elv_list_lock);
list_del_init(&e->list); list_del_init(&e->list);
spin_unlock_irq(&elv_list_lock); spin_unlock(&elv_list_lock);
} }
EXPORT_SYMBOL_GPL(elv_unregister); EXPORT_SYMBOL_GPL(elv_unregister);
...@@ -1118,7 +1119,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name) ...@@ -1118,7 +1119,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
struct list_head *entry; struct list_head *entry;
int len = 0; int len = 0;
spin_lock_irq(&elv_list_lock); spin_lock(&elv_list_lock);
list_for_each(entry, &elv_list) { list_for_each(entry, &elv_list) {
struct elevator_type *__e; struct elevator_type *__e;
...@@ -1128,7 +1129,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name) ...@@ -1128,7 +1129,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
else else
len += sprintf(name+len, "%s ", __e->elevator_name); len += sprintf(name+len, "%s ", __e->elevator_name);
} }
spin_unlock_irq(&elv_list_lock); spin_unlock(&elv_list_lock);
len += sprintf(len+name, "\n"); len += sprintf(len+name, "\n");
return len; return len;
......
...@@ -3741,6 +3741,7 @@ static struct io_context *current_io_context(gfp_t gfp_flags, int node) ...@@ -3741,6 +3741,7 @@ static struct io_context *current_io_context(gfp_t gfp_flags, int node)
ret->nr_batch_requests = 0; /* because this is 0 */ ret->nr_batch_requests = 0; /* because this is 0 */
ret->aic = NULL; ret->aic = NULL;
ret->cic_root.rb_node = NULL; ret->cic_root.rb_node = NULL;
ret->ioc_data = NULL;
/* make sure set_task_ioprio() sees the settings above */ /* make sure set_task_ioprio() sees the settings above */
smp_wmb(); smp_wmb();
tsk->io_context = ret; tsk->io_context = ret;
......
...@@ -867,7 +867,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) ...@@ -867,7 +867,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto bad4; goto bad4;
} }
cc->bs = bioset_create(MIN_IOS, MIN_IOS, 4); cc->bs = bioset_create(MIN_IOS, MIN_IOS);
if (!cc->bs) { if (!cc->bs) {
ti->error = "Cannot allocate crypt bioset"; ti->error = "Cannot allocate crypt bioset";
goto bad_bs; goto bad_bs;
......
...@@ -60,7 +60,7 @@ static int resize_pool(unsigned int new_ios) ...@@ -60,7 +60,7 @@ static int resize_pool(unsigned int new_ios)
if (!_io_pool) if (!_io_pool)
return -ENOMEM; return -ENOMEM;
_bios = bioset_create(16, 16, 4); _bios = bioset_create(16, 16);
if (!_bios) { if (!_bios) {
mempool_destroy(_io_pool); mempool_destroy(_io_pool);
_io_pool = NULL; _io_pool = NULL;
......
...@@ -1012,7 +1012,7 @@ static struct mapped_device *alloc_dev(int minor) ...@@ -1012,7 +1012,7 @@ static struct mapped_device *alloc_dev(int minor)
if (!md->tio_pool) if (!md->tio_pool)
goto bad3; goto bad3;
md->bs = bioset_create(16, 16, 4); md->bs = bioset_create(16, 16);
if (!md->bs) if (!md->bs)
goto bad_no_bioset; goto bad_no_bioset;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define SG_MEMPOOL_NR ARRAY_SIZE(scsi_sg_pools) #define SG_MEMPOOL_NR ARRAY_SIZE(scsi_sg_pools)
#define SG_MEMPOOL_SIZE 32 #define SG_MEMPOOL_SIZE 2
struct scsi_host_sg_pool { struct scsi_host_sg_pool {
size_t size; size_t size;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <linux/blktrace_api.h> #include <linux/blktrace_api.h>
#include <scsi/sg.h> /* for struct sg_iovec */ #include <scsi/sg.h> /* for struct sg_iovec */
#define BIO_POOL_SIZE 256 #define BIO_POOL_SIZE 2
static struct kmem_cache *bio_slab __read_mostly; static struct kmem_cache *bio_slab __read_mostly;
...@@ -38,7 +38,7 @@ static struct kmem_cache *bio_slab __read_mostly; ...@@ -38,7 +38,7 @@ static struct kmem_cache *bio_slab __read_mostly;
* a small number of entries is fine, not going to be performance critical. * a small number of entries is fine, not going to be performance critical.
* basically we just need to survive * basically we just need to survive
*/ */
#define BIO_SPLIT_ENTRIES 8 #define BIO_SPLIT_ENTRIES 2
mempool_t *bio_split_pool __read_mostly; mempool_t *bio_split_pool __read_mostly;
struct biovec_slab { struct biovec_slab {
...@@ -1120,7 +1120,7 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) ...@@ -1120,7 +1120,7 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors)
* create memory pools for biovec's in a bio_set. * create memory pools for biovec's in a bio_set.
* use the global biovec slabs created for general use. * use the global biovec slabs created for general use.
*/ */
static int biovec_create_pools(struct bio_set *bs, int pool_entries, int scale) static int biovec_create_pools(struct bio_set *bs, int pool_entries)
{ {
int i; int i;
...@@ -1128,9 +1128,6 @@ static int biovec_create_pools(struct bio_set *bs, int pool_entries, int scale) ...@@ -1128,9 +1128,6 @@ static int biovec_create_pools(struct bio_set *bs, int pool_entries, int scale)
struct biovec_slab *bp = bvec_slabs + i; struct biovec_slab *bp = bvec_slabs + i;
mempool_t **bvp = bs->bvec_pools + i; mempool_t **bvp = bs->bvec_pools + i;
if (pool_entries > 1 && i >= scale)
pool_entries >>= 1;
*bvp = mempool_create_slab_pool(pool_entries, bp->slab); *bvp = mempool_create_slab_pool(pool_entries, bp->slab);
if (!*bvp) if (!*bvp)
return -ENOMEM; return -ENOMEM;
...@@ -1161,7 +1158,7 @@ void bioset_free(struct bio_set *bs) ...@@ -1161,7 +1158,7 @@ void bioset_free(struct bio_set *bs)
kfree(bs); kfree(bs);
} }
struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size, int scale) struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size)
{ {
struct bio_set *bs = kzalloc(sizeof(*bs), GFP_KERNEL); struct bio_set *bs = kzalloc(sizeof(*bs), GFP_KERNEL);
...@@ -1172,7 +1169,7 @@ struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size, int scale) ...@@ -1172,7 +1169,7 @@ struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size, int scale)
if (!bs->bio_pool) if (!bs->bio_pool)
goto bad; goto bad;
if (!biovec_create_pools(bs, bvec_pool_size, scale)) if (!biovec_create_pools(bs, bvec_pool_size))
return bs; return bs;
bad: bad:
...@@ -1196,38 +1193,12 @@ static void __init biovec_init_slabs(void) ...@@ -1196,38 +1193,12 @@ static void __init biovec_init_slabs(void)
static int __init init_bio(void) static int __init init_bio(void)
{ {
int megabytes, bvec_pool_entries;
int scale = BIOVEC_NR_POOLS;
bio_slab = kmem_cache_create("bio", sizeof(struct bio), 0, bio_slab = kmem_cache_create("bio", sizeof(struct bio), 0,
SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL); SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
biovec_init_slabs(); biovec_init_slabs();
megabytes = nr_free_pages() >> (20 - PAGE_SHIFT); fs_bio_set = bioset_create(BIO_POOL_SIZE, 2);
/*
* find out where to start scaling
*/
if (megabytes <= 16)
scale = 0;
else if (megabytes <= 32)
scale = 1;
else if (megabytes <= 64)
scale = 2;
else if (megabytes <= 96)
scale = 3;
else if (megabytes <= 128)
scale = 4;
/*
* Limit number of entries reserved -- mempools are only used when
* the system is completely unable to allocate memory, so we only
* need enough to make progress.
*/
bvec_pool_entries = 1 + scale;
fs_bio_set = bioset_create(BIO_POOL_SIZE, bvec_pool_entries, scale);
if (!fs_bio_set) if (!fs_bio_set)
panic("bio: can't allocate bios\n"); panic("bio: can't allocate bios\n");
......
...@@ -276,7 +276,7 @@ extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, ...@@ -276,7 +276,7 @@ extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool,
extern mempool_t *bio_split_pool; extern mempool_t *bio_split_pool;
extern void bio_pair_release(struct bio_pair *dbio); extern void bio_pair_release(struct bio_pair *dbio);
extern struct bio_set *bioset_create(int, int, int); extern struct bio_set *bioset_create(int, int);
extern void bioset_free(struct bio_set *); extern void bioset_free(struct bio_set *);
extern struct bio *bio_alloc(gfp_t, int); extern struct bio *bio_alloc(gfp_t, int);
......
...@@ -116,6 +116,7 @@ struct io_context { ...@@ -116,6 +116,7 @@ struct io_context {
struct as_io_context *aic; struct as_io_context *aic;
struct rb_root cic_root; struct rb_root cic_root;
void *ioc_data;
}; };
void put_io_context(struct io_context *ioc); void put_io_context(struct io_context *ioc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment