[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZS5mDNCRkp/RGm45@duo.ucw.cz>
Date: Tue, 17 Oct 2023 12:46:36 +0200
From: Pavel Machek <pavel@....cz>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Mikulas Patocka <mpatocka@...hat.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
David Hildenbrand <david@...hat.com>, quic_jhugo@...cinc.com,
snitzer@...nel.org, dm <dm-devel@...hat.com>, linux-mm@...ck.org,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/10] Fix confusion around MAX_ORDER
On Thu 2023-09-28 18:57:18, Paolo Bonzini wrote:
> On 9/28/23 09:50, Mikulas Patocka wrote:
> > > > Fix the bugs and then change the definition of MAX_ORDER to be
> > > > inclusive: the range of orders user can ask from buddy allocator is
> > > > 0..MAX_ORDER now.
> > I think that exclusive MAX_ORDER is more intuitive in the C language -
> > i.e. if you write "for (i = 0; i < MAX_ORDER; i++)", you are supposed to
> > loop over all allowed values. If you declare an array "void
> > *array[MAX_ORDER];" you are supposed to hold a value for each allowed
> > order.
> >
> > Pascal has for loops and array dimensions with inclusive ranges - and it
> > is more prone to off-by-one errors.
>
> I agree it's somewhat confusing either way but the ship has sailed, the
> patch has been included in Linux for several months.
Just make sure people don't backport it to stable. Fixes: (the commit
that causes the semantic change) should do the trick.
BR,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists