linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] -mm-only hugetlb updates
@ 2008-07-08 18:03 Nishanth Aravamudan
  2008-07-08 18:05 ` [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT Nishanth Aravamudan
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Nishanth Aravamudan @ 2008-07-08 18:03 UTC (permalink / raw)
  To: npiggin; +Cc: mel, agl, akpm, linux-mm

As Nick requested, I've moved /sys/kernel/hugepages to
/sys/kernel/mm/hugepages. I put the creation of the /sys/kernel/mm
kobject in mm_init.c and that required removing the conditional
compilation of that file. This also necessitated a bit of Documentation
updates (and the addition of the /sys/kernel/mm ABI file). Finally, I
realized that kobject usage doesn't require CONFIG_SYSFS, so I was able
to remove one ifdef from hugetlb.c.

Andrew, I believe these patches, if acceptable, should be folded in
place, if possible, in the hugetlb series (that is, the sysfs location
should only ever have appeared to be /sys/kernel/mm/hugepages). The ease
with which that can occur I guess depends on where Mel's
DEBUG_MEMORY_INIT patches are in the series.

1/4: mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT
2/4: mm: create /sys/kernel/mm
3/4: hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel
4/4: hugetlb: remove CONFIG_SYSFS dependency

Thanks,
Nish

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT
  2008-07-08 18:03 [RFC PATCH 0/4] -mm-only hugetlb updates Nishanth Aravamudan
@ 2008-07-08 18:05 ` Nishanth Aravamudan
  2008-07-08 18:06   ` [RFC PATCH 2/4] mm: create /sys/kernel/mm Nishanth Aravamudan
  2008-07-10 16:35   ` [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT Mel Gorman
  2008-07-08 18:13 ` [RFC PATCH 0/4] -mm-only hugetlb updates Nishanth Aravamudan
  2008-07-10 13:11 ` Nick Piggin
  2 siblings, 2 replies; 11+ messages in thread
From: Nishanth Aravamudan @ 2008-07-08 18:05 UTC (permalink / raw)
  To: npiggin; +Cc: mel, agl, akpm, linux-mm

Towards the end of putting all core mm initialization in mm_init.c, I
plan on putting the creation of a mm kobject in a function in that file.
However, the file is currently only compiled if CONFIG_DEBUG_MEMORY_INIT
is set. Remove this dependency, but put the code under an #ifdef on the
same config option. This should result in no functional changes.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

diff --git a/mm/Makefile b/mm/Makefile
index f54232d..cbe29d2 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -11,7 +11,7 @@ obj-y			:= bootmem.o filemap.o mempool.o oom_kill.o fadvise.o \
 			   maccess.o page_alloc.o page-writeback.o pdflush.o \
 			   readahead.o swap.o truncate.o vmscan.o \
 			   prio_tree.o util.o mmzone.o vmstat.o backing-dev.o \
-			   page_isolation.o $(mmu-y)
+			   page_isolation.o mm_init.o $(mmu-y)
 
 obj-$(CONFIG_PAGE_WALKER) += pagewalk.o
 obj-$(CONFIG_BOUNCE)	+= bounce.o
@@ -26,7 +26,6 @@ obj-$(CONFIG_TMPFS_POSIX_ACL) += shmem_acl.o
 obj-$(CONFIG_TINY_SHMEM) += tiny-shmem.o
 obj-$(CONFIG_SLOB) += slob.o
 obj-$(CONFIG_SLAB) += slab.o
-obj-$(CONFIG_DEBUG_MEMORY_INIT) += mm_init.o
 obj-$(CONFIG_SLUB) += slub.o
 obj-$(CONFIG_MEMORY_HOTPLUG) += memory_hotplug.o
 obj-$(CONFIG_FS_XIP) += filemap_xip.o
diff --git a/mm/mm_init.c b/mm/mm_init.c
index ce445ca..eaf0d3b 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -9,6 +9,7 @@
 #include <linux/init.h>
 #include "internal.h"
 
+#ifdef CONFIG_DEBUG_MEMORY_INIT
 int __meminitdata mminit_loglevel;
 
 /* The zonelists are simply reported, validation is manual. */
@@ -132,3 +133,4 @@ static __init int set_mminit_loglevel(char *str)
 	return 0;
 }
 early_param("mminit_loglevel", set_mminit_loglevel);
