mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Jan Beulich" <jbeulich@novell.com>
Cc: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86-64: fix combining of regions in init_memory_mapping()
Date: Sun, 14 Sep 2008 11:20:31 -0700	[thread overview]
Message-ID: <86802c440809141120v5f468775n81de6a29bbb89019@mail.gmail.com> (raw)
In-Reply-To: <48CA9C18.76E4.0078.0@novell.com>

On Fri, Sep 12, 2008 at 7:43 AM, Jan Beulich <jbeulich@novell.com> wrote:
> When nr_range gets decremented, the same slot must be considered for
> coalescing with its new successor again.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>
> ---
>  arch/x86/mm/init_64.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-2.6.27-rc6/arch/x86/mm/init_64.c      2008-08-29 10:53:00.000000000 +0200
> +++ 2.6.27-rc6-x86_64-mr-coalesce/arch/x86/mm/init_64.c 2008-09-12 11:58:45.000000000 +0200
> @@ -636,7 +636,7 @@ unsigned long __init_refok init_memory_m
>                old_start = mr[i].start;
>                memmove(&mr[i], &mr[i+1],
>                         (nr_range - 1 - i) * sizeof (struct map_range));
> -               mr[i].start = old_start;
> +               mr[i--].start = old_start;
>                nr_range--;
>        }
>

this patch seems not right.
Ingo, please don't apply it.

original code:
        /* try to merge same page size and continuous */
        for (i = 0; nr_range > 1 && i < nr_range - 1; i++) {
                unsigned long old_start;
                if (mr[i].end != mr[i+1].start ||
                    mr[i].page_size_mask != mr[i+1].page_size_mask)
                        continue;
                /* move it */
                old_start = mr[i].start;
                memmove(&mr[i], &mr[i+1],
                         (nr_range - 1 - i) * sizeof (struct map_range));
                mr[i].start = old_start;
                nr_range--;
        }

so it save old_start and first, and move entries forward (so old one
is overwriten), and put back old_start ...

YH

  reply	other threads:[~2008-09-14 18:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-12 14:43 Jan Beulich
2008-09-14 18:20 ` Yinghai Lu [this message]
2008-09-15  8:17   ` Jan Beulich
2008-09-15  8:34     ` Yinghai Lu
2008-09-15 12:51       ` Ingo Molnar

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=86802c440809141120v5f468775n81de6a29bbb89019@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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®