Re: [PATCH v2] mm/page_alloc: simplify page_is_buddy() for better code readability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 10, 2020 at 09:28:46AM +0100, Vlastimil Babka wrote:
> On 3/10/20 3:34 AM, qiwuchen55@xxxxxxxxx wrote:
> > From: chenqiwu <chenqiwu@xxxxxxxxxx>
> > 
> > Simplify page_is_buddy() to reduce the redundant code for better code
> > readability.
> > 
> > Signed-off-by: chenqiwu <chenqiwu@xxxxxxxxxx>
> 
> I would personally keep testing the page type first, and even switch it so that
> PageBuddy is tested before page_is_guard (but it only matters on debugging kernels).
> 
> I can only speculate which will have better performance (if any), but it's more
> logical to test the type first. Both orders should be safe though as we have the
> zone lock.

Yes, I have ignored the iegality of the page must be checked first.
Thanks for your review!




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux