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 369AAC433EF for ; Sun, 29 May 2022 00:48:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 595DA8D0003; Sat, 28 May 2022 20:48:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 545598D0001; Sat, 28 May 2022 20:48:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 432408D0003; Sat, 28 May 2022 20:48:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 353598D0001 for ; Sat, 28 May 2022 20:48:19 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 01AF760820 for ; Sun, 29 May 2022 00:48:18 +0000 (UTC) X-FDA: 79516944318.02.1AD853D Received: from rome.phoronix.com (rome.phoronix.com [192.211.48.82]) by imf06.hostedemail.com (Postfix) with ESMTP id CD7A0180034 for ; Sun, 29 May 2022 00:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=michaellarabel.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:References:Cc:To:From:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Bv4ctk2wOB3a6MaSBmKnYZVDVHvcziEuha9CgdDBEWs=; b=DJanTn/QOTp6PI2o6esHyJGtc2 yP9SoySPi2FsnqDd9GAO7fD2hMlitgIfEmis8cWeXBOTitfUWMhA33eM2T53eqV1zAdwuqahAmQRG do3diXomYRhwtLbWoyvHGixQsx1UNZbB0Qe4X4CJ5JXvbPqwhsgMKFFJjjHbcHBH9CZpIN7isdynQ +CpYhkJyYMx7Y8BNlB0MeNjWvgvMATkNq9fnMN2QcJBS3YBzSe44XALQ/9hQM8amXRItdPqEDnoRo 3tVOHJAXuLWoRRt6Q9OmpXFlw2lOxbCid/FL6RgvyrAY6Z/dVC4fbRF/Fa7MMh3+5QNiSaPN4nwcq H/N+s3pw==; Received: from c-73-176-63-28.hsd1.in.comcast.net ([73.176.63.28]:44420 helo=[192.168.1.42]) by rome.phoronix.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.95) (envelope-from ) id 1nv76N-0001v0-2P; Sat, 28 May 2022 20:48:14 -0400 Message-ID: <0ce05ce7-1a00-82df-f37a-bf7f9e216504@MichaelLarabel.com> Date: Sat, 28 May 2022 19:48:06 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [patch v5] mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu Content-Language: en-CA From: Michael Larabel To: Andrew Morton , Marcelo Tosatti Cc: Borislav Petkov , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Minchan Kim , Matthew Wilcox , Mel Gorman , Nicolas Saenz Julienne , Juri Lelli , Thomas Gleixner , Sebastian Andrzej Siewior , "Paul E. McKenney" References: <20220304163554.8872fe5d5a9d634f7a2884f5@linux-foundation.org> <20220528141809.732788db257253396462c79e@linux-foundation.org> <134065a4-0446-bbbc-fca8-59f32798cf08@MichaelLarabel.com> In-Reply-To: <134065a4-0446-bbbc-fca8-59f32798cf08@MichaelLarabel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - rome.phoronix.com X-AntiAbuse: Original Domain - kvack.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - MichaelLarabel.com X-Get-Message-Sender-Via: rome.phoronix.com: authenticated_id: michael@michaellarabel.com X-Authenticated-Sender: rome.phoronix.com: michael@michaellarabel.com X-Source: X-Source-Args: X-Source-Dir: Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=michaellarabel.com header.s=default header.b="DJanTn/Q"; dmarc=pass (policy=reject) header.from=michaellarabel.com; spf=pass (imf06.hostedemail.com: domain of Michael@MichaelLarabel.com designates 192.211.48.82 as permitted sender) smtp.mailfrom=Michael@MichaelLarabel.com X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: CD7A0180034 X-Stat-Signature: 8h9udo5k1xhd47ybo1hswzfy6jkhtm4p X-HE-Tag: 1653785294-722925 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 5/28/22 17:54, Michael Larabel wrote: > On 5/28/22 16:18, Andrew Morton wrote: >> On Thu, 28 Apr 2022 15:00:11 -0300 Marcelo Tosatti >> wrote: >> >>> On Thu, Mar 31, 2022 at 03:52:45PM +0200, Borislav Petkov wrote: >>>> On Thu, Mar 10, 2022 at 10:22:12AM -0300, Marcelo Tosatti wrote: >>> ... >>> >>>> Someone pointed me at this: >>>> >>>> https://www.phoronix.com/scan.php?page=news_item&px=Linux-518-Stress-NUMA-Goes-Boom >>>> >>>> >>>> which says this one causes a performance regression with stress-ng's >>>> NUMA test... >>> Michael, >>> >>> This is probably do_migrate_pages that is taking too long due to >>> synchronize_rcu(). >>> >>> Switching to synchronize_rcu_expedited() should probably fix it... >>> Can you give it a try, please? >> I guess not. >> >> Is anyone else able to demonstrate a stress-ng performance regression >> due to ff042f4a9b0508?  And if so, are they able to try Marcelo's >> one-liner? > > > Apologies I don't believe I got the email previously (or if it ended > up in spam or otherwise overlooked) so just noticed this thread now... > > I have the system around and will work on verifying it can reproduce > still and can then test the patch, should be able to get it tomorrow. > > Thanks and sorry about the delay. > > Michael > > Had a chance to look at it today still. I was able to reproduce the regression still on that 5950X system going from v5.17 to v5.18 (using newer stress-ng benchmark and other system changes since the prior tests). Confirmed it also still showed slower as of today's Git. I can confirm with Marcelo's patch below that the stress-ng NUMA performance is back to the v5.17 level of performance (actually, faster) and certainly not like what I was seeing on v5.18 or Git to this point. So all seems to be good with that one-liner for the stress-ng NUMA test case. All the system details and results for those interested is documented @ https://openbenchmarking.org/result/2205284-PTS-NUMAREGR17 but basically amounts to:     Stress-NG 0.14     Test: NUMA     Bogo Ops/s > Higher Is Better     v5.17: 412.88     v5.18: 49.33     20220528 Git: 49.66     20220528 Git + sched-rcu-exped patch: 468.81 Apologies again about the delay / not seeing the email thread earlier. Thanks, Michael Tested-by: Michael Larabel > >> >>> diff --git a/mm/swap.c b/mm/swap.c >>> index bceff0cb559c..04a8bbf9817a 100644 >>> --- a/mm/swap.c >>> +++ b/mm/swap.c >>> @@ -879,7 +879,7 @@ void lru_cache_disable(void) >>>        * lru_disable_count = 0 will have exited the critical >>>        * section when synchronize_rcu() returns. >>>        */ >>> -    synchronize_rcu(); >>> +    synchronize_rcu_expedited(); >>>   #ifdef CONFIG_SMP >>>       __lru_add_drain_all(true); >>>   #else >>> >>>