Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp226728pxb; Thu, 17 Feb 2022 02:44:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxipii+SvUTBbez7EjHzJbcMRYTEWIR690wDCsANNXDhilz1vqWbqHhJ2JYHUWYKBVRrTNt X-Received: by 2002:a17:902:9a06:b0:14d:a75f:1eff with SMTP id v6-20020a1709029a0600b0014da75f1effmr2182096plp.139.1645094695873; Thu, 17 Feb 2022 02:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645094695; cv=none; d=google.com; s=arc-20160816; b=0M0yK40EgrO9mwle0+Tw9BIueAknfiKv5t37VzINqwYgmJ0bPHvFDVOG+zcrSnFhqm agtAsm6+1Wpfp3h8jsODNO6I0d61hGFLq8tKaoDa+ZJIbbSt36mClmOIoxBmhUjfuYtx CcUTr/BhkIaPuM4Tg3z3BgVuADhWIj9ndR4QcWTU6b3fp62odNh5PdblLyxtyVm1mLca EIYfZx/41AzfL/UzFmvFvjF+Mj/NwV3Iu7bFgnBMIlQQbHdB7QugPDkyimi5OssQOOqW LXkdvaxWUUB/ioB8s8P4FufER2L3rkQHwCdKxXiu5CjUWpUkU9MOFWdVTEtbHkBtGCk3 KyIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=wmVL2GYDhN1VFmtx9IfL5/C+kz1evNxXCS6Kv/s4HgU=; b=d2cnmmEh9lHJu28geZYYlhjBFYOW6NXIoAKOLpDHKK+pZ1FgAhu0Jqj5TsIUNCUDqJ RZvm2n1RGlsXIOMGCPlLU0qPnO5Lz4mC+0QTcLyDGjN0XwiIYOW/WpinE6TZApvY9l1e oPSrRzWDQBMoILcyCdHg4xB8x+4D/ApBXt8hGBZCPwa+PtHjaeBdC4ZJJdYrgShbfmPz Iqei2Gn96GeTs+uESwgTk82Pc0zPqqcZB2f+rYPdbm+gTYu9d6vRer1yywfibwnhnJ5E c5/vmDQBjS1sfV46RE/RfXWZnJIhzo/+bloyjkHVMcriMWvztbfJgsVib0qIJi1TOKkW 1eWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ZHdJNthK; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=m5plmMif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 67si9487023pgi.130.2022.02.17.02.44.39; Thu, 17 Feb 2022 02:44:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ZHdJNthK; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=m5plmMif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238802AbiBQJmZ (ORCPT + 99 others); Thu, 17 Feb 2022 04:42:25 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237910AbiBQJmY (ORCPT ); Thu, 17 Feb 2022 04:42:24 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0BED13CF9 for ; Thu, 17 Feb 2022 01:42:10 -0800 (PST) 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-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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;