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>
This commit is contained in:
committed by
Alasdair G Kergon
parent
d04714580f
commit
bda8efec5c
@@ -22,7 +22,6 @@
|
||||
#define DM_MSG_PREFIX "raid1"
|
||||
|
||||
#define MAX_RECOVERY 1 /* Maximum number of regions recovered in parallel. */
|
||||
#define DM_IO_PAGES 64
|
||||
#define DM_KCOPYD_PAGES 64
|
||||
|
||||
#define DM_RAID1_HANDLE_ERRORS 0x01
|
||||
@@ -887,7 +886,7 @@ static struct mirror_set *alloc_context(unsigned int nr_mirrors,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ms->io_client = dm_io_client_create(DM_IO_PAGES);
|
||||
ms->io_client = dm_io_client_create();
|
||||
if (IS_ERR(ms->io_client)) {
|
||||
ti->error = "Error creating dm_io client";
|
||||
mempool_destroy(ms->read_record_pool);
|
||||
|
Reference in New Issue
Block a user