Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2836347imm; Thu, 24 May 2018 17:13:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp18uupZVSS1h5nJS/W8bOI5RyTtnrlr1Yx3fPcv0wyBAker6i57cYOm++r3+M15cX/MVw6 X-Received: by 2002:a65:60d1:: with SMTP id r17-v6mr137806pgv.410.1527207204678; Thu, 24 May 2018 17:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527207204; cv=none; d=google.com; s=arc-20160816; b=yPNfa5bQ19epqitTKS+FSNGztPAzeewUMHvpr1iWudX4JrNTQZCaz3fMHSZaJCg8Y5 +NcWVSfykSJcuMx3yF8memeYJq2JNrNTdZdRtw3iD5+4x/c1EgG522PomXyNx/CGbhjb gP/TssXdIj9VfOIcoUGbkbmdjZ+0T4PHbkua+cKLuGkX5nkmHpZRLYcKFuy7WL5MOIMz H9rRuafs+NHgV6KlrHgk8Xpri7KiYJwVF7YOndu/yl/kLqee8yzdQT0U/WZRvgC8EubN O/5OPTI8pzFJCy731EACnRwOzH2vE1AZD4ejO8xJtGwphuZCqnBoIe4Qm0Xhl0UDc1cH Tqkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=HYCsr34mFRv9FSYom+DVtCaPVCTv2IgoHK6ANLvJSRs=; b=xSRFOgK3YZNjF97eoZsRzoBqhMg0inru0dTvuy/RtFhWCl0APEv/2MVjavtGJLH/OM 2tJB/YdQ79pg1KxO2C6aBiL9RvcPJ9696GgY1KNqaiGHFncXrYgJ2gt2AyHCvjKrEifS aWY9JK1cejXZVQq/cSQzE1bNpcJhVI4K4D5DDcrLE3b+yUXWEGx7z+kb0Y1sAkx8+jnp +k3nvMiWC37Qz0k+giIlSRsuVOyPgRzHxeD60kkReeFhoGWJxf+M6aqctQmZ583ZHG2z ui5hiiHzVc0PylmZxDs7pADGQylm4XuV3PIBzo75u3otzfWX2qTSVuUh112Dq1Zi5FmN Wf8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=okiZiELW; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az5-v6si22702733plb.369.2018.05.24.17.13.10; Thu, 24 May 2018 17:13:24 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=okiZiELW; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967305AbeEXOAO (ORCPT + 99 others); Thu, 24 May 2018 10:00:14 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:36564 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965515AbeEXOAN (ORCPT ); Thu, 24 May 2018 10:00:13 -0400 Received: by mail-yw0-f193.google.com with SMTP id v68-v6so575219ywd.3 for ; Thu, 24 May 2018 07:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HYCsr34mFRv9FSYom+DVtCaPVCTv2IgoHK6ANLvJSRs=; b=okiZiELWiEHIfy4xbU8OOMN+pzpN9G0Qih7RdAk9/KlmpZT3RmcNeb3sdXka6gqI5G DW0tli8sylsR1kwDysl+ZllvyM/v61JCQ7/oeaPLJXuu4D4XQRhvrkqLFryZQS/TS2lq np/k6PDYmWhBf34KRx+wuKHQGvs8AeNw6wnzhwFHwhI7MBwSZbmJXJ+sZpUJHpvweC3G EztGNfuIYwJDhaOvW+icwKZO1EYyly8ZDGYJdlGtzkqXql3xaxkB8/wy6NSpW3NJSQ7+ 4DMAGc5Xv6XGkJrJTD5ZNtqknRXbqx+Cpd0pDQ74LEvNm4N4nDsQAtYW5cJxfRM9YuoG QqHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=HYCsr34mFRv9FSYom+DVtCaPVCTv2IgoHK6ANLvJSRs=; b=CmHbJInBtOaTOnEJ/spw2owb/jUqPbPq4Vh34AZyulQStqSILzYzVUmTUgAX5ACv7h 4wFlQrQtqUhfgA8PlU8svSHnwuSWv8OfjUiSBPAv1mG2SPhLF1/t1yO3IRpQc/McFxFA yjrmZTvNu8/kf3gXDd/AQJ1uqFHZvgkRnaXkfVWZH7V8j31OUyKhExdjaiI+t2quzcqp OrvRxRyvSX3JuUzmCpl80/8xOO8ADN5TcbohwuYfFJD2mEJmIpmCXRB6gVgWcmSYCOkK iw3FHERghv2VdLBwmVaY2h1zay/tpMcHQfpGks6cNrvToHji4Shx3uhGpS3flKklDpbm Lzkg== X-Gm-Message-State: ALKqPwdT5s+F6EBesnNpGJdYBqaQfT0ud9gxMem247FL+t7qLvlIRE6B rVwbdVhblHuwNFeQSArQ1a7fQB4F X-Received: by 2002:a0d:d8c4:: with SMTP id a187-v6mr3913341ywe.379.1527170412467; Thu, 24 May 2018 07:00:12 -0700 (PDT) Received: from localhost ([2620:10d:c091:200::2:c477]) by smtp.gmail.com with ESMTPSA id p17-v6sm9456993ywe.100.2018.05.24.07.00.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 07:00:11 -0700 (PDT) Date: Thu, 24 May 2018 07:00:09 -0700 From: Tejun Heo To: Jan Kara Cc: Jens Axboe , linux-kernel@vger.kernel.org, "Paul E. McKenney" , Jan Kara , Andrew Morton , kernel-team@fb.com Subject: Re: [PATCH] bdi: Move cgroup bdi_writeback to a dedicated low concurrency workqueue Message-ID: <20180524140009.GB1351649@devbig577.frc2.facebook.com> References: <20180523175632.GO1718769@devbig577.frc2.facebook.com> <20180524101900.m5vqd74rwaqw2pap@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180524101900.m5vqd74rwaqw2pap@quack2.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Jan. On Thu, May 24, 2018 at 12:19:00PM +0200, Jan Kara wrote: > > We're periodically seeing close to 256 kworkers getting stuck with the > > following stack trace and overtime the entire system gets stuck. > > OK, but that means that you have to have 256 block devices, don't you? As It'd be a product of the number of cgroups being deleted at the same time and the number of block devices they were accessing. With multiple loop devices and multiple cgroup removals, it doesn't seem too difficult to hit. It's rare but we do see it happening repeatedly in one of the setups. > we have a bdi per device and we call synchronize_rcu_expedited() only when > unregistering bdi (and the corresponding request queue must be gone at that > point as well as that's otherwise holding a reference). Am I understanding > the situation correctly? Yeah, I think so. > > 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. > > As Rik wrote, some paralelism is good to reduce number of forced grace > periods so raising this to 16 is good. I was thinking whether we could not > batch rcu grace periods in some explicit way but that would be difficult to > do. Agreed, already sent a patch to increase @max_active to 16. > But thinking a bit more about this, if we made bdi RCU freed, we could just > avoid the synchronize_rcu_expedited() in bdi_remove_from_list() altogether. > The uses of bdi list are pretty limited and everybody ends up testing > WB_registered bit before doing anything anyway... What do you think? > > Other than that you can add: > > Reviewed-by: Jan Kara Thanks. -- tejun