Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp95859iof; Wed, 8 Jun 2022 16:12:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTTkDoAuHbGqKI2DLQ1Yd3sp+ArLS0OnLxCtdhLiJ3qCE0dbrmjxLIb/8ORbIjhaSrrHUf X-Received: by 2002:a17:90a:c385:b0:1e3:50ed:e4 with SMTP id h5-20020a17090ac38500b001e350ed00e4mr335891pjt.127.1654729948369; Wed, 08 Jun 2022 16:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654729948; cv=none; d=google.com; s=arc-20160816; b=zI1YZZavwXnMUAAumtaE0j5CALT3moJCKyYPC6R1lvtRf/dWKlVnHCq0aRldQBF84S MDMMhMKbUmvrjAFCriKdCLgRjIfZsHmFJybRRT3H/EKCZpG/fs04OPqxxPu+UWLHo2te Jki8YVl33ZplRqcdcEoKT6PlOsdGv1S+HMIZOF7pFwcxP0GGVASlwWhAvyoUU7fcELHC nIqBb012ZFabjiYkY7dr33pAbkc/80xP2k7H+hI+wax7TZOHqiX7poMHT7f9Rmjt1dLL OnD601JsoruVYBN47UGYqvPDyRSNd6Ux8gRq6hGJPkF7QYlRK4qoRSXrsJ1x/km1oORj +cvA== 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=bYRBaqQ5xfDUzDMhvL/gENcLA6nTCJt7le5LzsPSniY=; b=om0QgzUObD1G8yXW7q7bQNut/nu1BtHY/RVGbyfI6LyqHlQMnoFG6yR9HzXF357MDJ P9g9fNtljTInE8dR9o+OOTHAX2czbdyWTmf5IHPDpjxV9/7FB+vZi0Y8J52RkPzZ1BsI QqfVHa/6sfAzDyeTJb75jmws5pBUPhoK2RysCqbH+xK+EOvvwNhxjnqH2o08f7d4HpPD 954WguYaoycvUDeWMQoc9q5OfvLfEHp6Wk/hI8u9Jr/VYf1AJYY2Z+EXn4YYqZoiAcOR g600sx575NjiDtJHCESx1GRfrPx5axXvK2U3NkB5218Yb1KOU9wB8Aq16jH/cBoECbe5 FTLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=E8LMadkm; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a72-20020a63904b000000b003fe462f815csi2210099pge.657.2022.06.08.16.12.14; Wed, 08 Jun 2022 16:12:28 -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=@suse.com header.s=susede1 header.b=E8LMadkm; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235966AbiFHWOW (ORCPT + 99 others); Wed, 8 Jun 2022 18:14:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiFHWOT (ORCPT ); Wed, 8 Jun 2022 18:14:19 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20A5B60D0; Wed, 8 Jun 2022 15:14:18 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D1FB61FD42; Wed, 8 Jun 2022 22:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1654726456; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bYRBaqQ5xfDUzDMhvL/gENcLA6nTCJt7le5LzsPSniY=; b=E8LMadkm3oV0PagrJYsbb9CJD02ZCJKLnfI+SV3wWkspNytEU+mEt9e0Xfr8NDYsFmKi1k D0IIgWsaHyT4g/EnsJ4cTeMnDvFPy7xV3TgWjpVp9blE6TuD1CCF4okKm/Q7cb2YPuJpLw RtRxhJxH2wDE05ScRVzlUNeWWaswivo= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9C2B113AD9; Wed, 8 Jun 2022 22:14:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Lzm/JDgfoWINHQAAMHmgww (envelope-from ); Wed, 08 Jun 2022 22:14:16 +0000 Date: Thu, 9 Jun 2022 00:14:14 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Waiman Long Cc: Tejun Heo , Jens Axboe , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Ming Lei Subject: Re: [PATCH v6 3/3] blk-cgroup: Optimize blkcg_rstat_flush() Message-ID: References: <20220602192020.166940-1-longman@redhat.com> <20220602192020.166940-4-longman@redhat.com> <20220608165732.GB19399@blackbody.suse.cz> <506eaa3d-be84-c51e-3252-2979847054fe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Wed, Jun 08, 2022 at 11:12:55PM +0200, Michal Koutn? wrote: > Wouldn't that mean submitting a bio from offlined blkcg? > blkg_tryget_closest() should prevent that. Self-correction -- no, forgot blkg_tryget_closest() gets any non-zero reference, not just a live one (percpu_ref_tryget_live()), furthermore, I can see that offlined blkcg may still issue writeback bios for instance. > > I guess one possible solution may be to abandon the llist and revert > > back to list iteration when offline. I need to think a bit more about > > that. Since blkcg stats are only used for io.stat of an online blkcg, the update may be skipped on an offlined blkcg. (Which of course breaks when something starts to depend on the stats of an offlined blkcg.) Michal