mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: "Ingo Molnar" <mingo@elte.hu>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Jesse Barnes" <jbarnes@virtuousgeek.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: split e820 reserved entries record to late v3
Date: Thu, 28 Aug 2008 18:02:48 -0700	[thread overview]
Message-ID: <86802c440808281802w7994d7cdjcd1f36fe3381ac76@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.1.10.0808281750520.3300@nehalem.linux-foundation.org>

On Thu, Aug 28, 2008 at 5:53 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
>
> On Thu, 28 Aug 2008, Yinghai Lu wrote:
>>  /*
>>   * Mark e820 reserved areas as busy for the resource manager.
>>   */
>> +struct resource __initdata *e820_res;
>
> Btw, make this one "static" - I don't think anybody outside of this file
> should ever use it anyway.

yes

>
> And this:
>
>> +             if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20))
>> +                     insert_resource(&iomem_resource, res);
>
> is probably worthy of a comment.

how about
/*
 * don't register the region that could be conflicted with pci device
BAR resource
 * and insert them later.
 */


>
> And finally:
>
>> +void __init e820_reserve_resources_late(void)
>> +{
>> +     int i;
>> +     struct resource *res;
>> +
>> +     res = e820_res;
>> +     for (i = 0; i < e820.nr_map; i++) {
>> +             if (e820.map[i].type == E820_RESERVED && res->start >= (1ULL<<20))
>> +                     insert_resource(&iomem_resource, res);
>
> instead of duplicating the conditional and always having to worry about it
> matching, how about just making it
>
>                if (!res->parent)
>                        insert_resource(&iomem_resource, res);
>
> which basically says that "if it's not already inserted, try to re-insert
> it now".
there could be one is all zero, when 32bit/!64_RESOURCE.
so could change it to
                if (!res->parent && res->end)
                       insert_resource(&iomem_resource, res);

YH

      reply	other threads:[~2008-08-29  1:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-29  0:41 Yinghai Lu
2008-08-29  0:53 ` Linus Torvalds
2008-08-29  1:02   ` Yinghai Lu [this message]

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=86802c440808281802w7994d7cdjcd1f36fe3381ac76@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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®