Re: kswapd skips compaction if reclaim order drops to zero?

From: Minchan Kim
Date: Thu Aug 15 2013 - 10:10:20 EST


On Thu, Aug 15, 2013 at 02:56:27PM +0100, Mel Gorman wrote:
> On Thu, Aug 15, 2013 at 10:41:39PM +0900, Minchan Kim wrote:
> > Hey Mel,
> >
> > On Thu, Aug 15, 2013 at 11:47:27AM +0100, Mel Gorman wrote:
> > > On Thu, Aug 15, 2013 at 06:02:53PM +0800, Hillf Danton wrote:
> > > > If the allocation order is not high, direct compaction does nothing.
> > > > Can we skip compaction here if order drops to zero?
> > > >
> > >
> > > If the allocation order is not high then
> > >
> > > pgdat_needs_compaction == (order > 0) == false == no calling compact_pdatt
> > >
> > > In the case where order is reset to 0 due to fragmentation then it does
> > > call compact_pgdat but it does no work due to the cc->order check in
> > > __compact_pgdat.
> > >
> >
> > I am looking at mmotm-2013-08-07-16-55 but couldn't find cc->order
> > check right before compact_zone in __comact_pgdat.
> > Could you pinpoint code piece?
> >
>
> Thanks, I screwed up as that check happens too late. However, it still
> ends up not mattering because it does this
>
> compact_pgdat
> -> __compact_pgdat
> -> compact_zone
> -> compaction_suitable
>
> For order == 0, compaction_suitable will return either COMPACT_SKIPPED
> (if the watermarks are not met) and COMPACT_PARTIAL otherwise. Either
> way, compaction doesn't run.

In compaction_suitable, it could pass first zone_watermark_ok
but failed second zone_watermark_ok while fragindex is -1000
so compaction could run.

And we shouldn't depend on such coincidence.


>
> --
> Mel Gorman
> SUSE Labs
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@xxxxxxxxxx For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>

--
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/