Message ID | 1583668905-6569-1-git-send-email-qiwuchen55@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mm/page_alloc: use free_area_empty() instead of open-coding | expand |
On Sun, Mar 08, 2020 at 08:01:45PM +0800, qiwuchen55@gmail.com wrote: > if (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.
On Sun, Mar 08, 2020 at 05:29:55AM -0700, Matthew Wilcox wrote: > On Sun, Mar 08, 2020 at 08:01:45PM +0800, qiwuchen55@gmail.com wrote: > > if (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. I agree. Qiwu
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 79e950d..6ae7142 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -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;