lkml.org 
[lkml]   [2011]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm: compaction: fix special case -1 order checks
On Mon, May 30, 2011 at 05:24:50PM +0200, Michal Hocko wrote:
> On Tue 31-05-11 00:16:33, Minchan Kim wrote:
> > > /* Direct compactor: Is a suitable page free? */
> > > for (order = cc->order; order < MAX_ORDER; order++) {
> > > /* Job done if page is free of the right migratetype */
> >
> > It looks good to me.
> > Let's think about another place, compaction_suitable.
>
> Good spotted.
>
> > It has same problem so we can move the check right before zone_watermark_ok.
> > As I look it more, I thought we need free pages for compaction so we would
> > be better to give up early if we can't get enough free pages. But I changed
> > my mind. It's a totally user request and we can get free pages in migration
> > progress(ex, other big memory hogger might free his big rss).
> > So my conclusion is that we should do *best effort* than early give up.
>
> Agreed
>
> > If you agree with me, how about resending patch with compaction_suitable fix?
>
> Here we go. Thanks
>
> ---
> mm: compaction: fix special case -1 order checks
>
> 56de7263 (mm: compaction: direct compact when a high-order allocation
> fails) introduced a check for cc->order == -1 in compact_finished. We
> should continue compacting in that case because the request came from
> userspace and there is no particular order to compact for.
> Similar check has been added by 82478fb7 (mm: compaction:
> prevent division-by-zero during user-requested compaction) for
> compaction_suitable.
>
> The check is, however, done after zone_watermark_ok which uses order as
> a right hand argument for shifts. Not only watermark check is pointless
> if we can break out without it but it also uses 1 << -1 which is not
> well defined (at least from C standard). Let's move the -1 check above
> zone_watermark_ok.
>
> [Minchan Kim <minchan.kim@gmail.com> - caught compaction_suitable]
> Signed-off-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>

Thanks.

--
Kind regards
Minchan Kim


\
 
 \ /
  Last update: 2011-05-30 17:41    [W:0.060 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site