mm/page_alloc: use free_area_empty() instead of open-coding
Subsystems (2)
PATCH 1/1 mm/page_alloc: use free_area_empty() instead of open-coding
From: chenqiwu <[email protected]>
Use free_area_empty() API to replace list_empty() for better code readability.
--- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
@@ -3534,7 +3534,7 @@ bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, }#endif if (alloc_harder && - !list_empty (&area->free_list[MIGRATE_HIGHATOMIC ])) + !free_area_empty (area,MIGRATE_HIGHATOMIC ))return true; }return false;
Signature · 1 line
1.9.1
mm/page_alloc.c bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, · line 3537
Quoted 3 lines · On Sun, Mar 08, 2020 at 08:01:45PM +0800, [email protected] wrote:
mm/page_alloc.c +1
-1if (alloc_harder && - !list_empty (&area->free_list[MIGRATE_HIGHATOMIC ])) + !free_area_empty (area,MIGRATE_HIGHATOMIC ))
I think these can now be one line?
Also, I think free_area_empty() and a number of related functions can move from mmzone.h to mm/internal.h. This will benefit all of us since mmzone.h is included from mm.h and so is widely seen throughout the kernel.
Quoted 10 lines · Matthew Wilcox
mm/page_alloc.c bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, · line 3537
Quoted 3 lines · On Sun, Mar 08, 2020 at 08:01:45PM +0800, [email protected] wrote:
mm/page_alloc.c +1
-1if (alloc_harder && - !list_empty (&area->free_list[MIGRATE_HIGHATOMIC ])) + !free_area_empty (area,MIGRATE_HIGHATOMIC ))I think these can now be one line?
Also, I think
free_area_empty()and a number of related functions can move frommmzone.htomm/internal.h. This will benefit all of us sincemmzone.his included frommm.hand so is widely seen throughout the kernel.
I agree.
Qiwu