page_pool: Add API to update numa node
Add page_pool_update_nid() to be called by page pool consumers when they detect numa node changes. It will update the page pool nid value to start allocating from the new effective numa node. This is to mitigate page pool allocating pages from a wrong numa node, where the pool was originally allocated, and holding on to pages that belong to a different numa node, which causes performance degradation. For pages that are already being consumed and could be returned to the pool by the consumer, in next patch we will add a check per page to avoid recycling them back to the pool and return them to the page allocator. Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
1f12177b32
commit
bc83674870
@@ -436,3 +436,11 @@ void page_pool_destroy(struct page_pool *pool)
|
||||
schedule_delayed_work(&pool->release_dw, DEFER_TIME);
|
||||
}
|
||||
EXPORT_SYMBOL(page_pool_destroy);
|
||||
|
||||
/* Caller must provide appropriate safe context, e.g. NAPI. */
|
||||
void page_pool_update_nid(struct page_pool *pool, int new_nid)
|
||||
{
|
||||
trace_page_pool_update_nid(pool, new_nid);
|
||||
pool->p.nid = new_nid;
|
||||
}
|
||||
EXPORT_SYMBOL(page_pool_update_nid);
|
||||
|
Reference in New Issue
Block a user