percpu.c (7318234c8d7c0f209f993ee46a7ea148efdb28b9) percpu.c (88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * mm/percpu.c - percpu memory allocator
4 *
5 * Copyright (C) 2009 SUSE Linux Products GmbH
6 * Copyright (C) 2009 Tejun Heo <tj@kernel.org>
7 *
8 * Copyright (C) 2017 Facebook Inc.

--- 468 unchanged lines hidden (view full) ---

477static void *pcpu_mem_zalloc(size_t size, gfp_t gfp)
478{
479 if (WARN_ON_ONCE(!slab_is_available()))
480 return NULL;
481
482 if (size <= PAGE_SIZE)
483 return kzalloc(size, gfp);
484 else
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * mm/percpu.c - percpu memory allocator
4 *
5 * Copyright (C) 2009 SUSE Linux Products GmbH
6 * Copyright (C) 2009 Tejun Heo <tj@kernel.org>
7 *
8 * Copyright (C) 2017 Facebook Inc.

--- 468 unchanged lines hidden (view full) ---

477static void *pcpu_mem_zalloc(size_t size, gfp_t gfp)
478{
479 if (WARN_ON_ONCE(!slab_is_available()))
480 return NULL;
481
482 if (size <= PAGE_SIZE)
483 return kzalloc(size, gfp);
484 else
485 return __vmalloc(size, gfp | __GFP_ZERO, PAGE_KERNEL);
485 return __vmalloc(size, gfp | __GFP_ZERO);
486}
487
488/**
489 * pcpu_mem_free - free memory
490 * @ptr: memory to free
491 *
492 * Free @ptr. @ptr should have been allocated using pcpu_mem_zalloc().
493 */

--- 2529 unchanged lines hidden ---
486}
487
488/**
489 * pcpu_mem_free - free memory
490 * @ptr: memory to free
491 *
492 * Free @ptr. @ptr should have been allocated using pcpu_mem_zalloc().
493 */

--- 2529 unchanged lines hidden ---