On Mon, Nov 20, 2023 at 09:40:48AM -0800, Andrew Morton wrote: > On Mon, 20 Nov 2023 09:36:46 -0800 Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > > On Mon, 20 Nov 2023 at 05:31, Kirill A. Shutemov > > <kirill.shutemov@xxxxxxxxxxxxxxx> wrote: > > > > > > NR_ORDERS defines the number of page orders supported by the page > > > allocator, ranging from 0 to MAX_ORDER, MAX_ORDER + 1 in total. > > > > > > NR_ORDERS assists in defining arrays of page orders and allows for more > > > natural iteration over them. > > > > Well, the thing is, I really think we need to rename or remove > > "MAX_ORDER" entirely. > > > > Because as-is, that #define now has completely different meaning than > > it used to have for 24 years. Which is not only confusing to people > > who might just remember the old semantics, it's a problem for > > backporting (and for merging stuff, but that is a fairly temporary > > pain and _maybe_ this one-time device mapper thing was the only time > > it will ever happen) > > > > Yes please. MAX_ORDER was always a poor name - it implies that it's > inclusive. Renaming it to NR_ORDERS makes it clearer that the usual > and expected "up to but not including" semantics apply. I personally would prefer to have both value for different use cases. What about MAX_PAGE_ORDER and NR_PAGE_ORDERS? If it is okay, I will prepare patches. -- Kiryl Shutsemau / Kirill A. Shutemov