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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 046BBC433EF for ; Thu, 17 Feb 2022 09:42:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EF5A6B0075; Thu, 17 Feb 2022 04:42:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 89D9B6B0078; Thu, 17 Feb 2022 04:42:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B48F6B007B; Thu, 17 Feb 2022 04:42:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id 6DDD66B0075 for ; Thu, 17 Feb 2022 04:42:11 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2990190931 for ; Thu, 17 Feb 2022 09:42:11 +0000 (UTC) X-FDA: 79151780862.25.07FDBD9 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf16.hostedemail.com (Postfix) with ESMTP id 88E39180003 for ; Thu, 17 Feb 2022 09:42:10 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 78EEF2198B; Thu, 17 Feb 2022 09:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1645090929; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wmVL2GYDhN1VFmtx9IfL5/C+kz1evNxXCS6Kv/s4HgU=; b=ZHdJNthK2g0RPIYnVRM/p3Q5ZMW83LBt0jMHt8WtevyBS1WEKFwfKsAOgcYtqDUHm6Rnio GnNa1qBidJqRr6FM7RGkv1J5Q5PJs/lQTQ5MKt4UrwzRpNDIQUWJJOaNblUVeFR/rDojyw 20EPCAEwrQWv/MIluN8mAo96Dr3dqjk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1645090929; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wmVL2GYDhN1VFmtx9IfL5/C+kz1evNxXCS6Kv/s4HgU=; b=m5plmMifhjqXPOqwW0ysI7NX//dFVlmox3Iba58D5g0v1RSHNuLv2p3lczJbTMAPYI4egg yZEUpKn2PsawZlBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5901813BBF; Thu, 17 Feb 2022 09:42:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zd8ZFXEYDmJdKQAAMHmgww (envelope-from ); Thu, 17 Feb 2022 09:42:09 +0000 Message-ID: <25381c82-36b6-e62b-de20-db438bc85adb@suse.cz> Date: Thu, 17 Feb 2022 10:42:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH 4/6] mm/page_alloc: Drain the requested list first during bulk free Content-Language: en-US To: Mel Gorman , Andrew Morton Cc: Aaron Lu , Dave Hansen , Michal Hocko , Jesper Dangaard Brouer , LKML , Linux-MM References: <20220217002227.5739-1-mgorman@techsingularity.net> <20220217002227.5739-5-mgorman@techsingularity.net> From: Vlastimil Babka In-Reply-To: <20220217002227.5739-5-mgorman@techsingularity.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: q3cf5z71osh1c6ouinj4ib6za6go8fsi X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 88E39180003 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=ZHdJNthK; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=m5plmMif; dmarc=none; spf=pass (imf16.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspam-User: X-HE-Tag: 1645090930-422037 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 2/17/22 01:22, Mel Gorman wrote: > Prior to the series, pindex 0 (order-0 MIGRATE_UNMOVABLE) was always > skipped first and the precise reason is forgotten. A potential reason may > have been to artificially preserve MIGRATE_UNMOVABLE but there is no reason > why that would be optimal as it depends on the workload. The more likely > reason is that it was less complicated to do a pre-increment instead of > a post-increment in terms of overall code flow. As free_pcppages_bulk() > now typically receives the pindex of the PCP list that exceeded high, > always start draining that list. > > Signed-off-by: Mel Gorman Reviewed-by: Vlastimil Babka > --- > mm/page_alloc.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index dfc347a58ea6..635a4e0f70b4 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1463,6 +1463,10 @@ static void free_pcppages_bulk(struct zone *zone, int count, > * below while (list_empty(list)) loop. > */ > count = min(pcp->count, count); > + > + /* Ensure requested pindex is drained first. */ > + pindex = pindex - 1; > + > while (count > 0) { > struct list_head *list; > int nr_pages;