From patchwork Wed Feb 21 19:40:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13566205 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 14AFEC5478A for ; Wed, 21 Feb 2024 19:42:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BC666B00B6; Wed, 21 Feb 2024 14:41:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 31C5D6B00B8; Wed, 21 Feb 2024 14:41:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0AB556B00B9; Wed, 21 Feb 2024 14:41:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E48466B00B6 for ; Wed, 21 Feb 2024 14:41:54 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BF46612077A for ; Wed, 21 Feb 2024 19:41:54 +0000 (UTC) X-FDA: 81816831348.23.A796B81 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf17.hostedemail.com (Postfix) with ESMTP id DD88A4000C for ; Wed, 21 Feb 2024 19:41:52 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=koHPh63D; spf=pass (imf17.hostedemail.com: domain of 3_1HWZQYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3_1HWZQYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708544512; 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=YoA/f6AawOcdYOB/BdjtQvWuhk/43MsQdrDrIZmlE2o=; b=1J4B+8LC7quNVIYGmKgEAota1I/5mxmD1ypA+nf+omJvaeVQtHPh08g5p817qJAknSl+aT XDM2Pq9YS7y1f84H5RvSsmcl5LyveH+DO/vHuIKl8GmhfZMCWbUk5xbfiKrGnb7k5iZnkc Yi2QVQ3pGmAhFG3KEuzRcEUrqQYTDfE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708544512; a=rsa-sha256; cv=none; b=55im1bf3ZGrTvv8Y5uUqRkoUEl1joF8XGwbyug3m4czk2FwSu376YYNFJ29KyGZ4iFBext x9sX1jYsy9oajHZCjnICvA/YIEMGYe2OwdrovJxayb8qd/Z061iDLfAhWNaD3RD805/XGR PVFv3vCc7O3+Rc+JNKxPrSMaCf1hB1s= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=koHPh63D; spf=pass (imf17.hostedemail.com: domain of 3_1HWZQYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3_1HWZQYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc6b5d1899eso213911276.0 for ; Wed, 21 Feb 2024 11:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708544512; x=1709149312; 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=YoA/f6AawOcdYOB/BdjtQvWuhk/43MsQdrDrIZmlE2o=; b=koHPh63D53uB2csa9wlQ5IJHJRvc5wF1D2qDWZ4q2j301V1RJq8hmmhLvj9alRgrHe n0NaPNdwPilM+mmjIU6tM+2L388d6ONe0afKPGb41hZrrGaKbsLrZSYLLVIFpoHZxDZh zzCfjoXFNghH5Ry5y054js958MFMlaw51WjO+oFtYXF0AT93GfXwo/WgGXKItRZ9DUWe kfPgL+WJOlertACYIjMDQgIm7E3fOQyjK+EF3KXaKOccYg6FLXcSFnTIRZ1iXzmzSo8S 9ucocL9hL/cRRtgrNlOKj8EDRAfBUyq9xh02AJhDkJWptb6zfWk302U1SA958ZRWe3ng IunA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708544512; x=1709149312; 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=YoA/f6AawOcdYOB/BdjtQvWuhk/43MsQdrDrIZmlE2o=; b=f+IWqsgzM0Ii4NF6wGWkpDSdgQ+yZMYFBnzAqHds2BU2bms1qzne/Dlenxn2XY/R/2 IYKUfIs1s4gHgB2LKjuSUgIHscJ3V2hC9F4U5+1C7uRqzMmo7rquppPl+U4VlsybN09H MrIfaI6GExoEwIAH50m5UWWfa3eIFcytDk74XIya3MUUzdU/VxCuz1tr3Oo0hv3a+G4q GhSlbJPpRakIj5KhVg6XEmkWo2NaE4XOwYljcJu0QXgFYRJAgDWre9DD8gysB9xUx9t1 7p1JYG5zi53HNySUWllwrgztYo3KtICs/igp4XsR6uiMANV1Uxk8ijI60IOprHvwp0Bj HrKQ== X-Forwarded-Encrypted: i=1; AJvYcCUPqk2Vcrkw1MTDpBCXHcOXamXJLXBBBWvHtqBJfrnclYCwbEe4gpdZlmnJCSoVNUGMuhO+eZltFVo9eMC7fZw9I2o= X-Gm-Message-State: AOJu0YwZBPGrPdcYQEktDQFezpYX5Os2fuJhV6obs1GHBgza7UkuoMHJ KBtmdANZUhLt7jbuvvfhZKdpqj5zFWk9a3N7p+GvLnj5W61SMk9AiB2uDi4txfw7P+V4GZYbESe Tmw== X-Google-Smtp-Source: AGHT+IGZfB101wk4OhxM7/wqk5VOpnI9XqfFl6eMKnLGtgB+oOIFBy+VqLgKH5b+IHr8remNjBUIBw3H4Zo= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:953b:9a4e:1e10:3f07]) (user=surenb job=sendgmr) by 2002:a25:c5cd:0:b0:dc7:463a:46d2 with SMTP id v196-20020a25c5cd000000b00dc7463a46d2mr46740ybe.0.1708544511751; Wed, 21 Feb 2024 11:41:51 -0800 (PST) Date: Wed, 21 Feb 2024 11:40:38 -0800 In-Reply-To: <20240221194052.927623-1-surenb@google.com> Mime-Version: 1.0 References: <20240221194052.927623-1-surenb@google.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Message-ID: <20240221194052.927623-26-surenb@google.com> Subject: [PATCH v4 25/36] 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, 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, 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: DD88A4000C X-Rspam-User: X-Stat-Signature: nxinsumxnb9s6pfjyyf8ni787rk5b6yh X-Rspamd-Server: rspam03 X-HE-Tag: 1708544512-454035 X-HE-Meta: U2FsdGVkX195pmTq6f4+I+fZY22OIEMWIS2q28iWeGcDbxpHf4r5PZlLFBKqwzYcKgkny3Xb0MjDFq4BsPocKKcqHYayu0scvA5ttVVFxPr6k1qEypq7CPhOkVklt0dl1KqRGqqxZaqAZqqCAbQOETCYhtGxMgzmynoAU5fu4t1dis0+MYm772D7EkneYeWKOJi8TV6aLOuOpZtnyQqjUHI+gUSHjysNWy+8fR/Sp/cBF5qlFlfWso2IflfDeJw/Olu3fA1a5RL8ng8pAfzFuK8hJLq1cvRf1RToGgYGWDM8KZUl0QxTwko/LruxKT16mgQpoJRn5vCjCmRIiCidDXL1uZKtDnw3u3Wr8sXEt+WmEr+8pvNU7/ITHWI4WBMgrg0mg5Hjy8TgmVfBBzVV2Dg5o16lIaWwouBH3CzRN7GVoF0iVFapaUi6DOSCB6ktqS1iXobZtpLSrzvplRU2cTVbSQuygAeM6HhUkn59CRMQIdlUffu0+uZJwrOXc/+x9Q0RDUBfuHE1oRHYUrDYs8m75c6hyUN/MUrr45/20wCHG5w9w0+sM2twUiy3Rn8QRLesmTogab6dwkQSVZxTyc/AIeNxgGqrpvYKtwly8u1BqpfPHX6vgUB/At/LQ8P3Bp4LEYFNDGpmFf8w1T+F9Yjangk/la87++NkFuUIhm5lwIO3DkDkLUMPCrygN0PrKFuY/ujkFomB5KPzGOt+VrDRib2RLANON1wNujXYwtFDNfDcfirks/fkokKMjJi4cwplfeGgpvgAdXvoP54GSSxSGRyh90dlhB/DRrahVIcEXgdK9YJbvk1f7V8FkV7UF16r7kNHkn2j3bYI+0Dlzw0ZJbmuYAXiJglbtUYHoEs6T8Hd/v2tjmkSoky/6SRHC0sRhT6SuIGwiE9zEX1+pqF3AtRFROUG2fNJJB4VMr3E5sj4kvIPndN4kppQg4Ev6s7i9yljfunjAw4dTBw fEbkSLkn 3YTghXOzuw8G7Lo+WYcBiv0+XQzxbeOvcZM1w/CSRcKJ2lRFK+L1UJCCRepvVsy24f+PHT0wde7AsZU2Jn21SYMW+fGdzSkGlMUkqa+my4gxIQP3E0mAY5pQYvb+hcEoDbfixk+QiuvBY1eUWJ1rmVH0CPNXdb+YF3ISfl4q5tqq4ZMYjzmyKdpSE2JPTa2R6nFxtmaa1IHyzE79j7KqN3ymRD5j4qMzSZoO5TLSo2uVU2L97my72c1+X+xPRdmJIQ+CsM0RCrsNOUoFHQjIxBcHZ64cfV/i8AfDP9wuhCa+FZ/kR0jyM1uWKrEee8YGBppP+dVNmhSkRilJ1RPU3KwBmJnsPqY/QVIQeR+KGcnkrX7vlskbnkN0yTU+YoQ/XDDr6wSgAfQ6SvlVbVfFwoPwV5Jdt3teFbUMJbVddRXgoA+7rROnShd6DJMMJP3LFvXHMUpxR7tvGiMfjwIziTfUCD6tfdY+9krvW6xqiflQK4n6WGms+YUSGCBv5PXaNJPD+9Fq5+ZXC0J1lXZkbtIQSfhd5sESgD9Hb+nUDYZR+9vxkvdQWR6Zl/QGnrks/VZZDLvDlSj71CUYzEObng8JZwsfgzME7xBPixixAHHkhWYzKCnaVEITCfUsND5qDLi+fFvtXF54jtFHaPRiU8wOqQxqg0Nk7SgDMSoyCM21MeQwSQz4jjC/Htw== 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);