diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2011-05-29 13:03:09 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-05-29 13:03:09 +0100 |
commit | bda8efec5c706a672e0714d341a342e811f0262a (patch) | |
tree | 7daf7b505723f5ed2767353dc3fe53b939c46d87 /drivers/md/dm-log.c | |
parent | d04714580f12379fcf7a0f799e86c92b96dd4e1f (diff) |
dm io: use fixed initial mempool size
Replace the arbitrary calculation of an initial io struct mempool size
with a constant.
The code calculated the number of reserved structures based on the request
size and used a "magic" multiplication constant of 4. This patch changes
it to reserve a fixed number - itself still chosen quite arbitrarily.
Further testing might show if there is a better number to choose.
Note that if there is no memory pressure, we can still allocate an
arbitrary number of "struct io" structures. One structure is enough to
process the whole request.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-log.c')
-rw-r--r-- | drivers/md/dm-log.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index a1f32188967..948e3f4925b 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c @@ -449,8 +449,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, lc->io_req.mem.type = DM_IO_VMA; lc->io_req.notify.fn = NULL; - lc->io_req.client = dm_io_client_create(dm_div_up(buf_size, - PAGE_SIZE)); + lc->io_req.client = dm_io_client_create(); if (IS_ERR(lc->io_req.client)) { r = PTR_ERR(lc->io_req.client); DMWARN("couldn't allocate disk io client"); |