All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] memory driver: make phys_index/end_phys_index reflect the start/end section number
@ 2014-04-02  8:56 Li Zhong
  2014-04-02 16:09 ` Dave Hansen
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Li Zhong @ 2014-04-02  8:56 UTC (permalink / raw)
  To: LKML; +Cc: nfont, gregkh

I noticed the phys_index and end_phys_index under 
/sys/devices/system/memory/memoryXXX/ have the same value, e.g.
(for the test machine, one memory block has 8 sections, that is 
 sections_per_block equals 8)

# cd /sys/devices/system/memory/memory100/
# cat phys_index end_phys_index 
00000064
00000064

Seems they should reflect the start/end section number respectively, which 
also matches what is said in Documentation/memory-hotplug.txt

This patch tries to modify that so the two files could show the start/end
section number of the memory block.

After this change, output of the above example looks like:

# cat phys_index end_phys_index 
00000320
00000327

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
---
 drivers/base/memory.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index bece691..b10f2fa 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -114,7 +114,7 @@ static ssize_t show_mem_start_phys_index(struct device *dev,
 	struct memory_block *mem = to_memory_block(dev);
 	unsigned long phys_index;
 
-	phys_index = mem->start_section_nr / sections_per_block;
+	phys_index = mem->start_section_nr;
 	return sprintf(buf, "%08lx\n", phys_index);
 }
 
@@ -124,7 +124,7 @@ static ssize_t show_mem_end_phys_index(struct device *dev,
 	struct memory_block *mem = to_memory_block(dev);
 	unsigned long phys_index;
 
-	phys_index = mem->end_section_nr / sections_per_block;
+	phys_index = mem->end_section_nr;
 	return sprintf(buf, "%08lx\n", phys_index);
 }
 



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

end of thread, other threads:[~2014-04-16  1:49 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-02  8:56 [RFC PATCH] memory driver: make phys_index/end_phys_index reflect the start/end section number Li Zhong
2014-04-02 16:09 ` Dave Hansen
2014-04-03  1:50   ` Li Zhong
2014-04-03 22:41   ` KOSAKI Motohiro
2014-04-03  1:37 ` Zhang Yanfei
2014-04-03  2:37   ` Li Zhong
2014-04-03  3:06     ` Zhang Yanfei
2014-04-03  6:45       ` Li Zhong
2014-04-04  1:29 ` Yasuaki Ishimatsu
2014-04-08  8:27   ` Li Zhong
2014-04-08 16:13     ` Dave Hansen
2014-04-08 18:23       ` Nathan Fontenot
2014-04-08 19:47         ` Dave Hansen
2014-04-09  9:20           ` Li Zhong
2014-04-09 15:49             ` Dave Hansen
2014-04-09 16:16               ` Nathan Fontenot
2014-04-10  3:14               ` Li Zhong
2014-04-10  3:47                 ` Zhang Yanfei
2014-04-09 16:20           ` Nathan Fontenot
2014-04-09 17:39           ` Nathan Fontenot
2014-04-10  1:03             ` Zhang Yanfei
2014-04-10  4:17             ` Li Zhong
2014-04-11 18:54               ` Nathan Fontenot
2014-04-14  8:43                 ` [RFC PATCH v2] memory-hotplug: Update documentation to hide information about SECTIONS and remove end_phys_index Li Zhong
2014-04-14  9:13                   ` Zhang Yanfei
2014-04-15  2:49                     ` Li Zhong
2014-04-16  1:49                     ` [RFC PATCH v3] " Li Zhong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.