+#endif /* CONFIG_DEBUG_MEMORY_INIT */

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [RFC PATCH 2/4] mm: create /sys/kernel/mm
  2008-07-08 18:05 ` [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT Nishanth Aravamudan
@ 2008-07-08 18:06   ` Nishanth Aravamudan
  2008-07-08 18:07     ` [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel Nishanth Aravamudan
  2008-07-10 17:24     ` [RFC PATCH 2/4] mm: create /sys/kernel/mm Mel Gorman
  2008-07-10 16:35   ` [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT Mel Gorman
  1 sibling, 2 replies; 11+ messages in thread
From: Nishanth Aravamudan @ 2008-07-08 18:06 UTC (permalink / raw)
  To: npiggin; +Cc: mel, agl, akpm, linux-mm

Add a kobject to create /sys/kernel/mm when sysfs is mounted. The
kobject will exist regardless. This will allow for the hugepage related
sysfs directories to exist under the mm "subsystem" directory. Add an
ABI file appropriately.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

diff --git a/Documentation/ABI/testing/sysfs-kernel-mm b/Documentation/ABI/testing/sysfs-kernel-mm
new file mode 100644
index 0000000..190d523
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-mm
@@ -0,0 +1,6 @@
+What:		/sys/kernel/mm
+Date:		July 2008
+Contact:	Nishanth Aravamudan <nacc@us.ibm.com>, VM maintainers
+Description:
+		/sys/kernel/mm/ should contain any and all VM
+		related information in /sys/kernel/.
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 60f0d41..5437ac0 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -186,6 +186,8 @@ extern struct kobject *kset_find_obj(struct kset *, const char *);
 
 /* The global /sys/kernel/ kobject for people to chain off of */
 extern struct kobject *kernel_kobj;
+/* The global /sys/kernel/mm/ kobject for people to chain off of */
+extern struct kobject *mm_kobj;
 /* The global /sys/hypervisor/ kobject for people to chain off of */
 extern struct kobject *hypervisor_kobj;
 /* The global /sys/power/ kobject for people to chain off of */
diff --git a/mm/mm_init.c b/mm/mm_init.c
index eaf0d3b..4775743 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -7,6 +7,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/kobject.h>
 #include "internal.h"
 
 #ifdef CONFIG_DEBUG_MEMORY_INIT
@@ -134,3 +135,17 @@ static __init int set_mminit_loglevel(char *str)
 }
 early_param("mminit_loglevel", set_mminit_loglevel);
 #endif /* CONFIG_DEBUG_MEMORY_INIT */
+
+struct kobject *mm_kobj;
+EXPORT_SYMBOL_GPL(mm_kobj);
+
+static int __init mm_sysfs_init(void)
+{
+	mm_kobj = kobject_create_and_add("mm", kernel_kobj);
+	if (!mm_kobj)
+		return -ENOMEM;
+
+	return 0;
+}
+
+__initcall(mm_sysfs_init);

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel
  2008-07-08 18:06   ` [RFC PATCH 2/4] mm: create /sys/kernel/mm Nishanth Aravamudan
@ 2008-07-08 18:07     ` Nishanth Aravamudan
  2008-07-08 18:08       ` [RFC PATCH 4/4] hugetlb: remove CONFIG_SYSFS dependency Nishanth Aravamudan
  2008-07-10 17:39       ` [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel Mel Gorman
  2008-07-10 17:24     ` [RFC PATCH 2/4] mm: create /sys/kernel/mm Mel Gorman
  1 sibling, 2 replies; 11+ messages in thread
From: Nishanth Aravamudan @ 2008-07-08 18:07 UTC (permalink / raw)
  To: npiggin; +Cc: mel, agl, akpm, linux-mm

To keep /sys/kernel uncluttered, use the newly created /sys/kernel/mm as
the parent for the hugepage-controlling directories/files. Update the
ABI file and redirect the user to the more complete vm/hugetlbpage.txt
for details on hugepage usage.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

---
Given the somewhat discombobulated state of hugetlbpage.txt, my next
step will be to clean it up and reorganize the information therein.

diff --git a/Documentation/ABI/testing/sysfs-kernel-hugepages b/Documentation/ABI/testing/sysfs-kernel-hugepages
deleted file mode 100644
index 3457747..0000000
--- a/Documentation/ABI/testing/sysfs-kernel-hugepages
+++ /dev/null
@@ -1,14 +0,0 @@
-What:		/sys/kernel/hugepages/
-Date:		June 2008
-Contact:	Nishanth Aravamudan <nacc@us.ibm.com>, hugetlb maintainers
-Description:
-		/sys/kernel/hugepages/ contains a number of subdirectories
-		of the form hugepages-<size>kb, where <size> is the page size
-		of the hugepages supported by the kernel/CPU combination.
-
-		Under these directories are a number of files:
-		nr_hugepages - minimum number of hugepages reserved
-		nr_overcommit_hugepages - maximum number that can be allocated
-		free_hugepages - number of hugepages free
-		surplus_hugepages -
-		resv_hugepages -
diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-hugepages b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages
new file mode 100644
index 0000000..e21c005
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages
@@ -0,0 +1,15 @@
+What:		/sys/kernel/mm/hugepages/
+Date:		June 2008
+Contact:	Nishanth Aravamudan <nacc@us.ibm.com>, hugetlb maintainers
+Description:
+		/sys/kernel/mm/hugepages/ contains a number of subdirectories
+		of the form hugepages-<size>kB, where <size> is the page size
+		of the hugepages supported by the kernel/CPU combination.
+
+		Under these directories are a number of files:
+			nr_hugepages
+			nr_overcommit_hugepages
+			free_hugepages
+			surplus_hugepages
+			resv_hugepages
+		See Documentation/vm/hugetlbpage.txt for details.
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 899b343..ea8714f 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -95,6 +95,29 @@ this condition holds, however, no more surplus huge pages will be
 allowed on the system until one of the two sysctls are increased
 sufficiently, or the surplus huge pages go out of use and are freed.
 
+With support for multiple hugepage pools at run-time available, much of
+the hugepage userspace interface has been duplicated in sysfs. The above
+information applies to the default hugepage size (which will be
+controlled by the proc interfaces for backwards compatibility). The root
+hugepage control directory is
+
+	/sys/kernel/mm/hugepages
+
+For each hugepage size supported by the running kernel, a subdirectory
+will exist, of the form
+
+	hugepages-${size}kB
+
+Inside each of these directories, the same set of files will exist:
+
+	nr_hugepages
+	nr_overcommit_hugepages
+	free_hugepages
+	resv_hugepages
+	surplus_hugepages
+
+which function as described above for the default hugepage-sized case.
+
 If the user applications are going to request hugepages using mmap system
 call, then it is required that system administrator mount a file system of
 type hugetlbfs:
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 14bfe17..9c24f8f 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1258,7 +1258,7 @@ static void __init hugetlb_sysfs_init(void)
 	struct hstate *h;
 	int err;
 
-	hugepages_kobj = kobject_create_and_add("hugepages", kernel_kobj);
+	hugepages_kobj = kobject_create_and_add("hugepages", mm_kobj);
 	if (!hugepages_kobj)
 		return;
 
-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [RFC PATCH 4/4] hugetlb: remove CONFIG_SYSFS dependency
  2008-07-08 18:07     ` [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel Nishanth Aravamudan
@ 2008-07-08 18:08       ` Nishanth Aravamudan
  2008-07-10 17:39       ` [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel Mel Gorman
  1 sibling, 0 replies; 11+ messages in thread
From: Nishanth Aravamudan @ 2008-07-08 18:08 UTC (permalink / raw)
  To: npiggin; +Cc: mel, agl, akpm, linux-mm

I incorrectly made the hugetlb kobject functionality depend on SYSFS,
when, in fact, the kobject functions fully work even with out sysfs.
Without sysfs, there is no interface to manipulate the attributes of the
various hugetlb kobjects, but they still exist.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 9c24f8f..a432889 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1130,7 +1130,6 @@ out:
 	return ret;
 }
 
-#ifdef CONFIG_SYSFS
 #define HSTATE_ATTR_RO(_name) \
 	static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
 
@@ -1282,12 +1281,6 @@ static void __exit hugetlb_exit(void)
 }
 module_exit(hugetlb_exit);
 
-#else
-static void __init hugetlb_sysfs_init(void)
-{
-}
-#endif
-
 static int __init hugetlb_init(void)
 {
 	BUILD_BUG_ON(HPAGE_SHIFT == 0);

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH 0/4] -mm-only hugetlb updates
  2008-07-08 18:03 [RFC PATCH 0/4] -mm-only hugetlb updates Nishanth Aravamudan
  2008-07-08 18:05 ` [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT Nishanth Aravamudan
@ 2008-07-08 18:13 ` Nishanth Aravamudan
  2008-07-10 13:11 ` Nick Piggin
  2 siblings, 0 replies; 11+ messages in thread
From: Nishanth Aravamudan @ 2008-07-08 18:13 UTC (permalink / raw)
  To: npiggin; +Cc: mel, agl, akpm, linux-mm

On 08.07.2008 [11:03:48 -0700], Nishanth Aravamudan wrote:
> As Nick requested, I've moved /sys/kernel/hugepages to
> /sys/kernel/mm/hugepages. I put the creation of the /sys/kernel/mm
> kobject in mm_init.c and that required removing the conditional
> compilation of that file. This also necessitated a bit of Documentation
> updates (and the addition of the /sys/kernel/mm ABI file). Finally, I
> realized that kobject usage doesn't require CONFIG_SYSFS, so I was able
> to remove one ifdef from hugetlb.c.
> 
> Andrew, I believe these patches, if acceptable, should be folded in
> place, if possible, in the hugetlb series (that is, the sysfs location
> should only ever have appeared to be /sys/kernel/mm/hugepages). The ease
> with which that can occur I guess depends on where Mel's
> DEBUG_MEMORY_INIT patches are in the series.
> 
> 1/4: mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT
> 2/4: mm: create /sys/kernel/mm
> 3/4: hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel
> 4/4: hugetlb: remove CONFIG_SYSFS dependency

Sorry, stupid typo in Andrew's e-mail address. Andrew, will you grab the
patches (if acceptable) from the mailing list, or would you prefer I
resend?

Thanks,
Nish

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH 0/4] -mm-only hugetlb updates
  2008-07-08 18:03 [RFC PATCH 0/4] -mm-only hugetlb updates Nishanth Aravamudan
  2008-07-08 18:05 ` [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT Nishanth Aravamudan
  2008-07-08 18:13 ` [RFC PATCH 0/4] -mm-only hugetlb updates Nishanth Aravamudan
@ 2008-07-10 13:11 ` Nick Piggin
  2008-07-10 16:50   ` Nishanth Aravamudan
  2 siblings, 1 reply; 11+ messages in thread
From: Nick Piggin @ 2008-07-10 13:11 UTC (permalink / raw)
  To: Nishanth Aravamudan; +Cc: mel, agl, akpm, linux-mm

On Tue, Jul 08, 2008 at 11:03:48AM -0700, Nishanth Aravamudan wrote:
> As Nick requested, I've moved /sys/kernel/hugepages to
> /sys/kernel/mm/hugepages. I put the creation of the /sys/kernel/mm
> kobject in mm_init.c and that required removing the conditional
> compilation of that file. This also necessitated a bit of Documentation
> updates (and the addition of the /sys/kernel/mm ABI file). Finally, I
> realized that kobject usage doesn't require CONFIG_SYSFS, so I was able
> to remove one ifdef from hugetlb.c.
> 
> Andrew, I believe these patches, if acceptable, should be folded in
> place, if possible, in the hugetlb series (that is, the sysfs location
> should only ever have appeared to be /sys/kernel/mm/hugepages). The ease
> with which that can occur I guess depends on where Mel's
> DEBUG_MEMORY_INIT patches are in the series.
> 
> 1/4: mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT
> 2/4: mm: create /sys/kernel/mm
> 3/4: hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel
> 4/4: hugetlb: remove CONFIG_SYSFS dependency

Hi Nish,

Thanks for this. Yes I believe this is a much better layout, thank you.
To answer an earlier question you asked: yes, I believe a lot of existing
kernel subsystems aren't really in appropriate location and there probably
hasn't been a lot of thought into placement of some of them.

Imagine if every subsystem just goes into /sys/kernel/ directory, then it
might look something like `ls /proc/sys/*` all in one directory :P

I'm not sure what we can do about existing things (maybe they can get links
and eventually put under one of those compat sysfs layout thingies). But
definitely for new entries we should try to keep the namespace nice and
modular.

Acked-by: Nick Piggin < npiggin@suse.de> for all patches.

Thanks,
Nick

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT
  2008-07-08 18:05 ` [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT Nishanth Aravamudan
  2008-07-08 18:06   ` [RFC PATCH 2/4] mm: create /sys/kernel/mm Nishanth Aravamudan
@ 2008-07-10 16:35   ` Mel Gorman
  1 sibling, 0 replies; 11+ messages in thread
From: Mel Gorman @ 2008-07-10 16:35 UTC (permalink / raw)
  To: Nishanth Aravamudan; +Cc: npiggin, agl, akpm, linux-mm

On (08/07/08 11:05), Nishanth Aravamudan didst pronounce:
> Towards the end of putting all core mm initialization in mm_init.c, I
> plan on putting the creation of a mm kobject in a function in that file.
> However, the file is currently only compiled if CONFIG_DEBUG_MEMORY_INIT
> is set. Remove this dependency, but put the code under an #ifdef on the
> same config option. This should result in no functional changes.
> 
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
> 

Acked-by: Mel Gorman <mel@csn.ul.ie>

> diff --git a/mm/Makefile b/mm/Makefile
> index f54232d..cbe29d2 100644
> --- a/mm/Makefile
> +++ b/mm/Makefile
> @@ -11,7 +11,7 @@ obj-y			:= bootmem.o filemap.o mempool.o oom_kill.o fadvise.o \
>  			   maccess.o page_alloc.o page-writeback.o pdflush.o \
>  			   readahead.o swap.o truncate.o vmscan.o \
>  			   prio_tree.o util.o mmzone.o vmstat.o backing-dev.o \
> -			   page_isolation.o $(mmu-y)
> +			   page_isolation.o mm_init.o $(mmu-y)
>  
>  obj-$(CONFIG_PAGE_WALKER) += pagewalk.o
>  obj-$(CONFIG_BOUNCE)	+= bounce.o
> @@ -26,7 +26,6 @@ obj-$(CONFIG_TMPFS_POSIX_ACL) += shmem_acl.o
>  obj-$(CONFIG_TINY_SHMEM) += tiny-shmem.o
>  obj-$(CONFIG_SLOB) += slob.o
>  obj-$(CONFIG_SLAB) += slab.o
> -obj-$(CONFIG_DEBUG_MEMORY_INIT) += mm_init.o
>  obj-$(CONFIG_SLUB) += slub.o
>  obj-$(CONFIG_MEMORY_HOTPLUG) += memory_hotplug.o
>  obj-$(CONFIG_FS_XIP) += filemap_xip.o
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index ce445ca..eaf0d3b 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -9,6 +9,7 @@
>  #include <linux/init.h>
>  #include "internal.h"
>  
> +#ifdef CONFIG_DEBUG_MEMORY_INIT
>  int __meminitdata mminit_loglevel;
>  
>  /* The zonelists are simply reported, validation is manual. */
> @@ -132,3 +133,4 @@ static __init int set_mminit_loglevel(char *str)
>  	return 0;
>  }
>  early_param("mminit_loglevel", set_mminit_loglevel);
> +#endif /* CONFIG_DEBUG_MEMORY_INIT */
> 
> -- 
> Nishanth Aravamudan <nacc@us.ibm.com>
> IBM Linux Technology Center
> 

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH 0/4] -mm-only hugetlb updates
  2008-07-10 13:11 ` Nick Piggin
@ 2008-07-10 16:50   ` Nishanth Aravamudan
  0 siblings, 0 replies; 11+ messages in thread
From: Nishanth Aravamudan @ 2008-07-10 16:50 UTC (permalink / raw)
  To: Nick Piggin; +Cc: mel, agl, akpm, linux-mm

On 10.07.2008 [15:11:41 +0200], Nick Piggin wrote:
> On Tue, Jul 08, 2008 at 11:03:48AM -0700, Nishanth Aravamudan wrote:
> > As Nick requested, I've moved /sys/kernel/hugepages to
> > /sys/kernel/mm/hugepages. I put the creation of the /sys/kernel/mm
> > kobject in mm_init.c and that required removing the conditional
> > compilation of that file. This also necessitated a bit of Documentation
> > updates (and the addition of the /sys/kernel/mm ABI file). Finally, I
> > realized that kobject usage doesn't require CONFIG_SYSFS, so I was able
> > to remove one ifdef from hugetlb.c.
> > 
> > Andrew, I believe these patches, if acceptable, should be folded in
> > place, if possible, in the hugetlb series (that is, the sysfs location
> > should only ever have appeared to be /sys/kernel/mm/hugepages). The ease
> > with which that can occur I guess depends on where Mel's
> > DEBUG_MEMORY_INIT patches are in the series.
> > 
> > 1/4: mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT
> > 2/4: mm: create /sys/kernel/mm
> > 3/4: hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel
> > 4/4: hugetlb: remove CONFIG_SYSFS dependency
> 
> Hi Nish,
> 
> Thanks for this. Yes I believe this is a much better layout, thank
> you.  To answer an earlier question you asked: yes, I believe a lot of
> existing kernel subsystems aren't really in appropriate location and
> there probably hasn't been a lot of thought into placement of some of
> them.
> 
> Imagine if every subsystem just goes into /sys/kernel/ directory, then
> it might look something like `ls /proc/sys/*` all in one directory :P

Fair enough :) I agree that it's worth considering these issues,
especially if we really intend to treat sysfs as ABI.

> I'm not sure what we can do about existing things (maybe they can get
> links and eventually put under one of those compat sysfs layout
> thingies). But definitely for new entries we should try to keep the
> namespace nice and modular.

That's probably the best we can do, you're right.

> Acked-by: Nick Piggin < npiggin@suse.de> for all patches.

Thanks,
Nish

-- 
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH 2/4] mm: create /sys/kernel/mm
  2008-07-08 18:06   ` [RFC PATCH 2/4] mm: create /sys/kernel/mm Nishanth Aravamudan
  2008-07-08 18:07     ` [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel Nishanth Aravamudan
@ 2008-07-10 17:24     ` Mel Gorman
  1 sibling, 0 replies; 11+ messages in thread
From: Mel Gorman @ 2008-07-10 17:24 UTC (permalink / raw)
  To: Nishanth Aravamudan; +Cc: npiggin, agl, akpm, linux-mm

On (08/07/08 11:06), Nishanth Aravamudan didst pronounce:
> Add a kobject to create /sys/kernel/mm when sysfs is mounted. The
> kobject will exist regardless. This will allow for the hugepage related
> sysfs directories to exist under the mm "subsystem" directory. Add an
> ABI file appropriately.
> 
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
> 

Acked-by: Mel Gorman <mel@csn.ul.ie>

> diff --git a/Documentation/ABI/testing/sysfs-kernel-mm b/Documentation/ABI/testing/sysfs-kernel-mm
> new file mode 100644
> index 0000000..190d523
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-kernel-mm
> @@ -0,0 +1,6 @@
> +What:		/sys/kernel/mm
> +Date:		July 2008
> +Contact:	Nishanth Aravamudan <nacc@us.ibm.com>, VM maintainers
> +Description:
> +		/sys/kernel/mm/ should contain any and all VM
> +		related information in /sys/kernel/.
> diff --git a/include/linux/kobject.h b/include/linux/kobject.h
> index 60f0d41..5437ac0 100644
> --- a/include/linux/kobject.h
> +++ b/include/linux/kobject.h
> @@ -186,6 +186,8 @@ extern struct kobject *kset_find_obj(struct kset *, const char *);
>  
>  /* The global /sys/kernel/ kobject for people to chain off of */
>  extern struct kobject *kernel_kobj;
> +/* The global /sys/kernel/mm/ kobject for people to chain off of */
> +extern struct kobject *mm_kobj;
>  /* The global /sys/hypervisor/ kobject for people to chain off of */
>  extern struct kobject *hypervisor_kobj;
>  /* The global /sys/power/ kobject for people to chain off of */
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index eaf0d3b..4775743 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -7,6 +7,7 @@
>   */
>  #include <linux/kernel.h>
>  #include <linux/init.h>
> +#include <linux/kobject.h>
>  #include "internal.h"
>  
>  #ifdef CONFIG_DEBUG_MEMORY_INIT
> @@ -134,3 +135,17 @@ static __init int set_mminit_loglevel(char *str)
>  }
>  early_param("mminit_loglevel", set_mminit_loglevel);
>  #endif /* CONFIG_DEBUG_MEMORY_INIT */
> +
> +struct kobject *mm_kobj;
> +EXPORT_SYMBOL_GPL(mm_kobj);
> +
> +static int __init mm_sysfs_init(void)
> +{
> +	mm_kobj = kobject_create_and_add("mm", kernel_kobj);
> +	if (!mm_kobj)
> +		return -ENOMEM;
> +
> +	return 0;
> +}
> +
> +__initcall(mm_sysfs_init);
> 
> -- 
> Nishanth Aravamudan <nacc@us.ibm.com>
> IBM Linux Technology Center
> 

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel
  2008-07-08 18:07     ` [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel Nishanth Aravamudan
  2008-07-08 18:08       ` [RFC PATCH 4/4] hugetlb: remove CONFIG_SYSFS dependency Nishanth Aravamudan
