Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2801029pxp; Mon, 14 Mar 2022 05:21:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3DtJssdqpTCTUJX8i21Z9O1Qu4d3aG/R4xOCkQC4Ca+99uT/tFwu53dK/MYbqJ8qTsk8a X-Received: by 2002:aa7:cb09:0:b0:413:2be4:c9fa with SMTP id s9-20020aa7cb09000000b004132be4c9famr20239621edt.106.1647260492225; Mon, 14 Mar 2022 05:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647260492; cv=none; d=google.com; s=arc-20160816; b=HuPIuvmDdfy3BkAbiqFnUiTvdYPxSpTJEr/5gEcen5yE3QuRmedn9yca2QsxMGy9ai XvJ4bcjjvPZuYusmCQJBdc9Xf6d+ZgMAlTZWNZg9gfwPirVd5DOnOpfwdscOPd3kd1L7 oGJZ0Q5CF/wE/JxfOWPTM2QTF7NN5BHIjlS16PmCV0sAXxaGx8XFwXb0wzcLS4pRLs/y /kkZbCKKIUcLiTOrH0p4xxRo7eTbPtwpRlu3FNnvFzwi3995b5WlSiynCddsV9kj+78F xM90cJqfznPQf7F6vVnM6jCOA+fI34G7herN+a3lAZEmZyVywZkmT/ibOfomJ7jbfONk IG2Q== 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=oZDKu+JBJDRVsjqZYqekmRzMv+/i6U7EN7Ysg+sQ8Do=; b=VGM0opsdiueX2DERy2WB2fPUQZUlmPgBpASDd3UquHvVnjLgYorW5VLSLDYkA6hhHa ua/Uvb6TsomoASWDlqgzVilBzGKixKBkcEiDLiC3AK+oH5On8TlO3DeyxcIIfL0xkaui 24vDeRekKzdxR4Gc3pM/kF2ijRLFGOpzyG6kJ2mCC91nnezdTmpBtxZGdlMPz8nUTtsh fvx3WCdz/gtyaMjiy2c3XtuoFDRqbTfsnfgfh9DMptAGpkNHJTMXjGgT9sdwAKlrU/R5 NC3TlcA9ThihpgczmHx0apJPQyASgQMvuUDhfw4ADJtXo7h0tbZIbaVbqgxCrv7puuyJ yutw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=uCIdH4Bg; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ikGXtBGX; 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 w12-20020a05640234cc00b0041663fefc70si12241792edc.22.2022.03.14.05.20.58; Mon, 14 Mar 2022 05:21:32 -0700 (PDT) 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=uCIdH4Bg; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=ikGXtBGX; 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 S237909AbiCNJKn (ORCPT + 99 others); Mon, 14 Mar 2022 05:10:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237847AbiCNJKY (ORCPT ); Mon, 14 Mar 2022 05:10:24 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18AB74163E for ; Mon, 14 Mar 2022 02:09:12 -0700 (PDT) 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-out2.suse.de (Postfix) with ESMTPS id B58D81F37E; Mon, 14 Mar 2022 09:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1647248950; 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=oZDKu+JBJDRVsjqZYqekmRzMv+/i6U7EN7Ysg+sQ8Do=; b=uCIdH4BgAQYuFlIehJjxgpckcXdbzP9TWuNWzBGP+N/RRevDvG/kHMeXZOeaCOqWUMPBlM wOXxv+fnpkWi6wmnjC5RxJ9+YiuGCKZ7XHwwtmsHVsLwXJ92sV+nAd5JMxbWrJ4Y0E8jLH z+M5f0awEFv/yEnFwo0N+oZeo+VrQWA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1647248950; 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=oZDKu+JBJDRVsjqZYqekmRzMv+/i6U7EN7Ysg+sQ8Do=; b=ikGXtBGXunHXXi0s0Q+HKW7DKieChDD1m6bmplssi6BL3UTDT5malijRsZ2nkNS2XR/t/1 wpN+37ragpwEMZCw== 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 5F77C13ADA; Mon, 14 Mar 2022 09:09:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8XeQFjYGL2K5YgAAMHmgww (envelope-from ); Mon, 14 Mar 2022 09:09:10 +0000 Message-ID: Date: Mon, 14 Mar 2022 10:09:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [mm/page_alloc] 8212a964ee: vm-scalability.throughput 30.5% improvement Content-Language: en-US To: Eric Dumazet Cc: kernel test robot , Mel Gorman , 0day robot , Michal Hocko , Shakeel Butt , Wei Xu , Greg Thelen , Hugh Dickins , David Rientjes , LKML , lkp@lists.01.org, "Huang, Ying" , "Tang, Feng" , zhengjun.xing@linux.intel.com, fengwei.yin@intel.com, Eric Dumazet , Andrew Morton , linux-mm References: <20220312154321.GC1189@xsang-OptiPlex-9020> <15307f8a-c202-75d8-1361-dae0146df734@suse.cz> <8f499c76-68cb-a2c3-01fd-c8759e2fd317@suse.cz> From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 3/13/22 22:10, Eric Dumazet wrote: > On Sun, Mar 13, 2022 at 1:29 AM Vlastimil Babka wrote: >> >> On 3/13/22 00:26, Eric Dumazet wrote: >> > On Sat, Mar 12, 2022 at 10:59 AM Vlastimil Babka wrote: >> >> >> >> On 3/12/22 16:43, kernel test robot wrote: >> >>> >> >>> >> >>> Greeting, >> >>> >> >>> FYI, we noticed a 30.5% improvement of vm-scalability.throughput due to commit: >> >>> >> >>> >> >>> commit: 8212a964ee020471104e34dce7029dec33c218a9 ("Re: [PATCH v2] mm/page_alloc: call check_new_pages() while zone spinlock is not held") >> >>> url: https://github.com/0day-ci/linux/commits/Mel-Gorman/Re-PATCH-v2-mm-page_alloc-call-check_new_pages-while-zone-spinlock-is-not-held/20220309-203504 >> >>> patch link: https://lore.kernel.org/lkml/20220309123245.GI15701@techsingularity.net >> >> >> >> Heh, that's weird. I would expect some improvement from Eric's patch, >> >> but this seems to be actually about Mel's "mm/page_alloc: check >> >> high-order pages for corruption during PCP operations" applied directly >> >> on 5.17-rc7 per the github url above. This was rather expected to make >> >> performance worse if anything, so maybe the improvement is due to some >> >> unexpected side-effect of different inlining decisions or cache alignment... >> >> >> > >> > I doubt this has anything to do with inlining or cache alignment. >> > >> > I am not familiar with the benchmark, but its name >> > (anon-w-rand-hugetlb) hints at hugetlb ? >> > >> > After Mel fix, we go over 512 'struct page' to perform sanity checks, >> > thus loading into cpu caches the 512 cache lines. >> >> Ah, that's true. >> >> > This caching is done while no lock is held. >> >> But I don't think this is. The test was AFAICS done without your patch, >> so the lock is still held in rmqueue(). And it's also held in >> rmqueue_bulk() -> check_pcp_refill(). > > Note that Mel patch touches both check_pcp_refill() and check_new_pcp() > > __rmqueue_pcplist() definitely calls check_new_pcp() while the zone > spinlock is _not_ held. Yes, but the checking from check_new_pcp() is active only with CONFIG_DEBUG_VM or enabled debug_pagealloc, which were both disabled in the robot's report. > Note that it is possible to defer calls to check_pcp_refill after the > spinlock is released. > > Untested patch: I'll check the latest posting.