From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECA6DC4332F for ; Tue, 13 Dec 2022 00:21:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D2308E0003; Mon, 12 Dec 2022 19:21:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 582AD8E0002; Mon, 12 Dec 2022 19:21:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47AD18E0003; Mon, 12 Dec 2022 19:21:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3761B8E0002 for ; Mon, 12 Dec 2022 19:21:52 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0A336C062D for ; Tue, 13 Dec 2022 00:21:52 +0000 (UTC) X-FDA: 80235380064.29.E2D9204 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 3BA6E140011 for ; Tue, 13 Dec 2022 00:21:49 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CPPVPlqG; spf=pass (imf09.hostedemail.com: domain of longman@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670890910; h=from:from:sender: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:dkim-signature; bh=XSSw4rDrHdkebs9yVeYoOqKNZTGifGu/wo1Yfh7rryY=; b=QAA4DpHBgscMpuVcZJvUWoiru66oDtc2Ov4SatAucHiNS+S869H0xZbWQxBD+a/HChgWBk oYtFh93e6DnoFRhL0J781tQ3eX6hjYEPjRjFZP4NpOS+2XyrCapjt9MRZawai8a9kGoPRk T5XJmEaJLBkpYR+mi33ehZoBKAQ0ULU= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CPPVPlqG; spf=pass (imf09.hostedemail.com: domain of longman@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=longman@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670890910; a=rsa-sha256; cv=none; b=NXHv9lM3+GXWzo51xbaOQ/XMkQ2t4LTZmI4MTnZP2+dvInP9Q8pdN1t0A4apS/escgRJcr spq7WePM7WSO6e4k5gA89GgnJbyTNGPPuX4dto74H1xDn1BfNJOLok3qyyBd9mhqrJtDlM DZqvnLZRBMdOfMsSfWYAqVZsjBo56DI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670890909; 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=CPPVPlqG8G9uNQXymxmIFTmIH2zR0X9rO1B9jPnGjEiwYSXSZkh+Ty7cRhu6pCt+WDQQ7z 05EtqlvNJ51nZEmvyfJsVDhr/DNt1Wq+QnMjI6zD2yobkw25DuPyUtWX/F+WbdNXrCKuzx PcH/lAQi71UUghD6OUpyE8JdFevPf5o= 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-Stat-Signature: 87iqbgnrqnmjts46b6xdknjrugbm5aki X-Rspam-User: X-Rspamd-Queue-Id: 3BA6E140011 X-Rspamd-Server: rspam06 X-HE-Tag: 1670890909-808278 X-HE-Meta: U2FsdGVkX1/PW719C5ijcS5Mz3Z7WKVou9cRfPitb4vRHZU3I9tD+MicAJAgYWnfWr0ymVBLgLWRD0M6fvddjbhnQaQVCBQ6Z9rOlinhaJJAWvmCA7zhtIbBqTeIaQKT13hXoY2DWuxALrQCEgOsy4ZWIAPD1yxaC2DjVz5V+QHyWqzMrt3B416xIVexQMloQF0WL1Wi/9U1ihya8LlNZGyYAX0hgpiIfHW1DCYY1I4POI0SpApyOh+5LFxjh8gN1B2Of05p8+37CyjErTJou3a+VynU8PK7CbD6FKiFXhBLy5Ad6rjF4nu3d1ZrxIOed3+WTwgzgrlx5Cdh7JnH2+N+tp3iY7Livdju5QV3OLBgvq2DtJSfbPi0XtdBOMcbERst91kqldTYXDYxj6NIdGv5OtWLaXI2xvwVcqQs577zPAbMrA6QYLOAOO5kVOMAycruW7MhEfvaUSr7wk8KVKKPxQ7rtgdfRVzShj+XZqWhI1NPjrJYVEbJORmDEdIoFmQzxJTG2sMRUtEtaSPB4VYRe4DiCoIfbgMShXJjoBOkr9bwB6m9LwDW4WFRDzPg/Xd2LynodAQ042R8wXiyMeU6IrWZmp0VttT9xRM2Ixp0YLU265eC7zB2FrJ1/EX3f0Eaa6kr/CDwuPTp24wsyECjHhbdyGwFP1Z8iThMRPcNdqKsBcK69SIZ8oHnnlSBrBAigxAiz9HmbI84pNCkTeCRikzV4BOr/nOFMtJPHz2lbDHftPj9CtJv9n6WgKWhOPJiS7vj1boHe19zigtmT/7kKLfACCzNuwIW+/OWoWsxBjXIOLSj6zZMnXkBdd9+a1DphkfR+hN/Ed2mIPdajAl6afH01OWHHnQoitHLwZEsr3EdF5cXTmAH1O2PFmE2 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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