Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7548111rwb; Mon, 12 Dec 2022 16:36:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ItRKrQERK5ynweiCm9DtSPOEpHrtKY1OQmIxbOzK/cLvb6E5nsBkdY6L9pSJb6clFGAdP X-Received: by 2002:a05:6402:540b:b0:461:75f1:9254 with SMTP id ev11-20020a056402540b00b0046175f19254mr15650495edb.2.1670891793444; Mon, 12 Dec 2022 16:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670891793; cv=none; d=google.com; s=arc-20160816; b=hodz9D6DWP+aE42DhGZLUdbmmwlKsxxy+7+b5PqNktQHmb3bbKTkgTT3swOXm2arN0 43GLH76yxzuvkphtL8psEBpjXiXzRV1qIOjYlzohprpm7HPeyZOdXMnhA6PnV3BNCfPE /9Qmop58hMBuSZ4kqtPU925xWGWjxzGg0FJyx5aI0QYUI2zyxiW2eb/IzhjNHAuIsd+4 /pimnSNQlnzzq8kipTgVHGIfyIqdA90slcE6yZS6vEA9L2f0hD5Z4LZ42wCn5wYJWWoR vMRmUEFhnMV+EomUQEEAPksAAaKR98fdmZ2Ben8NToLm+MqwD0+a8dEpzGRfI7JXVSZW +06g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=XSSw4rDrHdkebs9yVeYoOqKNZTGifGu/wo1Yfh7rryY=; b=QbGo4Mxk9LAQQW0F+NLOpCCvKzenJKzqoEucPzJerHpmTp6vEo4wD0zMa/e9uGsh7K bNj/qZesjeO8GjFJvb2XvJEoL76R6qWmZoztguJPJ6riE4WdF3/E//SUpu/fpxp1O/1S UlxCwpdNlLAPXT/9dvd/WMGwkLfPqDn8uB/hJIICER5ELzMSaOPH2BCmQEx1KrE0+Mhd Znk7QYzP0PtS5NCtI9gKrm7ucFczwdrYhT9XO/QJ8o/AAvRYoFI76d/XuEsVQ7nVBdsb DTCZOZRnQ2heEmgGCPQ5rhKm6oonuJxo2hQ6JwG0SviCUEH08Njbe6clgPpa+nSnVoQ8 XHIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IxskA22t; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020a50ea84000000b004701d573cf6si994865edo.390.2022.12.12.16.36.15; Mon, 12 Dec 2022 16:36:33 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=IxskA22t; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233167AbiLMAYu (ORCPT + 76 others); Mon, 12 Dec 2022 19:24:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233813AbiLMAYQ (ORCPT ); Mon, 12 Dec 2022 19:24:16 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 375C71CFF6 for ; Mon, 12 Dec 2022 16:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670890912; h=from:from:reply-to:subject:subject: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=XSSw4rDrHdkebs9yVeYoOqKNZTGifGu/wo1Yfh7rryY=; b=IxskA22tiJt4XX4+4lxze3ACDfLCIlCscv36k/vPUD5ndHbrd9+6ejixDNN8j28qggHqrq ivIfC4S54YXykRwrW6DcStT43DgME9ldDuw1ShCZScocBv2caAMJmm6TStWk5OWMcM1WTh YHWaEErG7oWdC0kO4VpXsXf4GBlEBVE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-489-GEEItmPjPjSumL71UddJfg-1; Mon, 12 Dec 2022 19:21:46 -0500 X-MC-Unique: GEEItmPjPjSumL71UddJfg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2BCB385A5A6; Tue, 13 Dec 2022 00:21:45 +0000 (UTC) Received: from [10.22.11.98] (unknown [10.22.11.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3D8D492C14; Tue, 13 Dec 2022 00:21:44 +0000 (UTC) Message-ID: <1fe8b5b3-c066-649b-fa4a-07d67ed7eb17@redhat.com> Date: Mon, 12 Dec 2022 19:21:40 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH-block v2 2/3] blk-cgroup: Don't flush a blkg if destroyed Content-Language: en-US To: Tejun Heo , =?UTF-8?Q?Michal_Koutn=c3=bd?= Cc: Jens Axboe , Josef Bacik , Zefan Li , Johannes Weiner , Andrew Morton , cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Dennis Zhou (Facebook)" References: <20221211222058.2946830-1-longman@redhat.com> <20221211222058.2946830-3-longman@redhat.com> <20221212125953.GE16456@blackbody.suse.cz> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 12/12/22 17:16, Tejun Heo wrote: > On Mon, Dec 12, 2022 at 01:59:53PM +0100, Michal Koutný wrote: >> Hello. >> >> On Sun, Dec 11, 2022 at 05:20:57PM -0500, Waiman Long wrote: >>> Before commit 3b8cc6298724 ("blk-cgroup: Optimize blkcg_rstat_flush()"), >>> blkg's stats is only flushed if they are online. >> I'm not sure I follow -- css_release_work_fn/cgroup_rstat_flush may be >> called on an offlined blkcg (offlined!=released). There's no invariant >> ensuring offlined blkcg won't be flushed. (There is only current >> situation when there is no reader of io data that'd need them flushed >> [1].) >> >>> In addition, the stat flushing of blkgs in blkcg_rstat_flush() >>> includes propagating the rstat data to its parent. However, if a blkg >>> has been destroyed (offline), the validity of its parent may be >>> questionable. >> Parents won't be freed (neither offlined) before children (see >> css_killed_work_fn). It should be regularly OK to pass data into a >> parent of an offlined blkcg. >> >>> For safety, revert back to the old behavior by ignoring offline >>> blkg's. >> I don't know if this is a good reasoning. If you argue that offlined >> children needn't be taken into parent's account, then I think it's more >> efficient to exclude the offlined blkcgs from update. (With the caveat I >> have in [1].) > Yeah, I'm not sure about this patch either. Doesn't seem necessary. I wrote this patch because I am not totally sure it is safe to flush offline blkgs. Since both you and Michal don't see any problem with it. I am fine taking it out. Cheers, Longman