From: moreau francis <francis_moreau2000@yahoo.fr>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: apw@shadowen.org, alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org
Subject: Re : sparsemem usage
Date: Thu, 10 Aug 2006 14:46:01 +0000 (GMT) [thread overview]
Message-ID: <20060810144601.97257.qmail@web25812.mail.ukl.yahoo.com> (raw)
KAMEZAWA Hiroyuki wrote:
> On Thu, 10 Aug 2006 14:40:52 +0200 (CEST)
> moreau francis <francis_moreau2000@yahoo.fr> wrote:
>>> BTW, ioresouce information (see kernel/resouce.c)
>>>
>>> [kamezawa@aworks Development]$ cat /proc/iomem | grep RAM
>>> 00000000-0009fbff : System RAM
>>> 000a0000-000bffff : Video RAM area
>>> 00100000-2dfeffff : System RAM
>>>
>>> is not enough ?
>>>
>> well actually you show that to get a really simple information, ie does
>> a page exist ?, we need to parse some kernel data structures like
>> ioresource (which is, IMHO, hackish) or duplicate in each architecture
>> some data to keep track of existing pages.
>>
>
> becasue memory map from e820(x86) or efi(ia64) are registered to iomem_resource,
> we should avoid duplicates that information. kdump and memory hotplug uses
> this information. (memory hotplug updates this iomem_resource.)
>
> Implementing "page_is_exist" function based on ioresouce is one of generic
> and rubust way to go, I think.
> (if performance of list walking is problem, enhancing ioresouce code is
> better.)
>
Why not implementing page_exist() by simply using mem_map[] ? When
allocating mem_map[], we can just fill it with a special value. And
then when registering memory area, we clear this special value with
the "reserved" value. Hence for flatmem model, we can have:
#define page_exist(pfn) (mem_map[pfn] != SPECIAL_VALUE)
and it should work for sparsemem too and other models that will use
mem_map[].
Another point, is page_exist() going to replace page_valid() ?
I mean page_exist() is going to be something more accurate than
page_valid(). All tests on page_valid() _only_ will be fine to test
page_exist(). But all tests such:
if (page_valid(x) && page_is_ram(x))
can be replaced by
if (page_exist(x))
So, again, why not simply improving page_valid() definition rather
than introduce a new service ?
Francis
next reply other threads:[~2006-08-10 14:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-10 14:46 moreau francis [this message]
2006-08-10 15:05 ` KAMEZAWA Hiroyuki
2006-08-10 15:23 ` Re : " moreau francis
2006-08-10 15:21 ` Andy Whitcroft
2006-08-10 15:37 ` Re : " moreau francis
2006-08-11 8:26 ` Andy Whitcroft
2006-08-11 12:46 ` Re : " moreau francis
2006-08-11 12:52 ` Andy Whitcroft
2006-08-16 12:56 ` Re : " moreau francis
-- strict thread matches above, loose matches on Subject: below --
2006-08-10 4:46 KAMEZAWA Hiroyuki
2006-08-10 12:40 ` moreau francis
2006-08-10 12:49 ` KAMEZAWA Hiroyuki
2006-08-02 15:24 Alan Cox
2006-08-02 15:33 ` Re : " moreau francis
2006-08-02 16:33 ` Alan Cox
2006-08-02 14:25 Andy Whitcroft
2006-08-02 15:12 ` Re : " moreau francis
2006-08-02 15:36 ` Andy Whitcroft
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=20060810144601.97257.qmail@web25812.mail.ukl.yahoo.com \
--to=francis_moreau2000@yahoo.fr \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=apw@shadowen.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 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®