[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161011080108.GE31996@dhcp22.suse.cz>
Date: Tue, 11 Oct 2016 10:01:08 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Minchan Kim <minchan@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Vlastimil Babka <vbabka@...e.cz>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Sangseok Lee <sangseok.lee@....com>
Subject: Re: [PATCH 3/4] mm: unreserve highatomic free pages fully before OOM
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
Powered by blists - more mailing lists