mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
percpu: allow select gfp to be passed to underlying allocators
The prior patch added support for passing gfp flags through to the underlying allocators. This patch allows users to pass along gfp flags (currently only __GFP_NORETRY and __GFP_NOWARN) to the underlying allocators. This should allow users to decide if they are ok with failing allocations recovering in a more graceful way. Additionally, gfp passing was done as additional flags in the previous patch. Instead, change this to caller passed semantics. GFP_KERNEL is also removed as the default flag. It continues to be used for internally caused underlying percpu allocations. V2: Removed gfp_percpu_mask in favor of doing it inline. Removed GFP_KERNEL as a default flag for __alloc_percpu_gfp. Signed-off-by: Dennis Zhou <dennisszhou@gmail.com> Suggested-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
47504ee04b
commit
554fef1c39
3 changed files with 10 additions and 12 deletions
|
@ -37,7 +37,7 @@ static struct page **pcpu_get_pages(void)
|
|||
lockdep_assert_held(&pcpu_alloc_mutex);
|
||||
|
||||
if (!pages)
|
||||
pages = pcpu_mem_zalloc(pages_size, 0);
|
||||
pages = pcpu_mem_zalloc(pages_size, GFP_KERNEL);
|
||||
return pages;
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ static int pcpu_alloc_pages(struct pcpu_chunk *chunk,
|
|||
unsigned int cpu, tcpu;
|
||||
int i;
|
||||
|
||||
gfp |= GFP_KERNEL | __GFP_HIGHMEM;
|
||||
gfp |= __GFP_HIGHMEM;
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
for (i = page_start; i < page_end; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue