zone_names[] is used to identify any zone given it's index which
can be used in many other places. So moving the definition into
include/linux/mmzone.h for broader access.
Signed-off-by: Anshuman Khandual <redacted>
---
include/linux/mmzone.h | 17 +++++++++++++++++
mm/page_alloc.c | 17 -----------------
2 files changed, 17 insertions(+), 17 deletions(-)
--
1.9.3
--
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>
--
1.9.3
--
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>
From: Andrew Morton <akpm@linux-foundation.org> Date: 2016-08-31 21:10:36
On Wed, 31 Aug 2016 08:55:49 +0530 Anshuman Khandual [off-list ref] wrote:
quoted hunk
zone_names[] is used to identify any zone given it's index which
can be used in many other places. So moving the definition into
include/linux/mmzone.h for broader access.
...
This is worrisome. On some (ancient) compilers, this will produce a
copy of that array into each compilation unit which includes mmzone.h.
On smarter compilers, it will produce a copy of the array in each
compilation unit which *uses* zone_names[].
On even smarter compilers (and linkers!), only one copy of zone_names[]
will exist in vmlinux.
I don't know if gcc is an "even smarter compiler" and I didn't check,
and I didn't check which gcc versions are even smarter. I'd rather not
have to ;) It is risky.
So, let's just make it non-static and add a declaration into mmzone.h,
please.
--
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>
From: Andrew Morton <akpm@linux-foundation.org> Date: 2016-08-31 21:12:44
On Wed, 31 Aug 2016 08:55:50 +0530 Anshuman Khandual [off-list ref] wrote:
Each individual node in the system has a ZONELIST_FALLBACK zonelist
and a ZONELIST_NOFALLBACK zonelist. These zonelists decide fallback
order of zones during memory allocations. Sometimes it helps to dump
these zonelists to see the priority order of various zones in them.
This change just adds a sysfs interface for doing the same.
Example zonelist information from a KVM guest.
[NODE (0)]
ZONELIST_FALLBACK
(0) (node 0) (zone DMA c00000000140c000)
(1) (node 1) (zone DMA c000000100000000)
(2) (node 2) (zone DMA c000000200000000)
(3) (node 3) (zone DMA c000000300000000)
ZONELIST_NOFALLBACK
(0) (node 0) (zone DMA c00000000140c000)
[NODE (1)]
ZONELIST_FALLBACK
(0) (node 1) (zone DMA c000000100000000)
(1) (node 2) (zone DMA c000000200000000)
(2) (node 3) (zone DMA c000000300000000)
(3) (node 0) (zone DMA c00000000140c000)
ZONELIST_NOFALLBACK
(0) (node 1) (zone DMA c000000100000000)
[NODE (2)]
ZONELIST_FALLBACK
(0) (node 2) (zone DMA c000000200000000)
(1) (node 3) (zone DMA c000000300000000)
(2) (node 0) (zone DMA c00000000140c000)
(3) (node 1) (zone DMA c000000100000000)
ZONELIST_NOFALLBACK
(0) (node 2) (zone DMA c000000200000000)
[NODE (3)]
ZONELIST_FALLBACK
(0) (node 3) (zone DMA c000000300000000)
(1) (node 0) (zone DMA c00000000140c000)
(2) (node 1) (zone DMA c000000100000000)
(3) (node 2) (zone DMA c000000200000000)
ZONELIST_NOFALLBACK
(0) (node 3) (zone DMA c000000300000000)
Can you please sell this a bit better? Why does it "sometimes help"?
Why does the benefit of this patch to our users justify the overhead
and cost?
Please document the full path to the sysfs file(s) within the changelog.
Please find somewhere in Documentation/ to document the new interface.
--
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>
On Wed, 31 Aug 2016 08:55:49 +0530 Anshuman Khandual [off-list ref] wrote:
quoted
zone_names[] is used to identify any zone given it's index which
can be used in many other places. So moving the definition into
include/linux/mmzone.h for broader access.
...
This is worrisome. On some (ancient) compilers, this will produce a
copy of that array into each compilation unit which includes mmzone.h.
On smarter compilers, it will produce a copy of the array in each
compilation unit which *uses* zone_names[].
On even smarter compilers (and linkers!), only one copy of zone_names[]
will exist in vmlinux.
I don't know if gcc is an "even smarter compiler" and I didn't check,
and I didn't check which gcc versions are even smarter. I'd rather not
have to ;) It is risky.
So, let's just make it non-static and add a declaration into mmzone.h,
please.
I understand your concern, will change it.
--
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>
On Wed, 31 Aug 2016 08:55:50 +0530 Anshuman Khandual [off-list ref] wrote:
quoted
Each individual node in the system has a ZONELIST_FALLBACK zonelist
and a ZONELIST_NOFALLBACK zonelist. These zonelists decide fallback
order of zones during memory allocations. Sometimes it helps to dump
these zonelists to see the priority order of various zones in them.
This change just adds a sysfs interface for doing the same.
Example zonelist information from a KVM guest.
[NODE (0)]
ZONELIST_FALLBACK
(0) (node 0) (zone DMA c00000000140c000)
(1) (node 1) (zone DMA c000000100000000)
(2) (node 2) (zone DMA c000000200000000)
(3) (node 3) (zone DMA c000000300000000)
ZONELIST_NOFALLBACK
(0) (node 0) (zone DMA c00000000140c000)
[NODE (1)]
ZONELIST_FALLBACK
(0) (node 1) (zone DMA c000000100000000)
(1) (node 2) (zone DMA c000000200000000)
(2) (node 3) (zone DMA c000000300000000)
(3) (node 0) (zone DMA c00000000140c000)
ZONELIST_NOFALLBACK
(0) (node 1) (zone DMA c000000100000000)
[NODE (2)]
ZONELIST_FALLBACK
(0) (node 2) (zone DMA c000000200000000)
(1) (node 3) (zone DMA c000000300000000)
(2) (node 0) (zone DMA c00000000140c000)
(3) (node 1) (zone DMA c000000100000000)
ZONELIST_NOFALLBACK
(0) (node 2) (zone DMA c000000200000000)
[NODE (3)]
ZONELIST_FALLBACK
(0) (node 3) (zone DMA c000000300000000)
(1) (node 0) (zone DMA c00000000140c000)
(2) (node 1) (zone DMA c000000100000000)
(3) (node 2) (zone DMA c000000200000000)
ZONELIST_NOFALLBACK
(0) (node 3) (zone DMA c000000300000000)
Can you please sell this a bit better? Why does it "sometimes help"?
Why does the benefit of this patch to our users justify the overhead
and cost?
On platforms which support memory hotplug into previously non existing
(at boot) zones, this interface helps in visualizing which zonelists
of the system, the new hot added memory ends up in. POWER is such a
platform where all the memory detected during boot time remains with
ZONE_DMA for good but then hot plug process can actually get new memory
into ZONE_MOVABLE. So having a way to get the snapshot of the zonelists
on the system after memory or node hot[un]plug is a good thing, IMHO.
Please document the full path to the sysfs file(s) within the changelog.
Sure, will do.
Please find somewhere in Documentation/ to document the new interface.
Sure, will create this following file describing the interface.
Documentation/ABI/testing/sysfs-system-zone-details
--
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>