From patchwork Wed Mar 6 18:24:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13584436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE4C5C54E41 for ; Wed, 6 Mar 2024 18:26:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 644196B00B6; Wed, 6 Mar 2024 13:25:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CC946B00B7; Wed, 6 Mar 2024 13:25:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3ABE66B00B8; Wed, 6 Mar 2024 13:25:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 208BD6B00B6 for ; Wed, 6 Mar 2024 13:25:44 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EBFCC1204E2 for ; Wed, 6 Mar 2024 18:25:43 +0000 (UTC) X-FDA: 81867442566.07.50D163C Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf27.hostedemail.com (Postfix) with ESMTP id 26D3E40006 for ; Wed, 6 Mar 2024 18:25:41 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=vCzQiWmU; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of 3JbXoZQYKCGgYaXKTHMUUMRK.IUSROTad-SSQbGIQ.UXM@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3JbXoZQYKCGgYaXKTHMUUMRK.IUSROTad-SSQbGIQ.UXM@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709749542; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=iFNwLDi8a6FCybl7tYSum2P7lYcwvuLcMH/fhzJCtO0=; b=j13qV/8OXVWexcr98G+afTL+Tus5s/vgUxpxBJRy4qmSF9nJXgCFIiN4STauGv7XFWWhIy KubW/MIBY5/68SM7nzOyEkU+dScgipeBJ7xUXLduM1jMwLIITHVS8J++dJhVv6n5lkmt5B JlEf9A83CKTB9sUEGuO/Csy1pfXpXzc= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=vCzQiWmU; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of 3JbXoZQYKCGgYaXKTHMUUMRK.IUSROTad-SSQbGIQ.UXM@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3JbXoZQYKCGgYaXKTHMUUMRK.IUSROTad-SSQbGIQ.UXM@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709749542; a=rsa-sha256; cv=none; b=oLp2SVnwpVy+vD5DC+zdXSPSFu/INfNE6eHQH9EFHYa/6HJlxWiPZBspb+TYH1h9vbeIDP iOJx18+eQwUMpbv3dY/Cood6/+XduLcQIalXUtQIcWZCovg5tCe3Zn4vKGVUYwcm2fANp4 Wr4XuvzSNcWqsbieEXT7mBMWpvnfZEo= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-609ea26233dso705687b3.0 for ; Wed, 06 Mar 2024 10:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709749541; x=1710354341; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=iFNwLDi8a6FCybl7tYSum2P7lYcwvuLcMH/fhzJCtO0=; b=vCzQiWmUOtE+0wCJvtUyom7xzTVSzAWT4pZv+fY39ca3KdZDsd77FB440tgyCCdcF/ ICfX5iFJcYjSiJ3wKg/yFJ7ODk0naLJmPy0qvAqAp74aiYk2u3w0c+XniIj70uTjmUtN n7hTSNK/OU5UafqP5Kocne9V33YkJ8zjAZYo8vMuLcmJeP3XwAbY7F6ffmZPbiAxbDiw njG491GbjAZDPwMNkSPfcY2XQfhnprG/ed9eVwhxtF7D4/lVJBNXBXF23OR+TEpPwzwr iMyKsfX9N3HrV6VZ+v0FsbwerBrM0Rbc7021IS0uhqg3pMJnOFsnMqm1f0SfttHx1GeD RBgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709749541; x=1710354341; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iFNwLDi8a6FCybl7tYSum2P7lYcwvuLcMH/fhzJCtO0=; b=VyMDnB26v+Od6UtfwUDEZsVHtjZvbfE6RshspcpgfLuCMfvmql06IBteRj3i/Ih0h0 aJ0iwzY14cZJPTHmDNeteodXFsWFXRWMh66NigzYox4PgdAuBxdp5+9v3ngk5huQ2a0o atV/Xfo93uqeJKtrIzcAAlGGMeyLmQB5DpTgkTT7+YC9oae2loXcd+kmWa7N0AzabmOG Vbxa7dQhEn/m4msWmNndkhfYweD0mNTu9Ga9zySmgXVsi/By41Z60OGjbrfwx17zxxJd ksB3YzLyhwHMfLntQXqCQ4f8II7NyxO6tcMn04RBdXC0nFmR9C3Tsoo4hfrLEbtaVWkp 56Pw== X-Forwarded-Encrypted: i=1; AJvYcCUxYWVIU17Hh4zHXR/RPZnBM7lhImAmBH+d1L3UsKa4xZ0PHnauf1eM1Xn7Pald6uuE2CNRHdAHuQgUpKUVASke8cY= X-Gm-Message-State: AOJu0Yw+JFPb9h81nATtEofKk9I825u2fdXXFN1WyMtD1M+0mkJ6Tfb9 tlXUz/qLa0VloF4QAhzEpwY0YMYpMFa1hiIgpbjucF1NOM39wahbvwk7VZ55Xq/Y1PHb2M/ofyv 0lQ== X-Google-Smtp-Source: AGHT+IGvnYLIRGywxW7lIY5Dwg73H8sGGkieLckhKDQfCaS4NbJhnd10raXpA2sI5FmqAhpFwomFM/K3FC0= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:85f0:e3db:db05:85e2]) (user=surenb job=sendgmr) by 2002:a05:690c:3504:b0:608:769c:d72a with SMTP id fq4-20020a05690c350400b00608769cd72amr4800532ywb.5.1709749541184; Wed, 06 Mar 2024 10:25:41 -0800 (PST) Date: Wed, 6 Mar 2024 10:24:24 -0800 In-Reply-To: <20240306182440.2003814-1-surenb@google.com> Mime-Version: 1.0 References: <20240306182440.2003814-1-surenb@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240306182440.2003814-27-surenb@google.com> Subject: [PATCH v5 26/37] mempool: Hook up to memory allocation profiling From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, penguin-kernel@i-love.sakura.ne.jp, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, jhubbard@nvidia.com, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, aliceryhl@google.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org X-Rspamd-Queue-Id: 26D3E40006 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: mgzypp93jhcbku7asp7ri6r9xbjicnzz X-HE-Tag: 1709749541-529287 X-HE-Meta: U2FsdGVkX18kO0iBH7eZW+8XNPh0WcbrmNNwaOex4ymxU4/EeZl3Cz3nc6fG/15j3sKwJWJKcaYb3H2z76WU0P2lnFem5xTKSXs3hvt9lpOqfIbDTc3EVI8aWsIoVUSkyQMH7Rae9heG5UydfMRmgauBSK29QL9ssZV7MVq2L0iAUmXu8XLZXKKXIEvtSVAzODBYIqQjK6A5xm2XxRforXJvl9Mh0fTzHVw6fi7nHK0aaw6bmX5/a1lef9wQ4sZi2SlWYEqhCdpt6bXwJHsrTxrM97P8IgvoAoR00l0apM0GpWoSZC4P3eZcBnkkRzFFnpTFg69urenlQgIvAV1fKJYJz8c/J1JVZP2HRaKXkog96N4HeJVauz6daKfCVOOcmhKWSjg9cq6cL77t8+r8eWsvRdXwkmdOOpuuOhvoESuz2j8t5dy8P/FbH96yKXWHbOnF8pH1d07ertgXO3DhE4/gOb6YN0MyialU6gKBG/XXywxif4XI05g6f/PL1GKlqotd46DuPpMnym+4STFMUh0ZgVa9BRHE7m8ifbeWYwaffaHGjnnMBTyqeN8cOllZXWny6fULAAf0ijaVPq7+wzTInJCVVvr4+ddU1Wi9gNdQwY7A6uYHkUrDszyVyAyc+4t59mwQT9fb85A4gf3x7RzLpRfzlbdZe1AnBrmG++HVWac/6ipWbZ5G1OwTmwKt1DhBCpJ42r/YlB02jiGzesjLIFagEOrQgC0d08uGGaJ06QEIgrn/iqq+8ro0PIwRsvCGmByypr5W8X+SUI7OhpAUASTMrd1+fnORSYABpsgtIwORmw55aAdevky1RPw11314/CqfZcW30WnyVPTr4VSzU16WcGjNAqEFRe9SHFy1YmO0Kp7ENdPKG+T3k1N4/dZoZ7WjQej167IkBkTbuzIQ+5kfGKUbk9/Ed4BkMchxQ8PUYo7tOOGh13r5YqBP3/sLWtuC95fSYO71u0R L8+VtXNP WBgW7fSzXGOpz6kcPh8JwzvL5O1mX4fJC8mPB08LcaT3iIDOLhU7COWGBcQvBagKUv6TE7F71Ik63PLmVZOBRRrZTOs3ciKhc0K8QJS/7lryJcE5M97UQlvIp0Jr7AlmBHSdC9AkmastbmK0nkA0KhngJ/4egTNWZXKsT7PikkOCgK1wz0UiC/SfPv8lRMm0PidlDQ/L44l9dRGfRpgXZbzWyAe4bGnDWx1xCZzHEBJlGNcy2oRBk/675ybl1kymxIEeResnMWe3oRe4Hj+YJEFujeLy97FgjBVVhoQgmq9ZRga0Ix2LAuZw4DEkh+F2fX9RiCSMeEKbew7Vpw/QbdwfA5OBsmyl2VQvLDNNyHgweYRooh21KjfwZvHRdQEuBJ+0h+2DxIDEQto1lGZC578nhEBU4R4aY8GWm/bC9z2e+UuF8kjJY1bcweYpnKh7Of3H06qv8TzC/Ov8Z/eYeVRENtXEPIFPapBK+fz6FJFnWaH52Y9pe7EVN+mMEqHviDEktA96/FeF5i60vLXIYEV35u3Q8ZMfEPkAUQ3HpZ0T5xMpUcRQExHZBfNNzuZcffS1MRoek4E93Ll5kdb5uPNiwukTzD5rF18PfTCZcIG+fsy8pcJSYnYhorbZHtDF/kVPM8GirxWw2PtPNOBmyC4GswdAzN6L5BctCmzKJ0/UJkBY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Kent Overstreet This adds hooks to mempools for correctly annotating mempool-backed allocations at the correct source line, so they show up correctly in /sys/kernel/debug/allocations. Various inline functions are converted to wrappers so that we can invoke alloc_hooks() in fewer places. Signed-off-by: Kent Overstreet Signed-off-by: Suren Baghdasaryan --- include/linux/mempool.h | 73 ++++++++++++++++++++--------------------- mm/mempool.c | 36 ++++++++------------ 2 files changed, 49 insertions(+), 60 deletions(-) diff --git a/include/linux/mempool.h b/include/linux/mempool.h index 7be1e32e6d42..69e65ca515ee 100644 --- a/include/linux/mempool.h +++ b/include/linux/mempool.h @@ -5,6 +5,8 @@ #ifndef _LINUX_MEMPOOL_H #define _LINUX_MEMPOOL_H +#include +#include #include #include @@ -39,18 +41,32 @@ void mempool_exit(mempool_t *pool); int mempool_init_node(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn, mempool_free_t *free_fn, void *pool_data, gfp_t gfp_mask, int node_id); -int mempool_init(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn, + +int mempool_init_noprof(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn, mempool_free_t *free_fn, void *pool_data); +#define mempool_init(...) \ + alloc_hooks(mempool_init_noprof(__VA_ARGS__)) extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, mempool_free_t *free_fn, void *pool_data); -extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, + +extern mempool_t *mempool_create_node_noprof(int min_nr, mempool_alloc_t *alloc_fn, mempool_free_t *free_fn, void *pool_data, gfp_t gfp_mask, int nid); +#define mempool_create_node(...) \ + alloc_hooks(mempool_create_node_noprof(__VA_ARGS__)) + +#define mempool_create(_min_nr, _alloc_fn, _free_fn, _pool_data) \ + mempool_create_node(_min_nr, _alloc_fn, _free_fn, _pool_data, \ + GFP_KERNEL, NUMA_NO_NODE) extern int mempool_resize(mempool_t *pool, int new_min_nr); extern void mempool_destroy(mempool_t *pool); -extern void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask) __malloc; + +extern void *mempool_alloc_noprof(mempool_t *pool, gfp_t gfp_mask) __malloc; +#define mempool_alloc(...) \ + alloc_hooks(mempool_alloc_noprof(__VA_ARGS__)) + extern void *mempool_alloc_preallocated(mempool_t *pool) __malloc; extern void mempool_free(void *element, mempool_t *pool); @@ -62,19 +78,10 @@ extern void mempool_free(void *element, mempool_t *pool); void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); void mempool_free_slab(void *element, void *pool_data); -static inline int -mempool_init_slab_pool(mempool_t *pool, int min_nr, struct kmem_cache *kc) -{ - return mempool_init(pool, min_nr, mempool_alloc_slab, - mempool_free_slab, (void *) kc); -} - -static inline mempool_t * -mempool_create_slab_pool(int min_nr, struct kmem_cache *kc) -{ - return mempool_create(min_nr, mempool_alloc_slab, mempool_free_slab, - (void *) kc); -} +#define mempool_init_slab_pool(_pool, _min_nr, _kc) \ + mempool_init(_pool, (_min_nr), mempool_alloc_slab, mempool_free_slab, (void *)(_kc)) +#define mempool_create_slab_pool(_min_nr, _kc) \ + mempool_create((_min_nr), mempool_alloc_slab, mempool_free_slab, (void *)(_kc)) /* * a mempool_alloc_t and a mempool_free_t to kmalloc and kfree the @@ -83,17 +90,12 @@ mempool_create_slab_pool(int min_nr, struct kmem_cache *kc) void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data); void mempool_kfree(void *element, void *pool_data); -static inline int mempool_init_kmalloc_pool(mempool_t *pool, int min_nr, size_t size) -{ - return mempool_init(pool, min_nr, mempool_kmalloc, - mempool_kfree, (void *) size); -} - -static inline mempool_t *mempool_create_kmalloc_pool(int min_nr, size_t size) -{ - return mempool_create(min_nr, mempool_kmalloc, mempool_kfree, - (void *) size); -} +#define mempool_init_kmalloc_pool(_pool, _min_nr, _size) \ + mempool_init(_pool, (_min_nr), mempool_kmalloc, mempool_kfree, \ + (void *)(unsigned long)(_size)) +#define mempool_create_kmalloc_pool(_min_nr, _size) \ + mempool_create((_min_nr), mempool_kmalloc, mempool_kfree, \ + (void *)(unsigned long)(_size)) /* * A mempool_alloc_t and mempool_free_t for a simple page allocator that @@ -102,16 +104,11 @@ static inline mempool_t *mempool_create_kmalloc_pool(int min_nr, size_t size) void *mempool_alloc_pages(gfp_t gfp_mask, void *pool_data); void mempool_free_pages(void *element, void *pool_data); -static inline int mempool_init_page_pool(mempool_t *pool, int min_nr, int order) -{ - return mempool_init(pool, min_nr, mempool_alloc_pages, - mempool_free_pages, (void *)(long)order); -} - -static inline mempool_t *mempool_create_page_pool(int min_nr, int order) -{ - return mempool_create(min_nr, mempool_alloc_pages, mempool_free_pages, - (void *)(long)order); -} +#define mempool_init_page_pool(_pool, _min_nr, _order) \ + mempool_init(_pool, (_min_nr), mempool_alloc_pages, \ + mempool_free_pages, (void *)(long)(_order)) +#define mempool_create_page_pool(_min_nr, _order) \ + mempool_create((_min_nr), mempool_alloc_pages, \ + mempool_free_pages, (void *)(long)(_order)) #endif /* _LINUX_MEMPOOL_H */ diff --git a/mm/mempool.c b/mm/mempool.c index dbbf0e9fb424..c47ff883cf36 100644 --- a/mm/mempool.c +++ b/mm/mempool.c @@ -240,17 +240,17 @@ EXPORT_SYMBOL(mempool_init_node); * * Return: %0 on success, negative error code otherwise. */ -int mempool_init(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn, - mempool_free_t *free_fn, void *pool_data) +int mempool_init_noprof(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn, + mempool_free_t *free_fn, void *pool_data) { return mempool_init_node(pool, min_nr, alloc_fn, free_fn, pool_data, GFP_KERNEL, NUMA_NO_NODE); } -EXPORT_SYMBOL(mempool_init); +EXPORT_SYMBOL(mempool_init_noprof); /** - * mempool_create - create a memory pool + * mempool_create_node - create a memory pool * @min_nr: the minimum number of elements guaranteed to be * allocated for this pool. * @alloc_fn: user-defined element-allocation function. @@ -265,17 +265,9 @@ EXPORT_SYMBOL(mempool_init); * * Return: pointer to the created memory pool object or %NULL on error. */ -mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, - mempool_free_t *free_fn, void *pool_data) -{ - return mempool_create_node(min_nr, alloc_fn, free_fn, pool_data, - GFP_KERNEL, NUMA_NO_NODE); -} -EXPORT_SYMBOL(mempool_create); - -mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, - mempool_free_t *free_fn, void *pool_data, - gfp_t gfp_mask, int node_id) +mempool_t *mempool_create_node_noprof(int min_nr, mempool_alloc_t *alloc_fn, + mempool_free_t *free_fn, void *pool_data, + gfp_t gfp_mask, int node_id) { mempool_t *pool; @@ -291,7 +283,7 @@ mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, return pool; } -EXPORT_SYMBOL(mempool_create_node); +EXPORT_SYMBOL(mempool_create_node_noprof); /** * mempool_resize - resize an existing memory pool @@ -374,7 +366,7 @@ int mempool_resize(mempool_t *pool, int new_min_nr) EXPORT_SYMBOL(mempool_resize); /** - * mempool_alloc - allocate an element from a specific memory pool + * mempool_alloc_noprof - allocate an element from a specific memory pool * @pool: pointer to the memory pool which was allocated via * mempool_create(). * @gfp_mask: the usual allocation bitmask. @@ -387,7 +379,7 @@ EXPORT_SYMBOL(mempool_resize); * * Return: pointer to the allocated element or %NULL on error. */ -void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask) +void *mempool_alloc_noprof(mempool_t *pool, gfp_t gfp_mask) { void *element; unsigned long flags; @@ -454,7 +446,7 @@ void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask) finish_wait(&pool->wait, &wait); goto repeat_alloc; } -EXPORT_SYMBOL(mempool_alloc); +EXPORT_SYMBOL(mempool_alloc_noprof); /** * mempool_alloc_preallocated - allocate an element from preallocated elements @@ -562,7 +554,7 @@ void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data) { struct kmem_cache *mem = pool_data; VM_BUG_ON(mem->ctor); - return kmem_cache_alloc(mem, gfp_mask); + return kmem_cache_alloc_noprof(mem, gfp_mask); } EXPORT_SYMBOL(mempool_alloc_slab); @@ -580,7 +572,7 @@ EXPORT_SYMBOL(mempool_free_slab); void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data) { size_t size = (size_t)pool_data; - return kmalloc(size, gfp_mask); + return kmalloc_noprof(size, gfp_mask); } EXPORT_SYMBOL(mempool_kmalloc); @@ -597,7 +589,7 @@ EXPORT_SYMBOL(mempool_kfree); void *mempool_alloc_pages(gfp_t gfp_mask, void *pool_data) { int order = (int)(long)pool_data; - return alloc_pages(gfp_mask, order); + return alloc_pages_noprof(gfp_mask, order); } EXPORT_SYMBOL(mempool_alloc_pages);