Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2455947ioo; Sat, 28 May 2022 14:18:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrtDJiTXwC6Web+jxF4qDIVYoUZ6EYmz/wHiQMcjqrmHWkeqoY8aN77zbeVJGCl5lUv1Aj X-Received: by 2002:a05:6a00:27a5:b0:50d:4310:c11f with SMTP id bd37-20020a056a0027a500b0050d4310c11fmr24711916pfb.49.1653772732965; Sat, 28 May 2022 14:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653772732; cv=none; d=google.com; s=arc-20160816; b=HHCOFuX2TZ30bF0j6x+bIFc//suU/5WmbG35SOV4oIBJrAk4CBjS+mY1WfjK8xR0Su nO5PtFH/HJq1sPhb+iyhX4BlDCp2djBo2S6dxjKxNqJ2yJdSIQkW5TlvsjuM1iwZ39SP z1pUcQNZL4/BlGA6TIQGAy5dJLQ96wdic2i5xtXAu3Rwlc0vsD25zDW7odaFinxb+yG+ bFILexXXTdtEa3scTkvPNdbc+xwIaL4WrmWcQ/LY64TinuROpOgGGrVUCCcWevoGz4DJ nBTCdnwrc4DqiykuW2x+nO0Z3nuRwxFVOhmBewU7R1skwP+yD9CPJgOkbpalE5/7WI4+ X+5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=00Wa1fVCwY0jLGcFEx3Bi540Lpsa5f7Y1bfvkMjx/7c=; b=VquqaGbr86jNiyjOVMamAfQ5YZpNNZsOUetOIW0kx24xXLZHb9BQVOzSsyTVOic/iI eaN3qGFfl7qT00JE33HgtxE6o8OSllWnU8pdPcCBJxlpZFGZKY1pzzxH89uNSIZjBksX tU+HqVO5G6IfgkGmMieiRfNs2vHY7ZvXWFkS2gIDXe+qSTVWzrSG69J+4EfapJcCNCU/ l+izwqBwD9hpK17lxIik5h+gPLEzpqR/8TI7IOPtB4EOF3xNm9zTolUZp14fMr4pYfyS p7EVIhi+g4+ii1ZGS06chjclqgcYSvvrydWcbTxLtiZN9anytwCpPgy9lxSEfjuZwmsV Le7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="lMLT/8zj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c9-20020a170902724900b00161d3902fcfsi9231015pll.453.2022.05.28.14.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 14:18:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="lMLT/8zj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 984CEE27AB; Sat, 28 May 2022 14:18:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbiE1VSS (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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 > >