All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yoshinori K. Okuji" <okuji@enbug.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: doc on memory management
Date: Tue, 2 Aug 2005 22:41:16 +0200	[thread overview]
Message-ID: <200508022241.16966.okuji@enbug.org> (raw)
In-Reply-To: <42EF9CFB.7040804@yahoo.fr>

On Tuesday 02 August 2005 18:19, Vincent Pelletier wrote:
> I wonder why the region header contains, to me, a useless field : addr.

It is useful when debugging the code.

> I see a light improvement in grub_mm_init_region :
>   /* If this region is too small, ignore it.  */
>   if (size < GRUB_MM_ALIGN * 2)
>     return;
> If the region is 2*GRUB_MM_ALIGN, we can put a grub_mm_header_t plus a
> grub_mm_region_t, and it would be full. Maybe adding 1 byte (or more)
> might make more sense (but has it any practical impact...).

That check is put only to avoid a strange error.

> My realloc implementation handled the case where the realloc'ed block
> had enough space after to expand. I might send a patch for this someday
> if anyone finds it interesting to add.

I'm not sure if it is really meaningful. Only if you can prove that your 
implementation improves something (such as memory efficiency), I will 
incorporate it.

> I also implemented a memory defrag that merges successive free chunks in
> one bigger. Although it relied on the fact both alloc'ed and free chucks
> are known I think it can be adapted (if h->next != h+h->size*16, don't
> merge h and h->next) and even a bit faster (as we only see free chunks).

The current implementation merges free regions. What is bad?

Okuji



  parent reply	other threads:[~2005-08-02 21:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-02 14:41 doc on memory management Vincent Guffens
2005-08-02 15:36 ` Vladimir Serbinenko
2005-08-02 18:10   ` Vincent Guffens
2005-08-02 16:19 ` Vincent Pelletier
2005-08-02 18:06   ` Vincent Guffens
2005-08-02 19:24     ` Vincent Pelletier
2005-08-02 20:41   ` Yoshinori K. Okuji [this message]
2005-08-03 20:14     ` Vincent Pelletier
2005-08-03 11:19 ` Marco Gerards
2005-08-08 15:41   ` Vincent Guffens

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=200508022241.16966.okuji@enbug.org \
    --to=okuji@enbug.org \
    --cc=grub-devel@gnu.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.