From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with ESMTP id 67CC7900149 for ; Tue, 4 Oct 2011 10:17:37 -0400 (EDT) Received: by qyk27 with SMTP id 27so513685qyk.14 for ; Tue, 04 Oct 2011 07:17:34 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20111003192458.14d198a3.kamezawa.hiroyu@jp.fujitsu.com> Date: Tue, 4 Oct 2011 22:17:33 +0800 Message-ID: Subject: Re: One comment on the __release_region in kernel/resource.c From: Wei Yang Content-Type: multipart/alternative; boundary=bcaec5395f1eaff21404ae79c063 Sender: owner-linux-mm@kvack.org List-ID: To: Geert Uytterhoeven Cc: KAMEZAWA Hiroyuki , linux-kernel@vger.kernel.org, linux-mm@kvack.org --bcaec5395f1eaff21404ae79c063 Content-Type: text/plain; charset=ISO-8859-1 2011/10/3 Geert Uytterhoeven > On Mon, Oct 3, 2011 at 15:35, Wei Yang wrote: > > 2011/10/3 Geert Uytterhoeven > >> On Mon, Oct 3, 2011 at 12:24, KAMEZAWA Hiroyuki > >> wrote: > >> > On Sun, 2 Oct 2011 21:57:07 +0800 > >> > Wei Yang wrote: > >> > > >> >> Dear experts, > >> >> > >> >> I am viewing the source code of __release_region() in > >> >> kernel/resource.c. > >> >> And I have one comment for the performance issue. > >> >> > >> >> For example, we have a resource tree like this. > >> >> 10-89 > >> >> 20-79 > >> >> 30-49 > >> >> 55-59 > >> >> 60-64 > >> >> 65-69 > >> >> 80-89 > >> >> 100-279 > >> >> > >> >> If the caller wants to release a region of [50,59], the original code > >> >> will > >> ^^^^^^^ > >> Do you really mean [50,59]? > > > > Yes. > >> > >> I don't think that's allowed, as the tree has [55,59], so you would > >> release a > >> larger region that allocated. > > > > So you mean the case I mentioned will not happen? > > Indeed, it should not happen. > Actually I'm surprised it doesn't return an error code. > Do you think someone will take care of this? > > > Actually, I believe every developer should pass the resource region which > > has been allocated. > > While if some one made a mistake and pass a region which is not allocated > > before and overlap > > some "BUSY" region? > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- > geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. > But > when I'm talking to journalists I just say "programmer" or something like > that. > -- Linus Torvalds > -- Wei Yang Help You, Help Me --bcaec5395f1eaff21404ae79c063 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2011/10/3 Geert Uytterhoeven <geert@linux-m68k.org>
On Mon, Oct 3, 2011 at 15:35, Wei Yang &l= t;weiyang.kernel@gmail.com&= gt; wrote:
> 2011/10/3 Geert Uytterhoeven <geert@linux-m68k.org>
>> On Mon, Oct 3, 2011 at 12:24, KAMEZAWA Hiroyuki
>> <kamezawa.hir= oyu@jp.fujitsu.com> wrote:
>> > On Sun, 2 Oct 2011 21:57:07 +0800
>> > Wei Yang <weiy= ang.kernel@gmail.com> wrote:
>> >
>> >> Dear experts,
>> >>
>> >> I am viewing the source code of __release_region() in
>> >> kernel/resource.c.
>> >> And I have one comment for the performance issue.
>> >>
>> >> For example, we have a resource tree like this.
>> >> 10-89
>> >> =A0 =A020-79
>> >> =A0 =A0 =A0 =A030-49
>> >> =A0 =A0 =A0 =A055-59
>> >> =A0 =A0 =A0 =A060-64
>> >> =A0 =A0 =A0 =A065-69
>> >> =A0 =A080-89
>> >> 100-279
>> >>
>> >> If the caller wants to release a region of [50,59], the o= riginal code
>> >> will
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0^^^^^^^
>> Do you really mean [50,59]?
>
> Yes.
>>
>> I don't think that's allowed, as the tree has [55,59], so = you would
>> release a
>> larger region that allocated.
>
> So you mean the case I mentioned will not happen?

Indeed, it should not happen.
Actually I'm surprised it doesn't return an error code.
Do you think someone will take care of this?

> Actually, I believe every developer should pass the resource region wh= ich
> has been allocated.
> While if some one made a mistake and pass a region which is not alloca= ted
> before and overlap
> some "BUSY" region?

Gr{oetje,eeting}s,

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. Bu= t
when I'm talking to journalists I just say "programmer" or so= mething like that.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 =A0=A0 -- Linus = Torvalds



--
Wei YangHelp You, Help Me

--bcaec5395f1eaff21404ae79c063-- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org