From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by kanga.kvack.org (Postfix) with ESMTP id 132946B0253 for ; Wed, 22 Jun 2016 17:59:04 -0400 (EDT) Received: by mail-pa0-f70.google.com with SMTP id fg1so107819666pad.1 for ; Wed, 22 Jun 2016 14:59:04 -0700 (PDT) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org. [140.211.169.12]) by mx.google.com with ESMTPS id de8si709991pad.86.2016.06.22.14.59.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 14:59:03 -0700 (PDT) Date: Wed, 22 Jun 2016 14:59:02 -0700 From: Andrew Morton Subject: Re: [patch] mm, compaction: abort free scanner if split fails Message-Id: <20160622145902.9f07aa13048d4782c881cb6c@linux-foundation.org> In-Reply-To: <20160622145617.79197acff1a7e617b9d9d393@linux-foundation.org> References: <20160622145617.79197acff1a7e617b9d9d393@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes , Vlastimil Babka , Minchan Kim , Joonsoo Kim , Mel Gorman , Hugh Dickins , linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org On Wed, 22 Jun 2016 14:56:17 -0700 Andrew Morton wrote: > On Tue, 21 Jun 2016 18:22:49 -0700 (PDT) David Rientjes wrote: > > > If the memory compaction free scanner cannot successfully split a free > > page (only possible due to per-zone low watermark), terminate the free > > scanner rather than continuing to scan memory needlessly. If the > > watermark is insufficient for a free page of order <= cc->order, then > > terminate the scanner since all future splits will also likely fail. > > > > This prevents the compaction freeing scanner from scanning all memory on > > very large zones (very noticeable for zones > 128GB, for instance) when > > all splits will likely fail while holding zone->lock. > > > > This collides pretty heavily with Joonsoo's "mm/compaction: split > freepages without holding the zone lock". > > I ended up with this, in isolate_freepages_block(): > > /* Found a free page, will break it into order-0 pages */ > order = page_order(page); > isolated = __isolate_free_page(page, page_order(page)); > set_page_private(page, order); > > total_isolated += isolated; > cc->nr_freepages += isolated; > list_add_tail(&page->lru, freelist); > > if (!strict && cc->nr_migratepages <= cc->nr_freepages) { > blockpfn += isolated; > break; > } > /* Advance to the end of split page */ > blockpfn += isolated - 1; > cursor += isolated - 1; > continue; > > isolate_fail: > And mm-compaction-split-freepages-without-holding-the-zone-lock-fix.patch churns things around some more. Now this: /* Found a free page, will break it into order-0 pages */ order = page_order(page); isolated = __isolate_free_page(page, order); set_page_private(page, order); total_isolated += isolated; list_add_tail(&page->lru, freelist); cc->nr_freepages += isolated; if (!strict && cc->nr_migratepages <= cc->nr_freepages) { blockpfn += isolated; break; } /* Advance to the end of split page */ blockpfn += isolated - 1; cursor += isolated - 1; continue; isolate_fail: and things are looking a bit better... -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org