Received: by 2002:a05:6830:16d2:b0:61c:ac69:ca1b with SMTP id l18csp2117442otr; Mon, 25 Jul 2022 07:44:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uUCowMepXYsXBwKnADtEdvKVlqwmklGA6cDqqbeXWZExUNfbU2+S29pdcGTCPzWOoZDHO3 X-Received: by 2002:a05:6402:414b:b0:43b:6b1a:c230 with SMTP id x11-20020a056402414b00b0043b6b1ac230mr13831434eda.42.1658760261444; Mon, 25 Jul 2022 07:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658760261; cv=none; d=google.com; s=arc-20160816; b=kVvCSt161JRri8yOvPHTGpdO9lX1WYi3xgCM11u9DEZzzEVuuz0kJ4C/m7IXyKArUJ Dcr8QEQn/F1mye1FRld+48dR9gQvMobEMRS/QmoRSOjryWRyV13AoNMwY2dJ82ZSZXeh a7VSVS6lp5/XZY7d+tIqCLWbf8NCLiTAbX2xiTxbE9GPWjJG95Gav6evGRkD8Z35kucz ooBTmtfHTu25ZI4X6saLYeZO+42BydVLBeoMRyiiCDQZWKhGURJhsPnFZlBm+tfKwjiO 4eQN85ivhAfkutDIwh9n807AWMeYjgFXlMd17+Em1IVeVafMXik/0+VhSQxJuXFOAc1P sxJQ== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=xLAEsAsPfjjPTUKHJkyVRb7BF+mtejzgRm/tCYpkIPc=; b=xpVFSiM8I/oZdTrrpFg/RagrlduBGTJXR07L98m/ECrDDV1RBgfUD2VIqyOt7wyHlU LXEgOl1ifLutbbm8IL6pshU3ZseimcieNvGt5WG48I7ujY26Hml1oSAXiIvGtqGejyZz blXG4FrIV67KXgyBGNzaHHt+5eu0Le0E0+6pC9sRqt7ty739oWnpZcg/0bUFQmENmgQU EXCvamEo+O9iAYqU5y7WztxC3EXgeKTZtVCLUX70Mjxf8pb11Soww1ahUDkCN6PVhF5o ecyX96qz+ovh9loAK9S94qgj1K149GnTEX79DdZpXYNm12VLCxcmwWdANMCdwmun/swU l17Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AkOKY3UM; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a170906974300b0072ef52514f6si14787014ejy.629.2022.07.25.07.43.56; Mon, 25 Jul 2022 07:44:21 -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=@kernel.org header.s=k20201202 header.b=AkOKY3UM; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235419AbiGYORA (ORCPT + 99 others); Mon, 25 Jul 2022 10:17:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232199AbiGYOQ6 (ORCPT ); Mon, 25 Jul 2022 10:16:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C774DF12; Mon, 25 Jul 2022 07:16:57 -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 E203DB80ED0; Mon, 25 Jul 2022 14:16:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98914C341C6; Mon, 25 Jul 2022 14:16:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658758614; bh=p9/gFb1902RLnmreUeNFAHcbKgrOvbu9N0D0jG7+uBE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AkOKY3UMzdkfecaitmz6IXmVhF5eNwiBrQE/mS4uiWu2IL70SzLVLCisC10ETcVtI enMoVGVUa76JLUafYZ7b+snwHVt6YHktjb+0COvfAyK44Jc/bmBGa0ivJ5KLrmz4jY RuCK5I8BIFEWanDSM1IHJImxMAj3y5K+Z1ulenmactWnPMMG2huJGlONVz0agoXahA /KtXIk8smhLeMBRh2brDlTf56bx9iirwtnFhOOkLn/Crgy7zEFiAxUXXQuzv62r3z3 mJRjANXJft/74cvd9pymtRgZBano2iJxOsLU02p72Ymcsgjc3Bewp86Gs2F1WP+dEi m2LhCzQRgnEOQ== Date: Mon, 25 Jul 2022 16:16:49 +0200 From: Christian Brauner To: Tejun Heo Cc: Michal =?utf-8?Q?Koutn=C3=BD?= , Peter Zijlstra , John Stultz , Dmitry Shmidt , Oleg Nesterov , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH RESEND 3/3 cgroup/for-5.20] cgroup: Make !percpu threadgroup_rwsem operations optional Message-ID: <20220725141649.ou7tsntv4xnqtbmc@wittgenstein> References: 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=-7.7 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 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 On Sat, Jul 23, 2022 at 04:28:28AM -1000, Tejun Heo wrote: > 3942a9bd7b58 ("locking, rcu, cgroup: Avoid synchronize_sched() in > __cgroup_procs_write()") disabled percpu operations on threadgroup_rwsem > because the impiled synchronize_rcu() on write locking was pushing up the > latencies too much for android which constantly moves processes between > cgroups. > > This makes the hotter paths - fork and exit - slower as they're always > forced into the slow path. There is no reason to force this on everyone > especially given that more common static usage pattern can now completely > avoid write-locking the rwsem. Write-locking is elided when turning on and > off controllers on empty sub-trees and CLONE_INTO_CGROUP enables seeding a > cgroup without grabbing the rwsem. > > Restore the default percpu operations and introduce the mount option > "favordynmods" and config option CGROUP_FAVOR_DYNMODS for users who need > lower latencies for the dynamic operations. > > Signed-off-by: Tejun Heo > Cc: Christian Brauner > Cc: Michal Koutný > Cc: Peter Zijlstra > Cc: John Stultz > Cc: Dmitry Shmidt > Cc: Oleg Nesterov > --- Seems sane, Acked-by: Christian Brauner (Microsoft)