Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp40473iof; Wed, 8 Jun 2022 14:43:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD1Vl44PglhGt7C6MrM/xPNn3lV+4m4ukeXIKX0/QNv09mz1JIcBrcXtTTLDxM//yuApiC X-Received: by 2002:a17:906:600c:b0:6fe:9204:959b with SMTP id o12-20020a170906600c00b006fe9204959bmr33563309ejj.417.1654724609128; Wed, 08 Jun 2022 14:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654724609; cv=none; d=google.com; s=arc-20160816; b=FcTEAiXATZ42WAFSlnreXaBnfZrvBJnOUjGpKa8OCmFDgZjkShitKRvHS9wAx9C99g OMnZfMVsWn12cGl2PLmorDtFVc57r8WH857rD4M1ZceAcbhl0WNbWWx3fXyojEHXMsOd gEmsCfuyaSDfBah3z2gseRZx6wdo0vFK9t06s4Bb/AE/OsxvgbTN+hFQ88eMIVPLNtdo ug25K5FYVI1lk/kd+wTiR+O/ghVNWHkdeiTWdMcfUJbuGWIaB1ZnlucWssuAdJ1ypKgi s882kN/3jHyf68SDkEdOXm4YyFDks0OQvueeniENu2IwkhRD+Mo+djbTNQsOmts35O+B Y6eQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cvLTeRgE922dttN+/SnWY6He1Q8u4Sfu7cqwMi2p5dQ=; b=pXhMVB2Ea3RniMG2OVE8dqH9D5ppWydXww5IibJ0zzXWL8bDYV7IjSCDO8MOTHsaKb QUf3R9Uwq4cHPOuciqkCCBb/u1Fv+tOyqXs32GJD/+9+FP3vJDFquD96J8RHOQ/EyRw0 nCk2nvAgs4C941e5Fl/+5v21g6WYBOfI5V5n1TEVnnHJKEsPhNj67IK1D7nUUHL2pJNZ d6u4vZBKuEVdtmdhgx/bAdACBlJpV6QxMAWTyNjxvAHwRNS7Xz7+X5Bf8mSn6gS1FuZZ ukMQWlL5V3bNS6WW/nMof6LvVThl+GiSAoQtWga2ggypZwNnIMsPtWLusq/Y86AakS3e TyIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=aCK4ctri; 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 z3-20020a05640235c300b0042dbd57bb65si1000151edc.154.2022.06.08.14.43.04; Wed, 08 Jun 2022 14:43:29 -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=aCK4ctri; 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 S236024AbiFHVNF (ORCPT + 99 others); Wed, 8 Jun 2022 17:13:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236269AbiFHVM7 (ORCPT ); Wed, 8 Jun 2022 17:12:59 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6668B403614; Wed, 8 Jun 2022 14:12:57 -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-out1.suse.de (Postfix) with ESMTPS id DB52921CBD; Wed, 8 Jun 2022 21:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1654722775; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cvLTeRgE922dttN+/SnWY6He1Q8u4Sfu7cqwMi2p5dQ=; b=aCK4ctriVdhI1i3ubrX52jvQCh+DlkWCXQwz5PScudBWPXCHGxJrvto5HQYoCNJJdY83dW DUTyiUUKa36htw8fg4sJdvRBZx9IwaySmfPEWkDsVBxynKg7tKEFOp1PcNVkXw8gLkzhY3 4QWesCmAvxZAF3XCs+b/cwVycwLiKYA= 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 973B413A15; Wed, 8 Jun 2022 21:12:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id F3R+I9cQoWLSCgAAMHmgww (envelope-from ); Wed, 08 Jun 2022 21:12:55 +0000 Date: Wed, 8 Jun 2022 23:12:53 +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=us-ascii Content-Disposition: inline In-Reply-To: <506eaa3d-be84-c51e-3252-2979847054fe@redhat.com> 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 02:16:45PM -0400, Waiman Long wrote: > I have thought about that. It can be done as a follow-up patch to add a > sentinel version into llist and use that instead. Of course, I can also > update this patchset to include that. Nothing against the current form, really just an idea for a followup or prequel. > Your change may not be enough since there could be update after the flush > which will pin the blkg and hence blkcg. Wouldn't that mean submitting a bio from offlined blkcg? blkg_tryget_closest() should prevent that. > 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. > > Maybe bundle the lhead list maintenace with cgroup_rstat_updated() under > > cgroup_subsys_on_dfl()? The stats can be read on v1 anyway. > > I don't quite understand here. The change is not specific to v1 or v2. What > do you mean by the stat is readable on v1? Apologies, the critical "not" fell out. ...can not be read on v1... IOW, the rstat data are only kept when attached to v2 hierarchy, so the list of active devices needn't be maintained on v1. Michal