Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp920605pxb; Wed, 16 Feb 2022 07:12:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLCo5eSCJh4ar/wi+cQc1S+/gJdJMfVgcnwctkjeAyj4oeK/dqartqUjZu775G4nVh9mGA X-Received: by 2002:a17:902:e8c2:b0:14d:8ddc:c1eb with SMTP id v2-20020a170902e8c200b0014d8ddcc1ebmr3263802plg.102.1645024374977; Wed, 16 Feb 2022 07:12:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645024374; cv=none; d=google.com; s=arc-20160816; b=fTfD7thqxxPa+V/nQjsoeEejRBAHYLuDK05+BQMHnCLTYwCFODRoGTvvjxj7qcGdzy gweu0fPfth0shj4a/zL8dxe412de2IVIaS0vjzr4wtfOnwJA+rfoM+YXqT6QH4Zuka+f nkdWkf/yZ1TZHCbGQWLytR8g3xNvFVG7ZmYXWjZPUcUAnHtwhGV/Qw0vGj+FxMNK8RfS oyorNbPLyVCImY7Cvozmg3szN1bH7lf7SCdzSefjOne3c9RLEPbT0FKduO2Zp+kkL8ZA CNe6H5ummr4qnfYS7k8uLkeSTdYjxYDEkj1OGBnzo5jKrtRYKqFiXdM0gRNj2sgMYT54 bvUA== 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=F46OJsdVIEUtxQDqrpSNoJdWyOoNFJrCo/HpT1Gj+W4=; b=rLNA4njhfTs2u2CIdUyfx+6Oldn1wosrGU+fx9LpiwDjJbe6t7JoyxWUAKEjJj9CD2 +1Ly2QGTqHSr6n1N3HuDYxJtStMeeKur4OyT/0fNrSJ0ayaYVGnehCX1NrHzJLupabL4 X7J696kJFVh98E+EEunyXmjDG8XnQyct4IZEeciXOOsNiSHIUok/UlpQHQ6OKb/RJOw7 RFKLE36fpnHcTwPrmGLLT/yU3O5D6RWCfMLRitcH5ofk+ixVnyXYp90+k0Z5AAO5AxVE WzxbCgSSpup79YS24LL3Yk+rc41Vnb4G4rd0M2JO81OmhYejstpbkJCulAfkx6t3R3ol uwwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=JGyr15YG; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=8lcIQLUS; 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 lx14si16704444pjb.13.2022.02.16.07.12.33; Wed, 16 Feb 2022 07:12:54 -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=JGyr15YG; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=8lcIQLUS; 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 S235004AbiBPOZL (ORCPT + 99 others); Wed, 16 Feb 2022 09:25:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233338AbiBPOZK (ORCPT ); Wed, 16 Feb 2022 09:25:10 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D097E28881F for ; Wed, 16 Feb 2022 06:24:57 -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 8C672212BA; Wed, 16 Feb 2022 14:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1645021496; 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=F46OJsdVIEUtxQDqrpSNoJdWyOoNFJrCo/HpT1Gj+W4=; b=JGyr15YGjeOAQxNurzfQKthEGo4+jC4YN+JLzmPDNqru5ZZta84NblLDRxhhMbIvs1Id8M C/eWGd3bd5Ljzd+ldba/sm6Ee77DCznq4d1indgxKyA4grA8dOl5u3VZrQTmAmzx8i/5s3 DcSI8LVZz2kxChWH4S7ngy2PEBROJhc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1645021496; 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=F46OJsdVIEUtxQDqrpSNoJdWyOoNFJrCo/HpT1Gj+W4=; b=8lcIQLUSeKIaRPVR3VNhYPgmAL5sTPOYN6Cbb66YqMQGdEOgUIKLHT64H414eRIJQNLSvu BO4cbyaslipCUvBA== 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 53B6313B24; Wed, 16 Feb 2022 14:24:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ufU3EzgJDWJxEAAAMHmgww (envelope-from ); Wed, 16 Feb 2022 14:24:56 +0000 Message-ID: Date: Wed, 16 Feb 2022 15:24:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH 4/5] mm/page_alloc: Free pages in a single pass 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: <20220215145111.27082-1-mgorman@techsingularity.net> <20220215145111.27082-5-mgorman@techsingularity.net> From: Vlastimil Babka In-Reply-To: <20220215145111.27082-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/15/22 15:51, Mel Gorman wrote: > free_pcppages_bulk() has taken two passes through the pcp lists since > commit 0a5f4e5b4562 ("mm/free_pcppages_bulk: do not hold lock when picking > pages to free") due to deferring the cost of selecting PCP lists until > the zone lock is held. Now that list selection is simplier, the main > cost during selection is bulkfree_pcp_prepare() which in the normal case > is a simple check and prefetching. As the list manipulations have cost > in itself, go back to freeing pages in a single pass. > > The series up to this point was evaulated using a trunc microbenchmark > that is truncating sparse files stored in page cache (mmtests config > config-io-trunc). Sparse files were used to limit filesystem interaction. > > The results versus a revert of storing high-order pages in the PCP lists is > > 1-socket Skylake > 5.17.0-rc3 5.17.0-rc3 5.17.0-rc3 > vanilla mm-reverthighpcp-v1r1 mm-highpcpopt-v1 > Min elapsed 540.00 ( 0.00%) 530.00 ( 1.85%) 530.00 ( 1.85%) > Amean elapsed 543.00 ( 0.00%) 530.00 * 2.39%* 530.00 * 2.39%* > Stddev elapsed 4.83 ( 0.00%) 0.00 ( 100.00%) 0.00 ( 100.00%) > CoeffVar elapsed 0.89 ( 0.00%) 0.00 ( 100.00%) 0.00 ( 100.00%) > Max elapsed 550.00 ( 0.00%) 530.00 ( 3.64%) 530.00 ( 3.64%) > BAmean-50 elapsed 540.00 ( 0.00%) 530.00 ( 1.85%) 530.00 ( 1.85%) > BAmean-95 elapsed 542.22 ( 0.00%) 530.00 ( 2.25%) 530.00 ( 2.25%) > BAmean-99 elapsed 542.22 ( 0.00%) 530.00 ( 2.25%) 530.00 ( 2.25%) > > 2-socket CascadeLake > 5.17.0-rc3 5.17.0-rc3 5.17.0-rc3 > vanilla mm-reverthighpcp-v1 mm-highpcpopt-v1 > Min elapsed 510.00 ( 0.00%) 500.00 ( 1.96%) 500.00 ( 1.96%) > Amean elapsed 529.00 ( 0.00%) 521.00 ( 1.51%) 516.00 * 2.46%* > Stddev elapsed 16.63 ( 0.00%) 12.87 ( 22.64%) 9.66 ( 41.92%) > CoeffVar elapsed 3.14 ( 0.00%) 2.47 ( 21.46%) 1.87 ( 40.45%) > Max elapsed 550.00 ( 0.00%) 540.00 ( 1.82%) 530.00 ( 3.64%) > BAmean-50 elapsed 516.00 ( 0.00%) 512.00 ( 0.78%) 510.00 ( 1.16%) > BAmean-95 elapsed 526.67 ( 0.00%) 518.89 ( 1.48%) 514.44 ( 2.32%) > BAmean-99 elapsed 526.67 ( 0.00%) 518.89 ( 1.48%) 514.44 ( 2.32%) > > The original motivation for multi-passes was will-it-scale page_fault1 > using $nr_cpu processes. > > 2-socket CascadeLake (40 cores, 80 CPUs HT enabled) > 5.17.0-rc3 5.17.0-rc3 > vanilla mm-highpcpopt-v1r4 > Hmean page_fault1-processes-2 2694662.26 ( 0.00%) 2696801.07 ( 0.08%) > Hmean page_fault1-processes-5 6425819.34 ( 0.00%) 6426573.21 ( 0.01%) > Hmean page_fault1-processes-8 9642169.10 ( 0.00%) 9647444.94 ( 0.05%) > Hmean page_fault1-processes-12 12167502.10 ( 0.00%) 12073323.10 * -0.77%* > Hmean page_fault1-processes-21 15636859.03 ( 0.00%) 15587449.50 * -0.32%* > Hmean page_fault1-processes-30 25157348.61 ( 0.00%) 25111707.15 * -0.18%* > Hmean page_fault1-processes-48 27694013.85 ( 0.00%) 27728568.63 ( 0.12%) > Hmean page_fault1-processes-79 25928742.64 ( 0.00%) 25920933.41 ( -0.03%) <--- > Hmean page_fault1-processes-110 25730869.75 ( 0.00%) 25695727.57 * -0.14%* > Hmean page_fault1-processes-141 25626992.42 ( 0.00%) 25675346.68 * 0.19%* > Hmean page_fault1-processes-172 25611651.35 ( 0.00%) 25650940.14 * 0.15%* > Hmean page_fault1-processes-203 25577298.75 ( 0.00%) 25584848.65 ( 0.03%) > Hmean page_fault1-processes-234 25580686.07 ( 0.00%) 25601794.52 * 0.08%* > Hmean page_fault1-processes-265 25570215.47 ( 0.00%) 25553191.25 ( -0.07%) > Hmean page_fault1-processes-296 25549488.62 ( 0.00%) 25530311.58 ( -0.08%) > Hmean page_fault1-processes-320 25555149.05 ( 0.00%) 25585059.83 ( 0.12%) > > The differences are mostly within the noise and the difference close to > $nr_cpus is negligible. > > Signed-off-by: Mel Gorman Reviewed-by: Vlastimil Babka