Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6026222pxb; Mon, 14 Feb 2022 13:25:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhWN0Yw5BVzdosLENXVSu2/jb8Yc2V9AuALD094RdgN4o+/Ug5x0n9jEH8nhUEC6sIRuqm X-Received: by 2002:a17:90a:e507:: with SMTP id t7mr645600pjy.131.1644873918086; Mon, 14 Feb 2022 13:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644873918; cv=none; d=google.com; s=arc-20160816; b=vaLz7Q88AFfGIU0inPbzWUdDOCnKm93FVzIZen4TAWs8oz+3dRIgI5J+oLyRD/Mxud Uo6+ahIu2CNIwv/EHkPGqfV38mSJtHJV6Sz9br6Y7g6iqEQPRZ2c7rvWs960b+FWiRbM Kr4mIeIj8xRtW9LxgQq3114mItPlZ7GRzAM6TZkZJtq8pFpWxKyjf1H+3UIo515c4/O3 fC/35ctdQuLhDUjrlec36IoU8/xUWsgheHoeCutDvr7XmUg8q487LjbkFJq/wpw5KXIp P80ozmfvTEehkpP/HSZSv67NbgwXyIsHAYkJo9LjjXvPrf12szVrN1UQHtvnMaO2LfXd kt1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=rKRUYia45fxVNl6at4wi/FDTaicflUsitPV4r9u1SIo=; b=equxGOqRDZKnvB5/ujbPb7Uoe7GYIHGGDEgFy3IDquMM7XrkObBS+B//5QXHcON5y3 WIZMpLUGiKsZE6A2Wl1rYuTXViV/lnGzZPuJAPZNmdrICnDGhq8NMOfwdW3cOPlvUQ+T ivMiELqVyDir7e91p46+KFQatyvCiSt/lH9ALtX8QMj26fEbIICRhNDuOzQKbxYTH6Kx Ep5wa8hfCUPh8Ug6xZbD9aEYhzJ45y2bJgdb0OFbOLZOgfI5sQGoN3l4SmwZJwJUdrJJ 9M8qtKpeDnNo78qjgo03kiwox7jZD1zg0BNZmZdX5CvyHlSyGqL5cliZZIWiYEZjbNS+ vRdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dRO6ISvN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lj7si10202155pjb.54.2022.02.14.13.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 13:25:18 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dRO6ISvN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C924C158E9E; Mon, 14 Feb 2022 12:41:29 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229740AbiBNUBt (ORCPT + 99 others); Mon, 14 Feb 2022 15:01:49 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:55202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbiBNUBr (ORCPT ); Mon, 14 Feb 2022 15:01:47 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D02214AC8A; Mon, 14 Feb 2022 12:01:31 -0800 (PST) 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 D74396115F; Mon, 14 Feb 2022 19:44:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45256C340E9; Mon, 14 Feb 2022 19:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644867881; bh=jxOYiEgPWektpf5sVKihUYWrVFKV0HAUXvsI0SeCjrY=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=dRO6ISvNTvfNGuc219bHukN3m5ziudzHyjjyHNwbAp4XOotmfmGfAXli6ng7PYyXw sWFG+c35AJQTFFKLSn16Q72apFPWfzeJXWsQyTXV7GyHj8qifh+iwVgoIe7y+4bcaZ C4bUJcxCZOTRc7HOgbfLuXmMJPQ8OIhG/Q4nSmrwdYCMNgOtpMccwOrgM7lKNHD2iv 6gZJt+JBJF5KoXLO6RjkRA63GJYzgtGC8cNjK8jvEhqNrd+CPsDtswo6JHWrXVfYSs TynDNMULeQidgTK9AYSBvvyLAz4SEcRhTUPb159geRvTv7KbG53RWrWL7vnSo4qH9K IlIVMKhhf+ZMQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 024035C0388; Mon, 14 Feb 2022 11:44:40 -0800 (PST) Date: Mon, 14 Feb 2022 11:44:40 -0800 From: "Paul E. McKenney" To: Chris Mason Cc: Giuseppe Scrivano , "riel@surriel.com" , "viro@zeniv.linux.org.uk" , "linux-kernel@vger.kernel.org" , linux-fsdevel , Kernel Team Subject: Re: [PATCH RFC fs/namespace] Make kern_unmount() use synchronize_rcu_expedited() Message-ID: <20220214194440.GZ4285@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220214190549.GA2815154@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 Mon, Feb 14, 2022 at 07:26:49PM +0000, Chris Mason wrote: > > > > On Feb 14, 2022, at 2:05 PM, Paul E. McKenney wrote: > > > > 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! ;-) > > > > I don’t think this will be fast enough. I think the problem is that commit e1eb26fa62d04ec0955432be1aa8722a97cb52e7 is putting all of the ipc namespace frees onto a list, and every free includes one call to synchronize_rcu() > > The end result is that we can create new namespaces much much faster than we can free them, and eventually we run out. I found this while debugging clone() returning ENOSPC because create_ipc_ns() was returning ENOSPC. Moving from synchronize_rcu() to synchronize_rcu_expedited() does buy you at least an order of magnitude. But yes, it should be possible to get rid of all but one call per batch, which would be better. Maybe a bit more complicated, but probably not that much. Let me see what I can come up with. If this is an emergency, I still suggest trying the patch as a short-term workaround. Thanx, Paul