linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Roberts <ryan.roberts@arm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>,
	kernel test robot <lkp@intel.com>,
	oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Barry Song <v-songbaohua@oppo.com>
Subject: [PATCH] mm: thp: Fix build warning when CONFIG_SYSFS is disabled
Date: Mon, 11 Dec 2023 12:53:20 +0000	[thread overview]
Message-ID: <20231211125320.3997543-1-ryan.roberts@arm.com> (raw)
In-Reply-To: <202312111916.YbsHxKPq-lkp@intel.com>

huge_anon_orders_lock is used only to serialize sysfs writers. So move
its definition so that it is within the CONFIG_SYSFS ifdefery to
suppress "defined but not used" warning when sysfs is disabled.

Fixes: fe2c9313a8c0 ("mm: thp: Introduce multi-size THP sysfs interface")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312111916.YbsHxKPq-lkp@intel.com/
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
---

Hi Andrew,

David mentioned that your preference is to squash minor fixes into patches in
mm-unstable? Could you please squash this into commit fe2c9313a8c0 ("mm: thp:
Introduce multi-size THP sysfs interface")?

Thanks,
Ryan

 mm/huge_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index cfb1d04a71b1..ddf73422d3b5 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -77,7 +77,6 @@ unsigned long huge_zero_pfn __read_mostly = ~0UL;
 unsigned long huge_anon_orders_always __read_mostly;
 unsigned long huge_anon_orders_madvise __read_mostly;
 unsigned long huge_anon_orders_inherit __read_mostly;
-static DEFINE_SPINLOCK(huge_anon_orders_lock);

 unsigned long __thp_vma_allowable_orders(struct vm_area_struct *vma,
 					 unsigned long vm_flags, bool smaps,
@@ -442,6 +441,7 @@ static const struct attribute_group hugepage_attr_group = {

 static void hugepage_exit_sysfs(struct kobject *hugepage_kobj);
 static void thpsize_release(struct kobject *kobj);
+static DEFINE_SPINLOCK(huge_anon_orders_lock);
 static LIST_HEAD(thpsize_list);

 struct thpsize {
--
2.25.1



      reply	other threads:[~2023-12-11 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 11:37 [linux-next:master 6443/6992] mm/huge_memory.c:80:24: warning: 'huge_anon_orders_lock' defined but not used kernel test robot
2023-12-11 12:53 ` Ryan Roberts [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231211125320.3997543-1-ryan.roberts@arm.com \
    --to=ryan.roberts@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=v-songbaohua@oppo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox