From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71471C433E2 for ; Wed, 9 Sep 2020 10:54:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C5DEE2087C for ; Wed, 9 Sep 2020 10:54:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5DEE2087C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1CCB56B0037; Wed, 9 Sep 2020 06:54:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17E276B0055; Wed, 9 Sep 2020 06:54:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 092AF6B005A; Wed, 9 Sep 2020 06:54:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id E82976B0037 for ; Wed, 9 Sep 2020 06:54:47 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B19058248D7C for ; Wed, 9 Sep 2020 10:54:47 +0000 (UTC) X-FDA: 77243215014.20.pull61_2d03853270dc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 85D25180C07A3 for ; Wed, 9 Sep 2020 10:54:47 +0000 (UTC) X-HE-Tag: pull61_2d03853270dc X-Filterd-Recvd-Size: 3790 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Sep 2020 10:54:46 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 822B2AEB6; Wed, 9 Sep 2020 10:54:46 +0000 (UTC) Subject: Re: [RFC 0/5] disable pcplists during page isolation To: David Hildenbrand , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Michal Hocko , Pavel Tatashin , Oscar Salvador , Joonsoo Kim References: <20200907163628.26495-1-vbabka@suse.cz> <0ffb1c2d-1b28-23f7-53e1-63e6f0f4cd41@redhat.com> From: Vlastimil Babka Message-ID: Date: Wed, 9 Sep 2020 12:54:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <0ffb1c2d-1b28-23f7-53e1-63e6f0f4cd41@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 85D25180C07A3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/8/20 8:29 PM, David Hildenbrand wrote: > On 07.09.20 18:36, Vlastimil Babka wrote: >> As per the discussions [1] [2] this is an attempt to implement David's >> suggestion that page isolation should disable pcplists to avoid races. This is >> done without extra checks in fast paths, as I mentioned should be possible in >> the discussion, and explained in patch 5. Patches 1-4 are preparatory cleanups. >> >> Note this is untested RFC for now. Based on v5.9-rc4 plus Pavel's patch [2] >> (slated as a quick fix for mainline+stable). >> >> [1] https://lore.kernel.org/linux-mm/20200901124615.137200-1-pasha.tatashin@soleen.com/ >> [2] https://lore.kernel.org/linux-mm/20200903140032.380431-1-pasha.tatashin@soleen.com/ >> >> Vlastimil Babka (5): >> mm, page_alloc: clean up pageset high and batch update >> mm, page_alloc: calculate pageset high and batch once per zone >> mm, page_alloc(): remove setup_pageset() >> mm, page_alloc: cache pageset high and batch in struct zone >> mm, page_alloc: disable pcplists during page isolation >> >> include/linux/gfp.h | 1 + >> include/linux/mmzone.h | 2 + >> mm/internal.h | 4 ++ >> mm/memory_hotplug.c | 24 +++---- >> mm/page_alloc.c | 138 ++++++++++++++++++++++------------------- >> mm/page_isolation.c | 45 +++++++++++--- >> 6 files changed, 127 insertions(+), 87 deletions(-) >> > > Thanks for looking into this! Just a heads-up that -mm and -next contain > some changes to memory hotplug code, whereby new pageblocks start out in > MIGRATE_ISOLATE when onlining, until we're done with the heavy lifting. > Might require some tweaks, similar to when isolating pageblocks. Thanks for the heads-up. I've posted updated patch 5/5 for the -next as a reply to the first one. It was a bit tricky to order everything correctly in online_pages(), hopefully I avoided any deadlock. > Will dive into this in the following days. What's you're general > perception of performance aspects? Thanks! I expect no performance change while no isolation is in progress, as there are no new tests added in alloc/free paths. During page isolation there's a single drain instead of once-per-pageblock, which is a benefit. But the pcplists are effectively disabled for the whole of online_pages(), offline_pages() or alloc_contig_range(), which will affect parallel page allocator users. It depends on how long these operations take and how heavy the parallel usage is, so I have no good answers. Might be similar to the current periodic drain.