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 5C7C3C433F5 for ; Mon, 14 Mar 2022 09:09:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87D2C8D0005; Mon, 14 Mar 2022 05:09:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 82DAA8D0001; Mon, 14 Mar 2022 05:09:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F4B88D0005; Mon, 14 Mar 2022 05:09:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 603DC8D0001 for ; Mon, 14 Mar 2022 05:09:13 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 1E15B60BC0 for ; Mon, 14 Mar 2022 09:09:13 +0000 (UTC) X-FDA: 79242417786.14.7FF10AC Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf18.hostedemail.com (Postfix) with ESMTP id 4B89E1C002A for ; Mon, 14 Mar 2022 09:09:12 +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-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-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 4B89E1C002A X-Stat-Signature: o7aw6aiiqsrrcmb9uos8yr88i18mnwsm Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=uCIdH4Bg; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=ikGXtBGX; dmarc=none; spf=pass (imf18.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspam-User: X-HE-Tag: 1647248952-208511 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 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.