From: Li Lingfeng <lilingfeng@huaweicloud.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: tj@kernel.org, josef@toxicpanda.com, hch@lst.de, axboe@kernel.dk,
longman@redhat.com, ming.lei@redhat.com, cgroups@vger.kernel.org,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
yukuai1@huaweicloud.com, houtao1@huawei.com, yi.zhang@huawei.com,
yangerkun@huawei.com, yukuai3@huawei.com, lilingfeng3@huawei.com
Subject: Re: [PATCH v2] blk-cgroup: don't clear stat in blkcg_reset_stats()
Date: Tue, 22 Oct 2024 11:44:33 +0800 [thread overview]
Message-ID: <eedc01d5-42f9-39f0-25c4-340f35ee8eab@huaweicloud.com> (raw)
In-Reply-To: <migrlemuqjqff6y64o6ukfkuil6uwuarwvyg3xymfphnicznna@sy5dwhovytuz>
在 2024/8/21 23:51, Michal Koutný 写道:
> Hello.
>
> On Wed, Aug 21, 2024 at 10:07:56AM GMT, Li Lingfeng <lilingfeng@huaweicloud.com> wrote:
>> The list of root cgroup can be used by both cgroup v1 and v2 while
>> non-root cgroup can't since it must be removed before switch between
>> cgroup v1 and v2.
>> So it may has effect if the list of root used by cgroup v2 was corrupted
>> after switching to cgroup v1, and switch back to cgroup v2 to use the
>> corrupted list again.
>> However, the root cgroup will not use the list any more after commit
>> ef45fe470e1e("blk-cgroup: show global disk stats in root cgroup io.stat").
> How come? Before that patch the root file was excluded with
> CFTYPE_NOT_ON_ROOT. IOW how has that patch an effect on llist traversal?
>
> (It doesn't matter, your patch doesn't restore memset anyway.)
>
> This is the reasoning how I understand it:
>
> | The removed function clears blkg.iostat structures that is only used on
> | v2 whereas the function can only be called with v1 hierarchy attached.
> | Zeroing effect could potentially be visible root blkcg "shared" between
> | v1 and v2 but v2 actually synthesizes stats differently for root.
Yes, that's what I mean.
>> Although this has no negative effect, it is not necessary. Remove the
>> related code for cleanup. No function change.
> I'm impressed by the amount of analysis you did to potentially remove
> the unused function. If you feel like cleaning up more or sectioning,
> see also [1] or [2] for inspiration.
Thank you for your advice. I'll look at them later.
> Thanks,
> Michal
>
> [1] https://lore.kernel.org/all/20240625005906.106920-14-roman.gushchin@linux.dev/
> [2] https://lore.kernel.org/all/20240628210317.272856-1-roman.gushchin@linux.dev/
prev parent reply other threads:[~2024-10-22 3:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 2:07 Li Lingfeng
2024-08-21 15:51 ` Michal Koutný
2024-10-22 3:44 ` Li Lingfeng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eedc01d5-42f9-39f0-25c4-340f35ee8eab@huaweicloud.com \
--to=lilingfeng@huaweicloud.com \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=hch@lst.de \
--cc=houtao1@huawei.com \
--cc=josef@toxicpanda.com \
--cc=lilingfeng3@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=ming.lei@redhat.com \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®