All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/deadline: Use proc_douintvec_minmax() limit minimum value
@ 2022-05-13  2:41 Yajun Deng
  2022-06-07  1:26 ` Yajun Deng
  2022-06-07  7:55 ` Daniel Bristot de Oliveira
  0 siblings, 2 replies; 5+ messages in thread
From: Yajun Deng @ 2022-05-13  2:41 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid
  Cc: linux-kernel, Yajun Deng

proc_dointvec() is not applicable for unsigned integer, use
proc_douintvec_minmax() limit minimum value.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
 kernel/sched/deadline.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 85cd62e0dddd..4d2a780c6f73 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -30,14 +30,16 @@ static struct ctl_table sched_dl_sysctls[] = {
 		.data           = &sysctl_sched_dl_period_max,
 		.maxlen         = sizeof(unsigned int),
 		.mode           = 0644,
-		.proc_handler   = proc_dointvec,
+		.proc_handler   = proc_douintvec_minmax,
+		.extra1         = (void *)&sysctl_sched_dl_period_min,
 	},
 	{
 		.procname       = "sched_deadline_period_min_us",
 		.data           = &sysctl_sched_dl_period_min,
 		.maxlen         = sizeof(unsigned int),
 		.mode           = 0644,
-		.proc_handler   = proc_dointvec,
+		.proc_handler   = proc_douintvec_minmax,
+		.extra2         = (void *)&sysctl_sched_dl_period_max,
 	},
 	{}
 };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched/deadline: Use proc_douintvec_minmax() limit minimum value
  2022-05-13  2:41 [PATCH] sched/deadline: Use proc_douintvec_minmax() limit minimum value Yajun Deng
@ 2022-06-07  1:26 ` Yajun Deng
  2022-06-07  7:55 ` Daniel Bristot de Oliveira
  1 sibling, 0 replies; 5+ messages in thread
From: Yajun Deng @ 2022-06-07  1:26 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot, vschneid
  Cc: linux-kernel

Ping.



May 13, 2022 10:41 AM, "Yajun Deng" <yajun.deng@linux.dev> wrote:

> proc_dointvec() is not applicable for unsigned integer, use
> proc_douintvec_minmax() limit minimum value.
> 
> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
> ---
> kernel/sched/deadline.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 85cd62e0dddd..4d2a780c6f73 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -30,14 +30,16 @@ static struct ctl_table sched_dl_sysctls[] = {
> .data = &sysctl_sched_dl_period_max,
> .maxlen = sizeof(unsigned int),
> .mode = 0644,
> - .proc_handler = proc_dointvec,
> + .proc_handler = proc_douintvec_minmax,
> + .extra1 = (void *)&sysctl_sched_dl_period_min,
> },
> {
> .procname = "sched_deadline_period_min_us",
> .data = &sysctl_sched_dl_period_min,
> .maxlen = sizeof(unsigned int),
> .mode = 0644,
> - .proc_handler = proc_dointvec,
> + .proc_handler = proc_douintvec_minmax,
> + .extra2 = (void *)&sysctl_sched_dl_period_max,
> },
> {}
> };
> -- 
> 2.25.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched/deadline: Use proc_douintvec_minmax() limit minimum value
  2022-05-13  2:41 [PATCH] sched/deadline: Use proc_douintvec_minmax() limit minimum value Yajun Deng
  2022-06-07  1:26 ` Yajun Deng
@ 2022-06-07  7:55 ` Daniel Bristot de Oliveira
  2022-06-07  8:35   ` Yajun Deng
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Bristot de Oliveira @ 2022-06-07  7:55 UTC (permalink / raw)
  To: Yajun Deng
  Cc: linux-kernel, mingo, peterz, juri.lelli, dietmar.eggemann,
	bsegall, vschneid, rostedt, mgorman, vincent.guittot

Hi Yajun

On 5/13/22 04:41, Yajun Deng wrote:
> proc_dointvec() is not applicable for unsigned integer, use
> proc_douintvec_minmax() limit minimum value.

I understand your patch, but your log message is somehow incomplete.

Could you expand on that, showing the problem using an example, and then how you
see it fixed?

Also, could you please add the Fixes: tag so this patch can land on stable trees?

-- Daniel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched/deadline: Use proc_douintvec_minmax() limit minimum value
  2022-06-07  7:55 ` Daniel Bristot de Oliveira
@ 2022-06-07  8:35   ` Yajun Deng
  2022-06-07  8:45     ` Daniel Bristot de Oliveira
  0 siblings, 1 reply; 5+ messages in thread
From: Yajun Deng @ 2022-06-07  8:35 UTC (permalink / raw)
  To: Daniel Bristot de Oliveira
  Cc: linux-kernel, mingo, peterz, juri.lelli, dietmar.eggemann,
	bsegall, vschneid, rostedt, mgorman, vincent.guittot

June 7, 2022 3:55 PM, "Daniel Bristot de Oliveira" <bristot@redhat.com> wrote:

> Hi Yajun
> 
> On 5/13/22 04:41, Yajun Deng wrote:
> 
>> proc_dointvec() is not applicable for unsigned integer, use
>> proc_douintvec_minmax() limit minimum value.
> 
> I understand your patch, but your log message is somehow incomplete.
> 
> Could you expand on that, showing the problem using an example, and then how you
> see it fixed?
> 

This patch isn't a fix. It's just an optimization for match data and proc_handler in struct ctl_table.

> Also, could you please add the Fixes: tag so this patch can land on stable trees?
> 

This statement 'if (period < min || period > max)' in __checkparam_dl() will work fine even if there hasn't this patch.
So this patch may not need land on stable trees.

> -- Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched/deadline: Use proc_douintvec_minmax() limit minimum value
  2022-06-07  8:35   ` Yajun Deng
@ 2022-06-07  8:45     ` Daniel Bristot de Oliveira
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Bristot de Oliveira @ 2022-06-07  8:45 UTC (permalink / raw)
  To: Yajun Deng
  Cc: linux-kernel, mingo, peterz, juri.lelli, dietmar.eggemann,
	bsegall, vschneid, rostedt, mgorman, vincent.guittot

On 6/7/22 10:35, Yajun Deng wrote:
> June 7, 2022 3:55 PM, "Daniel Bristot de Oliveira" <bristot@redhat.com> wrote:
> 
>> Hi Yajun
>>
>> On 5/13/22 04:41, Yajun Deng wrote:
>>
>>> proc_dointvec() is not applicable for unsigned integer, use
>>> proc_douintvec_minmax() limit minimum value.
>> I understand your patch, but your log message is somehow incomplete.
>>
>> Could you expand on that, showing the problem using an example, and then how you
>> see it fixed?
>>
> This patch isn't a fix. It's just an optimization for match data and proc_handler in struct ctl_table.
> 
>> Also, could you please add the Fixes: tag so this patch can land on stable trees?
>>
> This statement 'if (period < min || period > max)' in __checkparam_dl() will work fine even if there hasn't this patch.
> So this patch may not need land on stable trees.
> 

Good, so you already know how to improve your log message.

-- Daniel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-07  8:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-13  2:41 [PATCH] sched/deadline: Use proc_douintvec_minmax() limit minimum value Yajun Deng
2022-06-07  1:26 ` Yajun Deng
2022-06-07  7:55 ` Daniel Bristot de Oliveira
2022-06-07  8:35   ` Yajun Deng
2022-06-07  8:45     ` Daniel Bristot de Oliveira

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.