mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: moreau francis <francis_moreau2000@yahoo.fr>
To: Andy Whitcroft <apw@shadowen.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re : sparsemem usage
Date: Wed, 2 Aug 2006 15:12:33 +0000 (GMT)	[thread overview]
Message-ID: <20060802151233.46707.qmail@web25801.mail.ukl.yahoo.com> (raw)
In-Reply-To: <44D0B5C6.1040006@shadowen.org>

Andy Whitcroft wrote:
> The memory allocator buddy location algorithm has an implicit assumption 
> that the memory map will be contigious and valid out to MAX_ORDER.  ie 
> that we can do relative arithmetic on a page* for a page to find its 
> buddy at all times.  The allocator never looks outside a MAX_ORDER 
> block, aligned to MAX_ORDER in physical pages.  SPARSEMEM's 
> implementation by it nature breaks up the mem_map at the section size. 
> Thus for the buddy to work a section must be >= MAX_ORDER in size to 
> maintain the contiguity constraint.

thanks for the explanation. But still something I'm missing, how can a
MAX_ORDER block be allocated in a memory whose size is only 128Ko ?
Can't it be detected by the buddy allocatorvery early without doing any 
relative arithmetic on a page* ?

> However, just because you have a small memory block in your memory map 
> doesn't mean that the sparsemem section size needs to be that small to 
> match.  If there is any valid memory in any section that section will be 
> instantiated and the valid memory marked within it, any invalid memory 
> is marked reserved.  

ah ok but that means that pfn_valid() will still returns ok for invalid page which
are in a invalid memory marked as reserved. Is it not risky ?

> The section size bounds the amount of internal 
> fragmentation we can have in the mem_map.  SPARSEMEM as its name 
> suggests wins biggest when memory is very sparsly populate. 

sorry but I don't understand. I would say that sparsemem section size should
be chosen to make mem_map[] and mem_section[] sizes as small as possible.

> If I am 
> reading correctly your memory is actually contigious.

well there're big holes in address space.

thanks

Francis





  reply	other threads:[~2006-08-02 15:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-02 13:44 moreau francis
2006-08-02 14:25 ` Andy Whitcroft
2006-08-02 15:12   ` moreau francis [this message]
2006-08-02 15:36     ` Re : " Andy Whitcroft
2006-08-03  9:56       ` Re : " moreau francis
2006-08-02 15:24 ` Alan Cox
2006-08-02 15:33   ` Re : " moreau francis
2006-08-02 16:33     ` Alan Cox
2006-08-10  4:46 Re : Re : Re : " KAMEZAWA Hiroyuki
2006-08-10 12:40 ` moreau francis
2006-08-10 12:49   ` KAMEZAWA Hiroyuki
2006-08-10 14:46 moreau francis
2006-08-10 15:05 ` KAMEZAWA Hiroyuki
2006-08-10 15:21 ` 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=20060802151233.46707.qmail@web25801.mail.ukl.yahoo.com \
    --to=francis_moreau2000@yahoo.fr \
    --cc=apw@shadowen.org \
    --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®