Message ID | 20231024134637.3120277-28-surenb@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 3494FC07545 for <linux-mm@archiver.kernel.org>; Tue, 24 Oct 2023 13:48:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 04A1E6B0288; Tue, 24 Oct 2023 09:47:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F13826B0289; Tue, 24 Oct 2023 09:47:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8EA46B028A; Tue, 24 Oct 2023 09:47:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id BAB936B0288 for <linux-mm@kvack.org>; Tue, 24 Oct 2023 09:47:44 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8E2F7C057E for <linux-mm@kvack.org>; Tue, 24 Oct 2023 13:47:44 +0000 (UTC) X-FDA: 81380482848.11.8BC0CCE Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf18.hostedemail.com (Postfix) with ESMTP id C7EB81C000D for <linux-mm@kvack.org>; Tue, 24 Oct 2023 13:47:42 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=qpUmIIG0; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf18.hostedemail.com: domain of 3_co3ZQYKCKIUWTGPDIQQING.EQONKPWZ-OOMXCEM.QTI@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3_co3ZQYKCKIUWTGPDIQQING.EQONKPWZ-OOMXCEM.QTI@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698155262; 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=wChZbZdPrjdzw8yNa1DdlAJuF9I/RLt/gyhxqa0kGe0=; b=s4IJzxVdAGMmIc5eYgDQgQWL8NS4eBuLvaZERwAnv/c0EJ9KnIi4S591+DRpzSWlNvXpEo v8/rvFC/9aDslTs9yOL78Jii+5TdEgWRoTi/a8p7baL49wbw8OCzmw3cZU5SVyFj3ZUPH/ AXgyh2kixmnYtGFyM9rWNUgLjwB55Sg= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=qpUmIIG0; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf18.hostedemail.com: domain of 3_co3ZQYKCKIUWTGPDIQQING.EQONKPWZ-OOMXCEM.QTI@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3_co3ZQYKCKIUWTGPDIQQING.EQONKPWZ-OOMXCEM.QTI@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698155262; a=rsa-sha256; cv=none; b=w3VInNfAA03qI6ZQ9N40dl5hKGOwpIOEFPJSqo1VA6MWFqYAggs6VTJCPcKd5IHlaIApxZ NxgZ3GVREE7UJZTDDxG4AIF/DBnT11YWkuJ4uPMzCuShH0gEGv8YBCbx5/VDPYlOiVGljQ YOcRgRzr5er0QuZr/K/W4577Tj5Mfzk= Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-d9a541b720aso5409415276.0 for <linux-mm@kvack.org>; Tue, 24 Oct 2023 06:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698155262; x=1698760062; 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=wChZbZdPrjdzw8yNa1DdlAJuF9I/RLt/gyhxqa0kGe0=; b=qpUmIIG0+5v/4qZPJW2GZqDDkUQ6gtoczuXfJod3j7f9POF2V9t79o0W68sU4mbZLQ x6oAQ2cKp/owiMV4BOtGDu0aYhRuKMPUD4MhekMzZ1gEbi5yxsB83R+3e5yyVMvxN0s8 6b6YkCqhiJdParpI8b23OtQ+BkhLpBPv6Ym5aIRugpx7we/rvhZbYjBs6tN6Va20G4st K7SAwmIeS3IlKn57MAk3FKD3qg0up/P59TdP7eT0wfxBLZK8S2aVWKiDWwwtJuiasxkQ o2QvGfazNfrK8q5Ziij3OQw2IAbE8TsP6dm+PyzTmkIWpo9ppxefjssWeAMqFypTf1OW +w9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698155262; x=1698760062; 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=wChZbZdPrjdzw8yNa1DdlAJuF9I/RLt/gyhxqa0kGe0=; b=U2BQTOCAsdjoIRGUCEooTpX1ZPYQouXxs44vr9XMz7d2AhxD9/x4akPcAKxyd/Xtqw Oab986zEK/QGaEfIgb8xSc6LJ0dI1jOvWv4sv9fNjUc/NFPZRRQwr8RtjSzaGPwDai0H VVH5du0nxyMZ/gnovyZ5b0XmCgKQfnN+cJy43yn2tMJPoC4SfXrQ/yceMAciNGwBq6Q2 DgClpxLlVTC3a3ouFAcZN4vchI/t38wq7dC9+QZZeKvfI5z2pn86Hy/+PBC/Lv1XG9hA 40XcJvmhQLWePuwEQUTCR7nFJ+LyHKN/F5CG6ltDiPNaAhu4FiMmzDKPR9blG9LeeDh+ H/Qg== X-Gm-Message-State: AOJu0YzRb0P5BiKdX/VlD5ucguO96eGrgMvQJbjIHhwjjpS3RHDwKG6I CTgglmn9SyslfaVHBsbCloaJCytKeXM= X-Google-Smtp-Source: AGHT+IGcrV5EmbtfxBae51aMAnIIsiAAzPfQg3R0miJy2XM7/Ak0S71e3wg0OW88a6RB4IGUgmC4AuntPsg= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:45ba:3318:d7a5:336a]) (user=surenb job=sendgmr) by 2002:a25:7755:0:b0:d9a:519f:d0e6 with SMTP id s82-20020a257755000000b00d9a519fd0e6mr234250ybc.6.1698155261852; Tue, 24 Oct 2023 06:47:41 -0700 (PDT) Date: Tue, 24 Oct 2023 06:46:24 -0700 In-Reply-To: <20231024134637.3120277-1-surenb@google.com> Mime-Version: 1.0 References: <20231024134637.3120277-1-surenb@google.com> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog Message-ID: <20231024134637.3120277-28-surenb@google.com> Subject: [PATCH v2 27/39] xfs: Memory allocation profiling fixups From: Suren Baghdasaryan <surenb@google.com> 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, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, ldufour@linux.ibm.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 Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C7EB81C000D X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: wctfg95w41g9ai86ktmhqcuaj3cbrs17 X-HE-Tag: 1698155262-243981 X-HE-Meta: U2FsdGVkX180s8P5w+LRNN2/QDCU6VREogU2UG25u+IemctT4k9PAxMMYcNoQabFJ0chDf3ruqxv3+LbCETtnXUivLRygra7dyPcfLjEoNCnO0yE5fygmaXSUHk4PF26I6qDIrDxZWMW8EXrMobjAUbtGV0FJfN7kmqdk3FPHQ8PuKL4yWf6CJ6cE22XjsFXtuRoN2PtRPPWBPxLCX04tMIiN7l/r3aMEiy34tgb0lDcr8KnZnYUPfo6oxDtMWyiIm7zUt3Fljkh4pDPv/trtQj7Bjoz+yQq1ZUPBve+GcScv7YUKHQD1zy/LlKEcb7aVwDkUItx1CTsWQYjF0EAP5c7CigHCqUAGG5sFTsNfaiHfZahRNoXmKbzjKIQ5a98vuj9688WU/xnPA4CY87RZ9PTs/ORGAvRlCM1vQlhBhZIMugWRW9MZfyn44LYAAXub6xgLi8BFa3UdR4chd08UbfPBwFcjfRSe3DjBkKTvONXTGI0zGDaCvwbblTDre1jlpAxguSuoie8pAVIXbwSfxP8M8JdiNH/sD+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HjSKtT4lIQKmFhq6Zp0L6IaaAe9l1XiecetscqBuoJxCSRyE+TC3z60V2ANSONv8huzdB/SspV/Luzo96/T9pv1NBIQ== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Memory allocation profiling
|
expand
|
diff --git a/fs/xfs/kmem.c b/fs/xfs/kmem.c index c557a030acfe..9aa57a4e2478 100644 --- a/fs/xfs/kmem.c +++ b/fs/xfs/kmem.c @@ -8,7 +8,7 @@ #include "xfs_trace.h" void * -kmem_alloc(size_t size, xfs_km_flags_t flags) +kmem_alloc_noprof(size_t size, xfs_km_flags_t flags) { int retries = 0; gfp_t lflags = kmem_flags_convert(flags); @@ -17,7 +17,7 @@ kmem_alloc(size_t size, xfs_km_flags_t flags) trace_kmem_alloc(size, flags, _RET_IP_); do { - ptr = kmalloc(size, lflags); + ptr = kmalloc_noprof(size, lflags); if (ptr || (flags & KM_MAYFAIL)) return ptr; if (!(++retries % 100)) diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h index b987dc2c6851..c4cf1dc2a7af 100644 --- a/fs/xfs/kmem.h +++ b/fs/xfs/kmem.h @@ -6,6 +6,7 @@ #ifndef __XFS_SUPPORT_KMEM_H__ #define __XFS_SUPPORT_KMEM_H__ +#include <linux/alloc_tag.h> #include <linux/slab.h> #include <linux/sched.h> #include <linux/mm.h> @@ -56,18 +57,15 @@ kmem_flags_convert(xfs_km_flags_t flags) return lflags; } -extern void *kmem_alloc(size_t, xfs_km_flags_t); static inline void kmem_free(const void *ptr) { kvfree(ptr); } +extern void *kmem_alloc_noprof(size_t, xfs_km_flags_t); +#define kmem_alloc(...) alloc_hooks(kmem_alloc_noprof(__VA_ARGS__)) -static inline void * -kmem_zalloc(size_t size, xfs_km_flags_t flags) -{ - return kmem_alloc(size, flags | KM_ZERO); -} +#define kmem_zalloc(_size, _flags) kmem_alloc((_size), (_flags) | KM_ZERO) /* * Zone interfaces