Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Device-mapper Development (http://www.linux-archive.org/device-mapper-development/)
-   -   Reserve just one mempool entry (http://www.linux-archive.org/device-mapper-development/528393-reserve-just-one-mempool-entry.html)

Mikulas Patocka 05-19-2011 04:55 PM

Reserve just one mempool entry
 
Reserve just one mempool entry

If our implementation is deadlock-free, we don't need large mempool
reserve. Just one entry is enough.

Note that in normal case, when if there is no memory pressure, we can
still allocate arbitrary number of entries from the slab cache.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
drivers/md/dm-kcopyd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Index: linux-2.6.39-rc7-fast/drivers/md/dm-kcopyd.c
================================================== =================
--- linux-2.6.39-rc7-fast.orig/drivers/md/dm-kcopyd.c 2011-05-18 18:15:35.000000000 +0200
+++ linux-2.6.39-rc7-fast/drivers/md/dm-kcopyd.c 2011-05-18 18:16:31.000000000 +0200
@@ -29,6 +29,7 @@

#define SUB_JOB_SIZE 128
#define SPLIT_COUNT 8
+#define MIN_JOBS 1

/*-----------------------------------------------------------------
* Each kcopyd client has its own little pool of preallocated
@@ -223,9 +224,6 @@ struct kcopyd_job {
struct kcopyd_job *master_job;
};

-/* FIXME: this should scale with the number of pages */
-#define MIN_JOBS 512
-
static struct kmem_cache *_job_cache;

int __init dm_kcopyd_init(void)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Mikulas Patocka 05-19-2011 04:55 PM

Reserve just one mempool entry
 
Reserve just one mempool entry

If our implementation is deadlock-free, we don't need large mempool
reserve. Just one entry is enough.

Note that in normal case, when if there is no memory pressure, we can
still allocate arbitrary number of entries from the slab cache.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
drivers/md/dm-kcopyd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

Index: linux-2.6.39-rc7-fast/drivers/md/dm-kcopyd.c
================================================== =================
--- linux-2.6.39-rc7-fast.orig/drivers/md/dm-kcopyd.c 2011-05-18 18:15:35.000000000 +0200
+++ linux-2.6.39-rc7-fast/drivers/md/dm-kcopyd.c 2011-05-18 18:16:31.000000000 +0200
@@ -29,6 +29,7 @@

#define SUB_JOB_SIZE 128
#define SPLIT_COUNT 8
+#define MIN_JOBS 1

/*-----------------------------------------------------------------
* Each kcopyd client has its own little pool of preallocated
@@ -223,9 +224,6 @@ struct kcopyd_job {
struct kcopyd_job *master_job;
};

-/* FIXME: this should scale with the number of pages */
-#define MIN_JOBS 512
-
static struct kmem_cache *_job_cache;

int __init dm_kcopyd_init(void)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


All times are GMT. The time now is 09:59 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.