From: Cong Wang <amwang@redhat.com>
To: Mel Gorman <mgorman@suse.de>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
Andi Kleen <andi@firstfloor.org>,
linux-mm@kvack.org
Subject: Re: [Patch] mm: make CONFIG_NUMA depend on CONFIG_SYSFS
Date: Tue, 19 Jul 2011 14:20:15 +0800 [thread overview]
Message-ID: <4E25221F.6060605@redhat.com> (raw)
In-Reply-To: <20110718135243.GA5349@suse.de>
[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]
ao? 2011a1'07ae??18ae?JPY 21:52, Mel Gorman a??e??:
> On Mon, Jul 18, 2011 at 07:18:29PM +0800, Amerigo Wang wrote:
>> On ppc, we got this build error with randconfig:
>>
>> drivers/built-in.o:(.toc1+0xf90): undefined reference to `vmstat_text': 1 errors in 1 logs
>>
>> This is due to that it enabled CONFIG_NUMA but not CONFIG_SYSFS.
>>
>> And the user-space tool numactl depends on sysfs files too.
>> So, I think it is very reasonable to make CONFIG_NUMA depend on CONFIG_SYSFS.
>>
>
> That looks a bit awful. There is no obvious connection between SYSFS
> and NUMA. One is exporting information to userspace and the other is
> the memory model. Without sysfs, NUMA support might be less useful
> but the memory policies should still work and set_mempolicy() should
> still be an option.
>
> You didn't post where the buggy reference to vmstat_text but I'm
> assuming it is in drivers/base/node.c . It would be preferable that
> it be fixed to not reference vmstat_text unless either CONFIG_PROC_FS
> or CONFIG_SYSFS is defined similar to what is in mm/vmstat.c .
>
Hmm, since we don't have to enable SYSFS for NUMA, how about
make a new Kconfig for drivers/base/node.c? I.e., CONFIG_NUMA_SYSFS,
like patch below.
Thanks.
[-- Attachment #2: numa-depends-on-sysfs.diff --]
[-- Type: text/plain, Size: 1337 bytes --]
Introduce a new Kconfig CONFIG_NUMA_SYSFS for drivers/base/node.c
which just provides sysfs interface, so that when we select
CONFIG_NUMA, we don't have to enable the sysfs interface too.
This by the way fixes a randconfig build error when NUMA && !SYSFS.
Signed-off-by: WANG Cong <amwang@redhat.com>
---
diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index 4c5701c..f34abe6 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_HAS_DMA) += dma-mapping.o
obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
obj-$(CONFIG_ISA) += isa.o
obj-$(CONFIG_FW_LOADER) += firmware_class.o
-obj-$(CONFIG_NUMA) += node.o
+obj-$(CONFIG_NUMA_SYSFS) += node.o
obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
obj-$(CONFIG_SMP) += topology.o
obj-$(CONFIG_IOMMU_API) += iommu.o
diff --git a/mm/Kconfig b/mm/Kconfig
index 8ca47a5..f89ab19 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -340,6 +340,16 @@ choice
benefit.
endchoice
+config NUMA_SYSFS
+ bool "Enable NUMA sysfs interface for user-space"
+ depends on NUMA
+ depends on SYSFS
+ default y
+ help
+ This enables NUMA sysfs interface, /sys/devices/system/node/,
+ for user-space tools, like numactl. If you have enabled NUMA,
+ probably you also need this one.
+
#
# UP and nommu archs use km based percpu allocator
#
next prev parent reply other threads:[~2011-07-19 6:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 11:18 [Patch] mm: make CONFIG_NUMA depend on CONFIG_SYSFS Amerigo Wang
2011-07-18 12:14 ` Pekka Enberg
2011-07-18 17:09 ` Andi Kleen
2011-07-18 17:14 ` Randy Dunlap
2011-07-19 6:07 ` Cong Wang
2011-07-18 13:52 ` Mel Gorman
2011-07-19 6:20 ` Cong Wang [this message]
2011-07-19 6:54 ` Eric Dumazet
2011-07-19 7:05 ` Cong Wang
2011-07-19 8:49 ` Eric Dumazet
2011-07-19 9:11 ` Cong Wang
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=4E25221F.6060605@redhat.com \
--to=amwang@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).