Re: [patch] mm: clean up zone flags

From: Johannes Weiner
Date: Tue Sep 02 2014 - 18:27:05 EST


On Tue, Sep 02, 2014 at 02:42:14PM -0700, David Rientjes wrote:
> On Tue, 2 Sep 2014, Johannes Weiner wrote:
> > @@ -631,7 +631,7 @@ long wait_iff_congested(struct zone *zone, int sync, long timeout)
> > * of sleeping on the congestion queue
> > */
> > if (atomic_read(&nr_bdi_congested[sync]) == 0 ||
> > - !zone_is_reclaim_congested(zone)) {
> > + test_bit(ZONE_CONGESTED, &zone->flags)) {
> > cond_resched();
> >
> > /* In case we scheduled, work out time remaining */
>
> That's not equivalent.
>
> [snip]
>
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index 2836b5373b2e..590a92bec6a4 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -920,7 +920,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
> > /* Case 1 above */
> > if (current_is_kswapd() &&
> > PageReclaim(page) &&
> > - zone_is_reclaim_writeback(zone)) {
> > + test_bit(ZONE_WRITEBACK, &zone->flags)) {
> > nr_immediate++;
> > goto keep_locked;
> >
> > @@ -1002,7 +1002,7 @@ static unsigned long shrink_page_list(struct list_head *page_list,
> > */
> > if (page_is_file_cache(page) &&
> > (!current_is_kswapd() ||
> > - !zone_is_reclaim_dirty(zone))) {
> > + test_bit(ZONE_DIRTY, &zone->flags))) {
> > /*
> > * Immediately reclaim when written back.
> > * Similar in principal to deactivate_page()
>
> Nor is this.
>
> After fixed, for the oom killer bits:
>
> Acked-by: David Rientjes <rientjes@xxxxxxxxxx>
>
> since this un-obscurification is most welcome.

Yikes, thanks for catching those and acking. Updated patch:

---