From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, Paul Turner <pjt@google.com>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH tip] sched/trivial: Remove cfs bandwidth period check in tg_set_cfs_period()
Date: Mon, 12 Dec 2011 14:05:16 +0100 [thread overview]
Message-ID: <1323695116.13285.14.camel@twins> (raw)
In-Reply-To: <20111210135925.GA14593@linux.vnet.ibm.com>
On Sat, 2011-12-10 at 19:29 +0530, Kamalesh Babulal wrote:
> sched: Remove cfs bandwidth period check in tg_set_cfs_period()
>
> Remove cfs bandwidth period check from tg_set_cfs_period.
> Invalid bandwidth period's lower/upper limits are denoted
> by min_cfs_quota_period/max_cfs_quota_period repsectively,
> and are checked against valid period in tg_set_cfs_bandwidth().
>
> Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
> --
> kernel/sched/core.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 3c5b21e..57cf3ab 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -7689,9 +7689,6 @@ int tg_set_cfs_period(struct task_group *tg, long cfs_period_us)
> period = (u64)cfs_period_us * NSEC_PER_USEC;
> quota = tg->cfs_bandwidth.quota;
>
> - if (period <= 0)
> - return -EINVAL;
> -
> return tg_set_cfs_bandwidth(tg, period, quota);
> }
There's a number of funnies here... it checks an unsigned value for <=
0, which suggests it wanted to check cfs_period_us, which is a signed
value.
tg_set_cfs_bandwidth() has the same problem, at that point everything is
unsigned and all below zero checks will fail.
Please reconsider things and see if this patch is still the right one.
next prev parent reply other threads:[~2011-12-12 13:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-10 13:59 [PATCH tip] sched/trivial: Remove cfs bandwidth period check in tg_set_cfs_period() Kamalesh Babulal
2011-12-12 13:05 ` Peter Zijlstra [this message]
2011-12-13 12:40 ` Paul Turner
2011-12-13 12:53 ` Peter Zijlstra
2011-12-21 11:43 ` [tip:sched/core] sched: " tip-bot for Kamalesh Babulal
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=1323695116.13285.14.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=kamalesh@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=pjt@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