[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOkaeLJHE-BVM+KOpB5hd0Jd_wyk0-XY=Qhzk+0j_U9opCbr-g@mail.gmail.com>
Date: Sun, 25 Sep 2011 23:02:47 +0800
From: Wizard <wizarddewhite@...il.com>
To: Borislav Petkov <bp@...en8.de>, Wizard <wizarddewhite@...il.com>,
linux-kernel@...r.kernel.org,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: Seems the comment of find_next_system_ram() is not exact
Borislav
Thanks for your reply and for your suggestion to use "git annotate".
I learned a lot from you.
I see the commit by KAMEZAWA. While still not know why he change
code this way to cover the overlap case.
I find the function is introduced in 2842f11419704f8707fffc82e10d2263427fc130.
While the mm/memory_hotplug.c is chaged during this period.
If I want to view the code at that moment, I should use git checkout
2842f11419704f8707fffc82e10d2263427fc130?
2011/9/25, Borislav Petkov <bp@...en8.de>:
> On Sat, Sep 24, 2011 at 09:40:52PM +0800, Wizard wrote:
>> Hi, Experts
>>
>> I am a newbie for linux kernel. I just read the code of
>> find_next_system_ram() in kernel/resource.c
>>
>> I think the comment of this function is not exact. This says "Finds
>> the lowest memory reosurce exists within [res->start.res->end)".
>>
>> While I think the code is to find the lowest memory resource overlaps
>> [res->start, res->end).
>>
>> 308: if ((p->end >= start) && (p->start < end))
>>
>> If I am not correct, please let me know. :)
>
> Right,
>
> hint for the future, do a "git annotate" on the file containing that
> code - the patch adding the piece of code might (err, and should!) have
> a verbose commit message explaining the situation. And it seems it does
> have something to a degree, here's another hint:
>
> 58c1b5b079071
>
> :-)
>
> But I agree that the comment over the function could use some more
> verbosity on why the function needs to handle overlapping resources and
> sections. Let's ask the author.
>
>> BTW, I find the "reosurce" is a typo.
>
> Yes, he could fix it while explaining the overlap :-).
>
> HTH.
>
> --
> Regards/Gruss,
> Boris.
>
--
Wizard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists