linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: linux-mm@kvack.org, akpm@linux-foundation.org
Cc: Wei Xu <weixugc@google.com>, Huang Ying <ying.huang@intel.com>,
	Yang Shi <shy828301@gmail.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Tim C Chen <tim.c.chen@intel.com>,
	Michal Hocko <mhocko@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Hesham Almatary <hesham.almatary@huawei.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Alistair Popple <apopple@nvidia.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	jvgediya.oss@gmail.com, Bharata B Rao <bharata@amd.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Subject: [PATCH mm-unstable] mm/demotion: Fix build error with CONFIG_MIGRATION disabled
Date: Tue, 30 Aug 2022 10:12:10 +0530	[thread overview]
Message-ID: <20220830044210.17546-1-aneesh.kumar@linux.ibm.com> (raw)

mm/memory-tiers.c: In function ‘toptier_nodes_show’:
mm/memory-tiers.c:647:49: error: ‘top_tier_adistance’ undeclared (first use in this function); did you mean ‘iov_iter_advance’?
  647 |                 if (memtier->adistance_start >= top_tier_adistance)
      |                                                 ^~~~~~~~~~~~~~~~~~
      |                                                 iov_iter_advance
mm/memory-tiers.c:647:49: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [scripts/Makefile.build:249: mm/memory-tiers.o] Error 1

Fixes: mm/demotion: Expose memory tier details via sysfs
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 mm/memory-tiers.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
index d4648d4e4d54..b6c7e5987829 100644
--- a/mm/memory-tiers.c
+++ b/mm/memory-tiers.c
@@ -635,6 +635,7 @@ static int __meminit memtier_hotplug_callback(struct notifier_block *self,
 	return notifier_from_errno(0);
 }
 
+#ifdef CONFIG_MIGRATION
 static ssize_t toptier_nodes_show(struct device *dev,
 				     struct device_attribute *attr, char *buf)
 {
@@ -654,6 +655,15 @@ static ssize_t toptier_nodes_show(struct device *dev,
 	mutex_unlock(&memory_tier_lock);
 	return ret;
 }
+#else
+static ssize_t toptier_nodes_show(struct device *dev,
+				  struct device_attribute *attr, char *buf)
+{
+	nodemask_t top_tier_mask = node_states[N_MEMORY];
+
+	return sysfs_emit(buf, "%*pbl\n", nodemask_pr_args(&top_tier_mask));
+}
+#endif
 static DEVICE_ATTR_RO(toptier_nodes);
 
 static struct attribute *memtier_subsys_attrs[] = {
-- 
2.37.2



                 reply	other threads:[~2022-08-30  4:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220830044210.17546-1-aneesh.kumar@linux.ibm.com \
    --to=aneesh.kumar@linux.ibm.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=bharata@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave@stgolabs.net \
    --cc=hannes@cmpxchg.org \
    --cc=hesham.almatary@huawei.com \
    --cc=jvgediya.oss@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=shy828301@gmail.com \
    --cc=tim.c.chen@intel.com \
    --cc=weixugc@google.com \
    --cc=ying.huang@intel.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