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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9187AC433F5 for ; Sat, 28 May 2022 21:18:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbiE1VSS (ORCPT ); Sat, 28 May 2022 17:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiE1VSO (ORCPT ); Sat, 28 May 2022 17:18:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95B1EBF55 for ; Sat, 28 May 2022 14:18:13 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 05CB5B8091D for ; Sat, 28 May 2022 21:18:12 +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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > >