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 6D0C3C433EF for ; Sat, 28 May 2022 21:18:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F2B28D0003; Sat, 28 May 2022 17:18:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77CEE8D0001; Sat, 28 May 2022 17:18:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 63FB98D0003; Sat, 28 May 2022 17:18:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 4E6388D0001 for ; Sat, 28 May 2022 17:18:13 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 19AEBEE1 for ; Sat, 28 May 2022 21:18:13 +0000 (UTC) X-FDA: 79516414866.04.6A62301 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf25.hostedemail.com (Postfix) with ESMTP id 28A5BA0041 for ; Sat, 28 May 2022 21:17:41 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 48FE260C0D; Sat, 28 May 2022 21:18:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38B0FC34119; Sat, 28 May 2022 21:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1653772690; bh=bdVK0S6unup8QwUoNJ+TWIngI+wu05UsfjpqzIce53A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lMLT/8zjNL8UW586SsXRgRCzdCRdDW+Pgc7yf5SBDZd8NhO2AxWRrwbG9s6n0bKFz nzztLSCvLtnXhPbPy70TgxScg6PtHExb+/ImrzJmXWMGh3OhDMgHQhtOg+ZFZlyk/z 5+enSryXaJvV3F5j0zL3YHa30Qf/h78R6ehBO9BE= Date: Sat, 28 May 2022 14:18:09 -0700 From: Andrew Morton To: Marcelo Tosatti Cc: Borislav Petkov , michael@michaellarabel.com, 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" Subject: Re: [patch v5] mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu Message-Id: <20220528141809.732788db257253396462c79e@linux-foundation.org> In-Reply-To: References: <20220304163554.8872fe5d5a9d634f7a2884f5@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="lMLT/8zj"; dmarc=none; spf=pass (imf25.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 28A5BA0041 X-Stat-Signature: oyhuutag7cbo7u9mzcr8q8zqqeih3c3f X-HE-Tag: 1653772661-37216 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 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? > 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 > >