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>
Subject: Re: [PATCH 4/4] kcore: remove noise from walk_memory_resource
Date: Wed, 22 Jul 2009 14:29:43 +0800 [thread overview]
Message-ID: <20090722062943.GF6281@cr0.nay.redhat.com> (raw)
In-Reply-To: <20090722152238.fc6ce3f3.kamezawa.hiroyu@jp.fujitsu.com>
On Wed, Jul 22, 2009 at 03:22:38PM +0900, KAMEZAWA Hiroyuki wrote:
>On Wed, 22 Jul 2009 14:21:03 +0800
>Amerigo Wang <xiyou.wangcong@gmail.com> wrote:
>
>> On Wed, Jul 22, 2009 at 02:12:27PM +0900, KAMEZAWA Hiroyuki wrote:
>> >From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>> >
>> >Originally, walk_memory_resource() was introduced to traverse all memory
>> >of "System RAM" for detecting memory hotplug/unplug range.
>> >For doing so, flags of IORESOUCE_MEM|IORESOURCE_BUSY was used and this
>> >was enough for memory hotplug because scanning range was controlled properly.
>> >
>> >But for using other purpose, /proc/kcore, this may includes some firmware
>> >area marked as IORESOURCE_BUSY | IORESOUCE_MEM. This patch makes the check
>> >strict to find out busy "System RAM".
>> >
>> >Note: PPC64 keeps their own walk_memory_resouce(), which walk through
>> >ppc64's lmb informaton. Because old kclist_add() is called per lmb,
>> >this patch makes no difference in behavior, finally.
>> >
>> >Changelog v2:
>> > - new patch from v2.
>> >
>> >Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>> >---
>> > kernel/resource.c | 18 ++++++++++++++----
>> > 1 file changed, 14 insertions(+), 4 deletions(-)
>> >
>> >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
>> >@@ -237,10 +237,10 @@ EXPORT_SYMBOL(release_resource);
>> > #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.
>> >+ * the caller must specify res->start, res->end, res->flags and "name".
>> > * If found, returns 0, res is overwritten, if not found, returns -1.
>> > */
>> >-static int find_next_system_ram(struct resource *res)
>> >+static int find_next_system_ram(struct resource *res, char *name)
>> > {
>> > resource_size_t start, end;
>> > struct resource *p;
>> >@@ -256,6 +256,8 @@ static int find_next_system_ram(struct r
>> > /* system ram is just marked as IORESOURCE_MEM */
>> > if (p->flags != res->flags)
>> > continue;
>> >+ if (name && strcmp(p->name, name))
>> >+ continue;
>> > if (p->start > end) {
>> > p = NULL;
>> > break;
>> >@@ -273,19 +275,27 @@ static int find_next_system_ram(struct r
>> > res->end = p->end;
>> > return 0;
>> > }
>> >+
>> >+/*
>> >+ * This function calls callback against all memory range of "System RAM"
>> >+ * which are marked as IORESOURCE_MEM and IORESOUCE_BUSY.
>> >+ * Now, this function is only for "System RAM".
>>
>>
>> Then we should change its name, shouldn't we? :)
>>
>I tried, but not changed in this version bacause the usage/purpose is not changed.
>
>Hmm, How about walk_system_ram_range() ?
Fine for me.
Thank you.
next prev parent reply other threads:[~2009-07-22 6:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 5:06 [PATCH 0/4] kcore: cleanup and fix bahavior to find physcal memory range v2 KAMEZAWA Hiroyuki
2009-07-22 5:07 ` [PATCH 1/4] kcore: clean up to use generic list ops KAMEZAWA Hiroyuki
2009-07-22 5:53 ` Amerigo Wang
2009-07-22 5:08 ` [PATCH 2/4] kcore: add kclist type KAMEZAWA Hiroyuki
2009-07-22 6:00 ` Amerigo Wang
2009-07-22 6:05 ` KAMEZAWA Hiroyuki
2009-07-22 5:10 ` [PATCH 3/4] kcore: build physical memory direct map information in proper way KAMEZAWA Hiroyuki
2009-07-22 6:09 ` Amerigo Wang
2009-07-22 6:08 ` KAMEZAWA Hiroyuki
2009-07-22 5:12 ` [PATCH 4/4] kcore: remove noise from walk_memory_resource KAMEZAWA Hiroyuki
2009-07-22 6:21 ` Amerigo Wang
2009-07-22 6:22 ` KAMEZAWA Hiroyuki
2009-07-22 6:29 ` Amerigo Wang [this message]
2009-07-22 5:52 ` [PATCH 0/4] kcore: cleanup and fix bahavior to find physcal memory range v2 Amerigo 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=20090722062943.GF6281@cr0.nay.redhat.com \
--to=xiyou.wangcong@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.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 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.