From: "Yajun Deng" <yajun.deng@linux.dev>
To: "Valentin Schneider" <vschneid@redhat.com>,
mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] sched/rt: fix the case where sched_rt_period_us is negative
Date: Tue, 07 Jun 2022 01:25:48 +0000 [thread overview]
Message-ID: <b4d4313342a10afc7cda2574d37fdb38@linux.dev> (raw)
In-Reply-To: <xhsmhh75o16rs.mognet@vschneid.remote.csb>
Ping.
May 18, 2022 12:08 AM, "Valentin Schneider" <vschneid@redhat.com> wrote:
> On 17/05/22 14:29, Yajun Deng wrote:
>
>> The proc_dointvec() is for integer, but sysctl_sched_rt_period is a
>> unsigned integer, proc_dointvec() would convert negative number into
>> positive number. So both proc_dointvec() and sched_rt_global_validate()
>> aren't return error even if we set a negative number.
>>
>> Use proc_dointvec_minmax() instead of proc_dointvec() and use extra1
>> limit the minimum value for sched_rt_period_us/sched_rt_runtime_us.
>>
>> Make sysctl_sched_rt_period integer to match proc_dointvec_minmax().
>
> How about:
>
> While sysctl_sched_rt_runtime is a signed integer and
> sysctl_sched_rt_period is unsigned, both are handled in sched_rt_handler()
> via proc_dointvec(), so negative inputs can be fed into
> sysctl_sched_rt_period. However, per sched-rt-group.rst:
>
> * sched_rt_period_us takes values from 1 to INT_MAX.
> * sched_rt_runtime_us takes values from -1 to (INT_MAX - 1).
>
> Use proc_dointvec_minmax() instead of proc_dointvec() and use the .extra1
> parameter to enforce a minimum value.
>
> Make sysctl_sched_rt_period a signed integer as this matches the expected
> upper boundary and the expected type of proc_dointvec_minmax().
>
>> v4:
>> - Make sysctl_sched_rt_period integer (Valentin Schneider)
>
> Even if v3 was bogus, it's good not to skip it in the version log.
> Also, the version logs should be after the "---" marker line:
>
> Documentation/process/submitting-patches.rt
> """
> Please put this information **after** the ``---`` line which separates
> the changelog from the rest of the patch. The version information is
> not part of the changelog which gets committed to the git tree. It is
> additional information for the reviewers. If it's placed above the
> commit tags, it needs manual interaction to remove it. If it is below
> the separator line, it gets automatically stripped off when applying the
> patch
> """
>
>> v2:
>> - Remove sched_rr_timeslice_ms related changes (Valentin Schneider)
>>
>> Fixes: d0b27fa77854 ("sched: rt-group: synchonised bandwidth period")
>> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
>
> Reviewed-by: Valentin Schneider <vschneid@redhat.com>
prev parent reply other threads:[~2022-06-07 1:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-17 6:29 [PATCH v4] sched/rt: fix the case where sched_rt_period_us is negative Yajun Deng
2022-05-17 16:08 ` Valentin Schneider
2022-06-07 1:25 ` Yajun Deng [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=b4d4313342a10afc7cda2574d37fdb38@linux.dev \
--to=yajun.deng@linux.dev \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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