From: Johannes Weiner <hannes@cmpxchg.org>
To: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
surenb@google.com, brauner@kernel.org, chris@chrisdown.name
Subject: Re: [PATCH v2 3/3] sched/psi: allow unprivileged polling of N*2s period
Date: Thu, 23 Mar 2023 11:09:39 -0400 [thread overview]
Message-ID: <20230323150939.GA737760@cmpxchg.org> (raw)
In-Reply-To: <20230323103350.40569-4-cerasuolodomenico@gmail.com>
On Thu, Mar 23, 2023 at 11:33:50AM +0100, Domenico Cerasuolo wrote:
> @@ -151,6 +151,14 @@ struct psi_trigger {
>
> /* Deferred event(s) from previous ratelimit window */
> bool pending_event;
> +
> + /* Used to differentiate destruction action*/
> + enum psi_aggregators aggregator;
> +};
> +
> +struct trigger_info {
> + struct list_head triggers;
> + u32 nr_triggers[NR_PSI_STATES - 1];
> };
>
> struct psi_group {
> @@ -186,8 +194,7 @@ struct psi_group {
> struct mutex trigger_lock;
>
> /* Configured polling triggers */
> - struct list_head triggers;
> - u32 nr_triggers[NR_PSI_STATES - 1];
> + struct trigger_info trig_info[NR_PSI_AGGREGATORS];
> u32 poll_states;
> u64 poll_min_period;
Thanks for trying out this variant, but I think this is grouping up
unrelated things, and that makes the code more difficult to understand
and maintan.
The *only* thing that's shared between those two is the
update_triggers() part. trig_info[PSI_AVGS] doesn't use trigger_lock.
It also doesn't use poll_task, poll_wait, poll_wakeup, poll_scheduled,
poll_min_period, polling_next_update and polling_until. All these
things are specific to the rt polling thread.
The rename in the previous version is a bit churny, but it's justified
in order to keep unrelated things separate / make it obvious which
parts belong together, and who is reading and writing which fields.
So my vote would be on the previous version.
next prev parent reply other threads:[~2023-03-23 15:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 10:33 [PATCH v2 0/3] sched/psi: Allow unprivileged PSI polling Domenico Cerasuolo
2023-03-23 10:33 ` [PATCH v2 1/3] sched/psi: rearrange polling code in preparation Domenico Cerasuolo
2023-03-23 10:33 ` [PATCH v2 2/3] sched/psi: extract update_triggers side effect Domenico Cerasuolo
2023-03-23 10:33 ` [PATCH v2 3/3] sched/psi: allow unprivileged polling of N*2s period Domenico Cerasuolo
2023-03-23 15:09 ` Johannes Weiner [this message]
2023-03-23 16:43 ` Suren Baghdasaryan
2023-03-23 17:40 ` Johannes Weiner
2023-03-23 16:55 ` Suren Baghdasaryan
2023-03-23 17:44 ` Johannes Weiner
2023-03-23 18:07 ` Suren Baghdasaryan
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=20230323150939.GA737760@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=brauner@kernel.org \
--cc=cerasuolodomenico@gmail.com \
--cc=chris@chrisdown.name \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=surenb@google.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