Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2909508iog; Mon, 27 Jun 2022 05:34:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uc5udlOLFTYV/3HFc9f3DQiSEw1JYdJ12p/HsrqUG/UPBHDfWqNus+0W7jxrBbS15hnw4M X-Received: by 2002:a17:90a:e503:b0:1ec:84b2:6404 with SMTP id t3-20020a17090ae50300b001ec84b26404mr20828997pjy.169.1656333252362; Mon, 27 Jun 2022 05:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333252; cv=none; d=google.com; s=arc-20160816; b=pjsIbPT+tjnPbFCa/recidciDJmDghe9+8ojYHOCnHdtiZRTjGwANL0KCQ0K4lth9z GH1scnoAMTZdFck0PGYlv8rWWZNxg678h+Keo1z5Ze2ypi76E0cXuu8ni13hdrmhus5c MFQIaA43bBc1NqxixZhj5Evp8/nhXCFyB/FfVFOhsS3NGJMizIthKPMFptZCibDShq36 2eLt4Bj2lke3u+CzjLk9z4Ltl8a7Zcm1x/OgZARbNSky8GfeYv6+4zwEkI74Cj+7SMw3 WOEgQIV0Uv3hKD2W/kGdlXfAUWycbzp1vNNbxGxJaS7ycLttfjCyau2r6AP0DUAqJoo2 9JZA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=e5I2Tee/g1Ds3nJ307kalq+gLJgbgDTae09iL/Q0AMI=; b=FxZTo56nskSKW41+tWZsUn3UGOmtwklg+a23knA1JLIWrfcq0UmYdwAH/p9B2afRS1 yxM1JqQktVzuqGFR4Bfui/gK2iIUzbrENK8WE0Pvr95Ji1+93fFZCoRpcUmmBkc3hQj3 LUJ4j64E7EOWTwmxyxwlXCY2OWLDTx5sTiYua7VwXA9JTDedGl++7AHWWQsTeuHv/aDz d5zy0Bu+YagYn7BV6ompmbGZqHodofX+qiU7CvtOdoldCBhwKTiJvXBUEqrsE3V27Azx /yILYnqBEgbZQLRI2llKNch+n5H0ytim2+kBdqOVUXkAZI6fpppJ1CWxCsmyJroFLkiR beBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2EYLagDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020a63bf41000000b0040ca1fee045si14163710pgo.224.2022.06.27.05.33.59; Mon, 27 Jun 2022 05:34:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2EYLagDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239293AbiF0L7a (ORCPT + 99 others); Mon, 27 Jun 2022 07:59:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238773AbiF0Lwg (ORCPT ); Mon, 27 Jun 2022 07:52:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D773DE82; Mon, 27 Jun 2022 04:45:36 -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 dfw.source.kernel.org (Postfix) with ESMTPS id ECA86610A0; Mon, 27 Jun 2022 11:45:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D03F4C341C7; Mon, 27 Jun 2022 11:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330335; bh=qQsK/KFw7+vQ8Q7idBFmYFRhYdTXO8Kc12ms4xSFZYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2EYLagDGa7OH7gUFFFY5N0jba1VjObtIORYr2o6l4ZrsSYZDM/drbW0D7wbF8wXuc wf7EleAYKz/f+RoxfBaJYrED77OHzCkyVoNLVuTR/7aBtPOeKqMhQanj4TryxsCjKi REKlAUKqeWBKGxLGHwDTmCs6Qoq2/MzjN848cgIA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcelo Tosatti , Stefan Wahren , Michael Larabel , Sebastian Andrzej Siewior , Nicolas Saenz Julienne , Borislav Petkov , Minchan Kim , Matthew Wilcox , Mel Gorman , Juri Lelli , Thomas Gleixner , "Paul E. McKenney" , Phil Elwell , Andrew Morton Subject: [PATCH 5.18 162/181] mm: lru_cache_disable: use synchronize_rcu_expedited Date: Mon, 27 Jun 2022 13:22:15 +0200 Message-Id: <20220627111949.383620931@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Marcelo Tosatti commit 31733463372e8d88ea54bfa1e35178aad9b2ffd2 upstream. commit ff042f4a9b050 ("mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu") replaced lru_cache_disable's usage of work queues with synchronize_rcu. Some users reported large performance regressions due to this commit, for example: https://lore.kernel.org/all/20220521234616.GO1790663@paulmck-ThinkPad-P17-Gen-1/T/ Switching to synchronize_rcu_expedited fixes the problem. Link: https://lkml.kernel.org/r/YpToHCmnx/HEcVyR@fuller.cnet Fixes: ff042f4a9b050 ("mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu") Signed-off-by: Marcelo Tosatti Tested-by: Stefan Wahren Tested-by: Michael Larabel Cc: Sebastian Andrzej Siewior Cc: Nicolas Saenz Julienne Cc: Borislav Petkov Cc: Minchan Kim Cc: Matthew Wilcox Cc: Mel Gorman Cc: Juri Lelli Cc: Thomas Gleixner Cc: Paul E. McKenney Cc: Phil Elwell Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- mm/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swap.c b/mm/swap.c index f3922a96b2e9..034bb24879a3 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -881,7 +881,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 -- 2.36.1