mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
[PATCH] NUMA aware block device control structure allocation
Patch to allocate the control structures for for ide devices on the node of the device itself (for NUMA systems). The patch depends on the Slab API change patch by Manfred and me (in mm) and the pcidev_to_node patch that I posted today. Does some realignment too. Signed-off-by: Justin M. Forbes <[email protected]> Signed-off-by: Christoph Lameter <[email protected]> Signed-off-by: Pravin Shelar <[email protected]> Signed-off-by: Shobhit Dayal <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
8c5a09082f
commit
1946089a10
11 changed files with 77 additions and 30 deletions
17
mm/mempool.c
17
mm/mempool.c
|
|
@ -51,16 +51,23 @@ static void free_pool(mempool_t *pool)
|
|||
* functions might sleep - as long as the mempool_alloc function is not called
|
||||
* from IRQ contexts.
|
||||
*/
|
||||
mempool_t * mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
|
||||
mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
|
||||
mempool_free_t *free_fn, void *pool_data)
|
||||
{
|
||||
mempool_t *pool;
|
||||
return mempool_create_node(min_nr,alloc_fn,free_fn, pool_data,-1);
|
||||
}
|
||||
EXPORT_SYMBOL(mempool_create);
|
||||
|
||||
pool = kmalloc(sizeof(*pool), GFP_KERNEL);
|
||||
mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn,
|
||||
mempool_free_t *free_fn, void *pool_data, int node_id)
|
||||
{
|
||||
mempool_t *pool;
|
||||
pool = kmalloc_node(sizeof(*pool), GFP_KERNEL, node_id);
|
||||
if (!pool)
|
||||
return NULL;
|
||||
memset(pool, 0, sizeof(*pool));
|
||||
pool->elements = kmalloc(min_nr * sizeof(void *), GFP_KERNEL);
|
||||
pool->elements = kmalloc_node(min_nr * sizeof(void *),
|
||||
GFP_KERNEL, node_id);
|
||||
if (!pool->elements) {
|
||||
kfree(pool);
|
||||
return NULL;
|
||||
|
|
@ -87,7 +94,7 @@ mempool_t * mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
|
|||
}
|
||||
return pool;
|
||||
}
|
||||
EXPORT_SYMBOL(mempool_create);
|
||||
EXPORT_SYMBOL(mempool_create_node);
|
||||
|
||||
/**
|
||||
* mempool_resize - resize an existing memory pool
|
||||
|
|
|
|||
Loading…
Reference in a new issue