@ 2008-07-10 17:39       ` Mel Gorman
  1 sibling, 0 replies; 11+ messages in thread
From: Mel Gorman @ 2008-07-10 17:39 UTC (permalink / raw)
  To: Nishanth Aravamudan; +Cc: npiggin, agl, akpm, linux-mm

On (08/07/08 11:07), Nishanth Aravamudan didst pronounce:
> To keep /sys/kernel uncluttered, use the newly created /sys/kernel/mm as
> the parent for the hugepage-controlling directories/files. Update the
> ABI file and redirect the user to the more complete vm/hugetlbpage.txt
> for details on hugepage usage.
> 
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
> 

Acked-by: Mel Gorman <mel@csn.ul.ie>

> ---
> Given the somewhat discombobulated state of hugetlbpage.txt, my next
> step will be to clean it up and reorganize the information therein.
> 
> diff --git a/Documentation/ABI/testing/sysfs-kernel-hugepages b/Documentation/ABI/testing/sysfs-kernel-hugepages
> deleted file mode 100644
> index 3457747..0000000
> --- a/Documentation/ABI/testing/sysfs-kernel-hugepages
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -What:		/sys/kernel/hugepages/
> -Date:		June 2008
> -Contact:	Nishanth Aravamudan <nacc@us.ibm.com>, hugetlb maintainers
> -Description:
> -		/sys/kernel/hugepages/ contains a number of subdirectories
> -		of the form hugepages-<size>kb, where <size> is the page size
> -		of the hugepages supported by the kernel/CPU combination.
> -
> -		Under these directories are a number of files:
> -		nr_hugepages - minimum number of hugepages reserved
> -		nr_overcommit_hugepages - maximum number that can be allocated
> -		free_hugepages - number of hugepages free
> -		surplus_hugepages -
> -		resv_hugepages -
> diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-hugepages b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages
> new file mode 100644
> index 0000000..e21c005
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-kernel-mm-hugepages
> @@ -0,0 +1,15 @@
> +What:		/sys/kernel/mm/hugepages/
> +Date:		June 2008
> +Contact:	Nishanth Aravamudan <nacc@us.ibm.com>, hugetlb maintainers
> +Description:
> +		/sys/kernel/mm/hugepages/ contains a number of subdirectories
> +		of the form hugepages-<size>kB, where <size> is the page size
> +		of the hugepages supported by the kernel/CPU combination.
> +
> +		Under these directories are a number of files:
> +			nr_hugepages
> +			nr_overcommit_hugepages
> +			free_hugepages
> +			surplus_hugepages
> +			resv_hugepages
> +		See Documentation/vm/hugetlbpage.txt for details.
> diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
> index 899b343..ea8714f 100644
> --- a/Documentation/vm/hugetlbpage.txt
> +++ b/Documentation/vm/hugetlbpage.txt
> @@ -95,6 +95,29 @@ this condition holds, however, no more surplus huge pages will be
>  allowed on the system until one of the two sysctls are increased
>  sufficiently, or the surplus huge pages go out of use and are freed.
>  
> +With support for multiple hugepage pools at run-time available, much of
> +the hugepage userspace interface has been duplicated in sysfs. The above
> +information applies to the default hugepage size (which will be
> +controlled by the proc interfaces for backwards compatibility). The root
> +hugepage control directory is
> +
> +	/sys/kernel/mm/hugepages
> +
> +For each hugepage size supported by the running kernel, a subdirectory
> +will exist, of the form
> +
> +	hugepages-${size}kB
> +
> +Inside each of these directories, the same set of files will exist:
> +
> +	nr_hugepages
> +	nr_overcommit_hugepages
> +	free_hugepages
> +	resv_hugepages
> +	surplus_hugepages
> +
> +which function as described above for the default hugepage-sized case.
> +
>  If the user applications are going to request hugepages using mmap system
>  call, then it is required that system administrator mount a file system of
>  type hugetlbfs:
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 14bfe17..9c24f8f 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1258,7 +1258,7 @@ static void __init hugetlb_sysfs_init(void)
>  	struct hstate *h;
>  	int err;
>  
> -	hugepages_kobj = kobject_create_and_add("hugepages", kernel_kobj);
> +	hugepages_kobj = kobject_create_and_add("hugepages", mm_kobj);
>  	if (!hugepages_kobj)
>  		return;
>  
> -- 
> Nishanth Aravamudan <nacc@us.ibm.com>
> IBM Linux Technology Center
> 

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-07-10 17:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-08 18:03 [RFC PATCH 0/4] -mm-only hugetlb updates Nishanth Aravamudan
2008-07-08 18:05 ` [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT Nishanth Aravamudan
2008-07-08 18:06   ` [RFC PATCH 2/4] mm: create /sys/kernel/mm Nishanth Aravamudan
2008-07-08 18:07     ` [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel Nishanth Aravamudan
2008-07-08 18:08       ` [RFC PATCH 4/4] hugetlb: remove CONFIG_SYSFS dependency Nishanth Aravamudan
2008-07-10 17:39       ` [RFC PATCH 3/4] hugetlb: hang off of /sys/kernel/mm rather than /sys/kernel Mel Gorman
2008-07-10 17:24     ` [RFC PATCH 2/4] mm: create /sys/kernel/mm Mel Gorman
2008-07-10 16:35   ` [RFC PATCH 1/4] mm: remove mm_init compilation dependency on CONFIG_DEBUG_MEMORY_INIT Mel Gorman
2008-07-08 18:13 ` [RFC PATCH 0/4] -mm-only hugetlb updates Nishanth Aravamudan
2008-07-10 13:11 ` Nick Piggin
2008-07-10 16:50   ` Nishanth Aravamudan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox