From patchwork Thu Jul 11 17:02:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13730922 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 DCD97C3DA49 for ; Thu, 11 Jul 2024 17:02:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6FBD66B00A3; Thu, 11 Jul 2024 13:02:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6AA076B00A4; Thu, 11 Jul 2024 13:02:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 571D86B00A5; Thu, 11 Jul 2024 13:02:25 -0400 (EDT) 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 2E8216B00A3 for ; Thu, 11 Jul 2024 13:02:25 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DE94BA0780 for ; Thu, 11 Jul 2024 17:02:24 +0000 (UTC) X-FDA: 82328090208.22.416663E Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf14.hostedemail.com (Postfix) with ESMTP id 11048100024 for ; Thu, 11 Jul 2024 17:02:21 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=clmDaD1J; spf=pass (imf14.hostedemail.com: domain of 3HBCQZgYKCLcprobkYdlldib.Zljifkru-jjhsXZh.lod@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3HBCQZgYKCLcprobkYdlldib.Zljifkru-jjhsXZh.lod@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=1720717325; 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: references:dkim-signature; bh=faUXYQX/NPjNwWRBOvRIcnxaagQhXf0tTHr83ryFsFo=; b=Ev9lXD57bdaypVAqiJkj0+UIPm5YjDIf2Ztdwebn01yMVIzCFFTKCwIRc9hk+oH4PKVxAj qGeg9owaLDIvtvqF7WrioGH8dVXpSl6+eCaoV0rr6DUNODcrbid1SLmCazPoL239M/CMH4 i/Vr+LSwHr2/h0dihcjDLAkmuw6AhYA= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=clmDaD1J; spf=pass (imf14.hostedemail.com: domain of 3HBCQZgYKCLcprobkYdlldib.Zljifkru-jjhsXZh.lod@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3HBCQZgYKCLcprobkYdlldib.Zljifkru-jjhsXZh.lod@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720717325; a=rsa-sha256; cv=none; b=HtSWuO1A0yW5wbIJyn5MTs2fGUlzhkoAdDSUHJNxHzuZp2ZWPhnW8KYDKjWIqdTaZmVso+ AhJDgOssQYfTKkbftp2U/8jeWgKCPpSjN6LuodNXGsVfTKeW/+Hyei+oerrdd/U+u/4N9E AsGETZ9kmodsABrBVA1Dn8RQaI9X1vI= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-64f30b1f8ecso15964617b3.3 for ; Thu, 11 Jul 2024 10:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1720717341; x=1721322141; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=faUXYQX/NPjNwWRBOvRIcnxaagQhXf0tTHr83ryFsFo=; b=clmDaD1JF6gGGs/jbrcpGrfEBVcw4wxk3eANEJdsnaMjQ5KwUlq3legHkHM8nUz9vk JLd/VOQ1gVNnJ8Yxhvs05nVmmAbCA50k5xooERFpczEmqL39sAwpOG6v9+HP0kfOBQQZ EAMLJ12vF5HNxnwbNN2yEYlJ0AEd0W6xDJbOCfEiBACJxiRnNXSwS0agRI+3PrGaIJPC qcVm8+moyHCL49Vh6zAVdQBxunea7I4kDAIOi4RziPoVgmUygNF+P6N3teRmjqxGI/21 oC/30LKRsfsog1ylEO4FycSLnB1Je21WGc5HmrTEstsZiVWCd24A9OJxKISL5XUNEPdP 8ZIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720717341; x=1721322141; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=faUXYQX/NPjNwWRBOvRIcnxaagQhXf0tTHr83ryFsFo=; b=Ks0l1BaGUlVUcULRqce+xRKp2+eDTlYvFWtGW+I/SNe8SrcGI1Jk7UbDD5eM13uKwG cmSY5j/dTL1bisu1/q5UHsEDmhhHdqyfPoWazDX8M3qSC2/7OMRhr5EgrS/EqSbucD44 W3wU1J6ROHioQA8ZtPWCwr+8waF+Nf73nqzAVHba6OpJLLWxu7/7qJmeM5ODzswExsM7 6bJCrNSXKn1dDb3zrF/t8aVdsrNJ10PRvKaGRHEqojFF+Kvy+abeeq+eoV62kIWL8nOj ZsKRgMP58JJAyVojSJXljnlRKkoh91k1mKdr6A1JYrZE0mCRZZLE+/B/LseRTnwjgIQX 16aw== X-Forwarded-Encrypted: i=1; AJvYcCUhuL/PaqNMY1DTuXuPqFWHdk89FufXzzg6yxmd+HjMFNKShNp45os2QBPw/ViQWsZ2iwqrQHOM+vYx6O11NkC/RKA= X-Gm-Message-State: AOJu0YySiF30GC6l5f+Cy12O1TW6bXrp6ekr8KvvkX0s8dkKtVwFHabv OiVmPPb9a5nehPVi6m+RJvtgiHEPaRAKDBvMPpicsYU6rh/OL5R0dCiSzmzeTH8b5NGrgA/TWkf B3A== X-Google-Smtp-Source: AGHT+IEH2cBMCGGN+S9iv+gX76zKXY9neF03TmVjkK8wKg2bNrwEGyY3g1U4ZR0jGWCuRUKjbpCQVlGCQrs= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:e0a6:8638:6754:d2a1]) (user=surenb job=sendgmr) by 2002:a05:6902:2504:b0:e03:ac6c:91b0 with SMTP id 3f1490d57ef6-e041b05837dmr384182276.5.1720717340863; Thu, 11 Jul 2024 10:02:20 -0700 (PDT) Date: Thu, 11 Jul 2024 10:02:16 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.993.g49e7a77208-goog Message-ID: <20240711170216.1149695-1-surenb@google.com> Subject: [PATCH 1/1] mm, slab: move prepare_slab_obj_exts_hook under CONFIG_MEM_ALLOC_PROFILING From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: vbabka@suse.cz, sxwjean@me.com, xiongwei.song@linux.dev, willy@infradead.org, nathan@kernel.org, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , kernel test robot X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 11048100024 X-Stat-Signature: drphemwsb951pehzaa4jjau7x6pr1bdy X-HE-Tag: 1720717341-516461 X-HE-Meta: U2FsdGVkX18vu6q6fobLrVhwnnwRK87UL6nhYMKQjAgWKqOHQcY4g49BYJUILt6HMJumO6GwVmGjyh56/Q6St4YhxYCOElPx9E2AM7COahphmaz0VHyfjtjL/3fdQjsYlLhh63kRBLJDUxJUO9RQcdP2WNjId4WeQtcT/bknYYR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XkcVjSo9akw6fln+jrzuCIJAvsUm3k45phYNBlFcIkamy897tKB0E/NiX9VHqNExHBYREVEv9y6YabkQtoJaqgqN94tO1P4ztVrjsBnwbN50ZZjiVaAwHjsWy+LQcL35kWLZxau4B/vwRueYYwc6EEK1zYUBPKFgNVxVWZKe031FjdToAnOlPCG9bbGKP4QXg9CyQgT85NVJ4ScRlBwNlRhhu6EP2l51d1S7M8Knipzik5EfxQiH7mUOHO6fqioQSxBaVpwXlOH1M+nM8iRw/Ujj6hgN6DqbjARN5h6qqcgPr05bJ0v0f91kJpgNu3u2GWRlzRwQPWr5AYrtu4ZrsJg3+k/m+Lrfg1LXd3y4ui/xK5l0hpGgLqq0vxTae802igGl+30rQ1fP4l5fnzpePCamkhD3iFzYNivsu8s9OqZlfiOsR69vJvPZn0KoHXR4wWBvnYNSD1qL4SY= 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: The only place prepare_slab_obj_exts_hook() is currently being used is from alloc_tagging_slab_alloc_hook() when CONFIG_MEM_ALLOC_PROFILING=y. Move its definition under CONFIG_MEM_ALLOC_PROFILING to prevent unused function warning for CONFIG_SLAB_OBJ_EXT=n case. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202407050845.zNONqauD-lkp@intel.com/ Signed-off-by: Suren Baghdasaryan Cc: Vlastimil Babka Reviewed-by: Xiongwei Song --- Applied over slab/for-next because of the refactoring [1] in that branch. [1] 302a3ea38aec ("mm, slab: move allocation tagging code in the alloc path into a hook") mm/slub.c | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) base-commit: fe4e761669ab4d8b388fdb6e9dbe9a110eed8009 diff --git a/mm/slub.c b/mm/slub.c index ce39544acf7c..829a1f08e8a2 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2027,6 +2027,27 @@ static inline bool need_slab_obj_ext(void) return false; } +#else /* CONFIG_SLAB_OBJ_EXT */ + +static int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s, + gfp_t gfp, bool new_slab) +{ + return 0; +} + +static inline void free_slab_obj_exts(struct slab *slab) +{ +} + +static inline bool need_slab_obj_ext(void) +{ + return false; +} + +#endif /* CONFIG_SLAB_OBJ_EXT */ + +#ifdef CONFIG_MEM_ALLOC_PROFILING + static inline struct slabobj_ext * prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) { @@ -2051,33 +2072,6 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) return slab_obj_exts(slab) + obj_to_index(s, slab, p); } -#else /* CONFIG_SLAB_OBJ_EXT */ - -static int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s, - gfp_t gfp, bool new_slab) -{ - return 0; -} - -static inline void free_slab_obj_exts(struct slab *slab) -{ -} - -static inline bool need_slab_obj_ext(void) -{ - return false; -} - -static inline struct slabobj_ext * -prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) -{ - return NULL; -} - -#endif /* CONFIG_SLAB_OBJ_EXT */ - -#ifdef CONFIG_MEM_ALLOC_PROFILING - static inline void alloc_tagging_slab_alloc_hook(struct kmem_cache *s, void *object, gfp_t flags) {