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 30DE7C433F5 for ; Sat, 21 May 2022 23:46:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 81CE58D0001; Sat, 21 May 2022 19:46:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CD738D0003; Sat, 21 May 2022 19:46:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 69E658D0001; Sat, 21 May 2022 19:46:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 576EB8D0001 for ; Sat, 21 May 2022 19:46:20 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 2F6AD120814 for ; Sat, 21 May 2022 23:46:20 +0000 (UTC) X-FDA: 79491386520.14.1C7B931 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf31.hostedemail.com (Postfix) with ESMTP id 7979020028 for ; Sat, 21 May 2022 23:45:47 +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 ams.source.kernel.org (Postfix) with ESMTPS id E704AB8077E; Sat, 21 May 2022 23:46:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7088EC385A9; Sat, 21 May 2022 23:46:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653176776; bh=ZvwJRsmyPHVu6xMhRrUXxcn+midJndmIlbuFTRbahrQ=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=XNscoE2xqCQNZy+sn84caROY4Pxn5GkYOAAbzVz5+lbHEEml6WVMqBNgkiou73QwX Lt7PM5eAxLu5xtIqrEwYC3h4rtDFGAWkntf56M+7gocu+qFwcz85a7NpmqDl2nDnJk IDRdGAKKBpu4Pmk4csxXGDhkU3axPoqKq1AySe+y9IZHoNb3U/ojJBfFrqYlqp7SF4 xWRohg+uDIJrnkQApg+mcNZC/wLCcQI8lM+yAh2v89GwMdmw+5kV0mvCOvEWeaWVh2 N49aNlCAZrVJ6xkaTpiC9dx5IVqXnjbLCWroX7xKJyHK/4RdzRJF9Z40CeUtNt7vEc w4TejJZKiszbg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 0C41A5C034F; Sat, 21 May 2022 16:46:16 -0700 (PDT) Date: Sat, 21 May 2022 16:46:16 -0700 From: "Paul E. McKenney" To: Stefan Wahren Cc: Marcelo Tosatti , Andrew Morton , Nicolas Saenz Julienne , Borislav Petkov , Minchan Kim , Matthew Wilcox , Mel Gorman , Juri Lelli , Thomas Gleixner , Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linux ARM , Phil Elwell , regressions@lists.linux.dev, riel@surriel.com, viro@zeniv.linux.org.uk Subject: Re: vchiq: Performance regression since 5.18-rc1 Message-ID: <20220521234616.GO1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <77d6d498-7dd9-03eb-60f2-d7e682bb1b20@i2se.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <77d6d498-7dd9-03eb-60f2-d7e682bb1b20@i2se.com> X-Rspam-User: X-Rspamd-Queue-Id: 7979020028 X-Stat-Signature: wnoaoymi15rx1aa9wndd46qxjh4t5x36 Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XNscoE2x; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf31.hostedemail.com: domain of "SRS0=oTzJ=V5=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=oTzJ=V5=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" X-Rspamd-Server: rspam04 X-HE-Tag: 1653176747-50629 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 Sun, May 22, 2022 at 01:22:00AM +0200, Stefan Wahren wrote: > Hi, > > while testing the staging/vc04_services/interface/vchiq_arm driver with my > Raspberry Pi 3 B+ (multi_v7_defconfig) i noticed a huge performance > regression since [ff042f4a9b050895a42cae893cc01fa2ca81b95c] mm: > lru_cache_disable: replace work queue synchronization with synchronize_rcu > > Usually i run "vchiq_test -f 1" to see the driver is still working [1]. > > Before commit: > > real    0m1,500s > user    0m0,068s > sys    0m0,846s > > After commit: > > real    7m11,449s > user    0m2,049s > sys    0m0,023s > > Best regards > > [1] - https://github.com/raspberrypi/userland Please feel free to try the patch shown below. Or the pair of patches from Rik here: https://lore.kernel.org/lkml/20220218183114.2867528-2-riel@surriel.com/ https://lore.kernel.org/lkml/20220218183114.2867528-3-riel@surriel.com/ There is work ongoing to produce something better, but ongoing slowly. Especially my part of that work. Thanx, Paul ------------------------------------------------------------------------ >From paulmck@kernel.org Mon Feb 14 11:05:49 2022 Date: Mon, 14 Feb 2022 11:05:49 -0800 From: "Paul E. McKenney" To: clm@fb.com Cc: riel@surriel.com, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH RFC fs/namespace] Make kern_unmount() use synchronize_rcu_expedited() Message-ID: <20220214190549.GA2815154@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Status: RO Content-Length: 1036 Lines: 32 Experimental. Not for inclusion. Yet, anyway. Freeing large numbers of namespaces in quick succession can result in a bottleneck on the synchronize_rcu() invoked from kern_unmount(). This patch applies the synchronize_rcu_expedited() hammer to allow further testing and fault isolation. Hey, at least there was no need to change the comment! ;-) Cc: Alexander Viro Cc: Cc: Not-yet-signed-off-by: Paul E. McKenney --- namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs/namespace.c index 40b994a29e90d..79c50ad0ade5b 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -4389,7 +4389,7 @@ void kern_unmount(struct vfsmount *mnt) /* release long term mount so mount point can be released */ if (!IS_ERR_OR_NULL(mnt)) { real_mount(mnt)->mnt_ns = NULL; - synchronize_rcu(); /* yecchhh... */ + synchronize_rcu_expedited(); /* yecchhh... */ mntput(mnt); } }