mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amerigo Wang <xiyou.wangcong@gmail.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Amerigo Wang <xiyou.wangcong@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	ralf@linux-mips.org, benh@kernel.crashing.org,
	lethal@linux-sh.org
Subject: Re: [RFC][PATCH 5/6] kcore: check physical memory range  in correct way.
Date: Wed, 29 Jul 2009 16:50:03 +0800	[thread overview]
Message-ID: <20090729085003.GD5856@cr0.nay.redhat.com> (raw)
In-Reply-To: <20090729085810.c1a6b75a.kamezawa.hiroyu@jp.fujitsu.com>

On Wed, Jul 29, 2009 at 08:58:10AM +0900, KAMEZAWA Hiroyuki wrote:
>On Tue, 28 Jul 2009 18:24:11 +0800
>Amerigo Wang <xiyou.wangcong@gmail.com> wrote:
>
>> On Fri, Jul 24, 2009 at 05:19:27PM +0900, KAMEZAWA Hiroyuki wrote:
>> >From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>> >
>> >For /proc/kcore, each arch registers its memory range by kclist_add().
>> >In usual,
>> >	- range of physical memory
>> >	- range of vmalloc area
>> >	- text, etc...
>> >are registered but "range of physical memory" has some troubles.
>> >
>> >It doesn't updated at memory hotplug and it tend to include
>> >unnecessary memory holes. Now, /proc/iomem (kernel/resource.c)
>> >includes required physical memory range information and it's
>> >properly updated at memory hotplug. Then, it's good to avoid
>> >using its own code(duplicating information) and to rebuild
>> >kclist for physical memory based on /proc/iomem.
>> >
>> >Note: IIUC, /proc/iomem information is used for kdump.
>> >
>> >Changelog: v2 -> v3
>> > - fixed HIGHMEM codes.(At least, no compile error)
>> > - enhnanced sanity chesk in !HIGHMEM codes. (See kclist_add_private())
>> > - after this, x86-32, ia64, sh, powerpc has no private kclist codes.
>> >   x86-64 and mips still have some.
>> 
>> 
>> <snip>
>> 
>> 
>> 
>> >Index: mmotm-2.6.31-Jul16/include/linux/ioport.h
>> >===================================================================
>> >--- mmotm-2.6.31-Jul16.orig/include/linux/ioport.h
>> >+++ mmotm-2.6.31-Jul16/include/linux/ioport.h
>> >@@ -186,5 +186,13 @@ extern void __devm_release_region(struct
>> > extern int iomem_map_sanity_check(resource_size_t addr, unsigned long size);
>> > extern int iomem_is_exclusive(u64 addr);
>> > 
>> >+/*
>> >+ * Walk through all SYSTEM_RAM which is registered as resource.
>> >+ * arg is (start_pfn, nr_pages, private_arg_pointer)
>> >+ */
>> >+extern int walk_memory_resource(unsigned long start_pfn,
>> >+			unsigned long nr_pages, void *arg,
>> >+			int (*func)(unsigned long, unsigned long, void *));
>> >+
>> > #endif /* __ASSEMBLY__ */
>> > #endif	/* _LINUX_IOPORT_H */
>> >Index: mmotm-2.6.31-Jul16/include/linux/memory_hotplug.h
>> >===================================================================
>> >--- mmotm-2.6.31-Jul16.orig/include/linux/memory_hotplug.h
>> >+++ mmotm-2.6.31-Jul16/include/linux/memory_hotplug.h
>> >@@ -191,13 +191,6 @@ static inline void register_page_bootmem
>> > 
>> > #endif /* ! CONFIG_MEMORY_HOTPLUG */
>> > 
>> >-/*
>> >- * Walk through all memory which is registered as resource.
>> >- * arg is (start_pfn, nr_pages, private_arg_pointer)
>> >- */
>> >-extern int walk_memory_resource(unsigned long start_pfn,
>> >-			unsigned long nr_pages, void *arg,
>> >-			int (*func)(unsigned long, unsigned long, void *));
>> 
>> 
>> Why moving it? :)
>> 
>Ah, this declaration is in memory_hotplug.h because it's only for memory
>hotplug. For generic use, it's better to move this to iomem.h as other
>resource related ops, I think.
>


Ok, it's better if you can put this in your changelog. ;)


>
>
>> > 
>> > #ifdef CONFIG_MEMORY_HOTREMOVE
>> > 
>> >Index: mmotm-2.6.31-Jul16/kernel/resource.c
>> >===================================================================
>> >--- mmotm-2.6.31-Jul16.orig/kernel/resource.c
>> >+++ mmotm-2.6.31-Jul16/kernel/resource.c
>> >@@ -234,7 +234,7 @@ int release_resource(struct resource *ol
>> > 
>> > EXPORT_SYMBOL(release_resource);
>> > 
>> >-#if defined(CONFIG_MEMORY_HOTPLUG) && !defined(CONFIG_ARCH_HAS_WALK_MEMORY)
>> >+#if !defined(CONFIG_ARCH_HAS_WALK_MEMORY)
>> > /*
>> >  * Finds the lowest memory reosurce exists within [res->start.res->end)
>> >  * the caller must specify res->start, res->end, res->flags.
>> 
>> 
>> Shouldn't this part be in patch 6/6 instead of this one?
>> 
>Hmm, ok, I'll reorder 5/6 and 6/6 and define walk_system_ram_range() before
>this patch.

Thank you for keeping working on this! :)

  reply	other threads:[~2009-07-29  8:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-24  8:08 [RFC][PATCH 0/6] kcore clean up and enhance. v3 KAMEZAWA Hiroyuki
2009-07-24  8:10 ` [RFC][PATCH 1/6] kcore: clean up to use generic list ops KAMEZAWA Hiroyuki
2009-07-24  8:11 ` [RFC][PATCH 2/6] kcore : add type attribute to kclist KAMEZAWA Hiroyuki
2009-07-24  8:13 ` [RFC][PATCH 3/6] kcore: unify vmalloc range entry KAMEZAWA Hiroyuki
2009-07-28 10:05   ` Amerigo Wang
2009-07-24  8:15 ` [RFC][PATCH 4/6] kcore: kcore unify text " KAMEZAWA Hiroyuki
2009-07-28 10:10   ` Amerigo Wang
2009-07-24  8:19 ` [RFC][PATCH 5/6] kcore: check physical memory range in correct way KAMEZAWA Hiroyuki
2009-07-28 10:24   ` Amerigo Wang
2009-07-28 23:58     ` KAMEZAWA Hiroyuki
2009-07-29  8:50       ` Amerigo Wang [this message]
2009-07-24  8:22 ` [RFC][PATCH 6/6] kcore: walk_system_ram_range() KAMEZAWA Hiroyuki

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=20090729085003.GD5856@cr0.nay.redhat.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    /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

all inboxes | Powered by JetHome®