Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1370509imm; Wed, 23 May 2018 15:05:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoRSCenn0umHq/Qn4yQ6d4eItutlmgsTLwYsc6hjaEhOseKK56cNuW3D/IXE6Ctd9Mn188N X-Received: by 2002:a65:558c:: with SMTP id j12-v6mr3751269pgs.262.1527113140607; Wed, 23 May 2018 15:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527113140; cv=none; d=google.com; s=arc-20160816; b=TZv75eJD8hNVpFOLD93uSnAzP8Es9jFt4JDoVmkkYv1gE7TrwjFKi25G6qqo96fa19 oC8aIbK2AW/5X5g2P6vDm80TdfdHvG5v8JFE3jI/TAaRYdYPy2AOnu72syMwyU4+i1vV FQQUMupFNWnOSW3916cXM2w7FfxOeyatDgjbeZTtRlxAUFxiq+F31J49aRbAGIt6oCWk xBTPDbgXwnKIzrZQ3HS+5+X/2Ue4VxypWLlGE/EIVyng9BnNtB+fsfOla/z7Brjqbrri 5pgqWCUy8TSnKcWpa5F+9FWe9z5UTctNlKADS3SlEcsoAzttjbahG8GJcWSNYoRoJbHq 1GaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:arc-authentication-results; bh=Sg06fe9fY6v5uU8PNja/9CVS6UcWyMOtgncZ9Bpj0TU=; b=OLpuWDrfTDoaAJKs8or7a3iHaH5ApK1D/uOIQnqT4uz4oDfkiJY+FAxbpJVavAR3Fv nobVzFV1m171ZRZhvCmtDJw2zKMqNGUvmavftVkZWpGixa86CixcRJRHJyrsG5XyohVX yKBjq4MsAYf9W2/Nr/t1gL8791pTCt6hAgYO4i54I0S1JytX1Bea/56NUyUSdXqXMq4V rCYlBX2tBxU2yOwGVNXPfWTdGo+IwLf2HKIJav8/I37ksBdS/6KEcOl5s7EV+3KhRU+H VwK8ls9n+vsiH0+mtuqeY1/Kfsdew7i309l3Z3KcqWmw/AGI6/BgfomxL54qgH/IzNNX Ls9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13-v6si15478491pgs.361.2018.05.23.15.05.25; Wed, 23 May 2018 15:05:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934544AbeEWWDX (ORCPT + 99 others); Wed, 23 May 2018 18:03:23 -0400 Received: from shelob.surriel.com ([96.67.55.147]:54142 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934235AbeEWWDV (ORCPT ); Wed, 23 May 2018 18:03:21 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fLbql-0006It-HK; Wed, 23 May 2018 18:03:15 -0400 Message-ID: <1527112995.7898.31.camel@surriel.com> Subject: Re: [PATCH] bdi: Move cgroup bdi_writeback to a dedicated low concurrency workqueue From: Rik van Riel To: Tejun Heo , Jens Axboe Cc: linux-kernel@vger.kernel.org, "Paul E. McKenney" , Jan Kara , Andrew Morton , kernel-team@fb.com Date: Wed, 23 May 2018 18:03:15 -0400 In-Reply-To: <20180523175632.GO1718769@devbig577.frc2.facebook.com> References: <20180523175632.GO1718769@devbig577.frc2.facebook.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-zn/EuV8ItMEpJ2BHvQB6" X-Mailer: Evolution 3.26.6 (3.26.6-1.fc27) Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-zn/EuV8ItMEpJ2BHvQB6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2018-05-23 at 10:56 -0700, Tejun Heo wrote: > The events leading to the lockup are... >=20 > 1. A lot of cgwb_release_workfn() is queued at the same time and all > system_wq kworkers are assigned to execute them. >=20 > 2. They all end up calling synchronize_rcu_expedited(). One of them > wins and tries to perform the expedited synchronization. >=20 > 3. However, that invovles queueing rcu_exp_work to system_wq and > waiting for it. Because #1 is holding all available kworkers on > system_wq, rcu_exp_work can't be executed. cgwb_release_workfn() > is waiting for synchronize_rcu_expedited() which in turn is > waiting > for cgwb_release_workfn() to free up some of the kworkers. >=20 > We shouldn't be scheduling hundreds of cgwb_release_workfn() at the > same time. There's nothing to be gained from that. This patch > updates cgwb release path to use a dedicated percpu workqueue with > @max_active of 1. Dumb question. Does setting max_active to 1 mean that every cgwb_release_workfn() ends up forcing another RCU grace period on the whole system, while today you might have a bunch of them waiting on the same RCU grace period advance? Would it be faster to have some number (up to 16?) push RCU once, at the same time, instead of having each of them push RCU into a next grace period one after another? I may be overlooking something fundamental here, but I thought I'd at least ask the question, just in case :) --=20 All Rights Reversed. --=-zn/EuV8ItMEpJ2BHvQB6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAlsF5SMACgkQznnekoTE 3oNNTAf/f24mYIPeDX8BSiV5F/tSrZWqKXEclKoYV35FC42keiipqk7VtpZcNcwF WAYKk/HKq+mPUWMWKI0f5NOxHxVZW0ovAE9Lbb7GmH27XCyXdZzKlnR21qtB59dq sVqllL2197MiHgbXM6yoTtGaAPrMbwApLKadujGrzpUn2i91FYbZrJHI/iz09Q/7 TX9jAOaselnaHKq0AJpm9slWM7oFCir/ANLahDAHagAMzk7jRp/n/LrVdpQkzBV6 2k7Z2BL3gxBcILzS6i3NURj4JTMq6tCg8jgWKgcTgesWjA2ba8CMmZek8J2bXaEf SBgqcJ9RUi7rJQ9hUSzRtAPZna3ZnQ== =CqVK -----END PGP SIGNATURE----- --=-zn/EuV8ItMEpJ2BHvQB6--