On Tue 11-10-16 16:37:16, Minchan Kim wrote: > On Tue, Oct 11, 2016 at 09:26:06AM +0200, Michal Hocko wrote: > > On Tue 11-10-16 16:09:45, Minchan Kim wrote: [...] > > > @@ -2154,12 +2156,24 @@ static void unreserve_highatomic_pageblock(const struct alloc_context *ac) > > > * may increase. > > > */ > > > set_pageblock_migratetype(page, ac->migratetype); > > > - move_freepages_block(zone, page, ac->migratetype); > > > - spin_unlock_irqrestore(&zone->lock, flags); > > > - return; > > > + ret = move_freepages_block(zone, page, > > > + ac->migratetype); > > > + /* > > > + * By race with page freeing functions, !highatomic > > > + * pageblocks can have free pages in highatomic free > > > + * list so if drain is true, try to unreserve every > > > + * free pages in highatomic free list without bailing > > > + * out. > > > + */ > > > + if (!drain) { > > > > if (ret) > > > + spin_unlock_irqrestore(&zone->lock, flags); > > > + return ret; > > > + } > > > > arguably this would work better also for !drain case which currently > > tries to unreserve but in case of the race it would do nothing. > > I thought it but I was afraid if you say again it's over complicated. Well, maybe there is even better/easier solution. Anyway, if I were you I would just split it into two patches. The first to unreserve from shoudl_reclaim_retry and the later to make unreserve_highatomic_pageblock more reliable. > I will do it with your SOB in next spin. ok, thanks! -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>