mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zihan zhou <15645113830zzh@gmail.com>
To: vincent.guittot@linaro.org
Cc: 15645113830zzh@gmail.com, bsegall@google.com,
	dietmar.eggemann@arm.com, juri.lelli@redhat.com,
	linux-kernel@vger.kernel.org, mgorman@suse.de, mingo@redhat.com,
	peterz@infradead.org, rostedt@goodmis.org, vschneid@redhat.com,
	yaowenchao@jd.com, yaozhenguo@jd.com
Subject: Re: [PATCH V2] sched: Forward deadline for early tick
Date: Mon, 20 Jan 2025 15:38:59 +0800	[thread overview]
Message-ID: <20250120073857.47043-1-15645113830zzh@gmail.com> (raw)
In-Reply-To: <CAKfTPtDTPijSAGkLP3Nd3P7q2HLvVmdrLVbWQihZJWn9o=BadA@mail.gmail.com>

Thanks for your reply!

> For sure we should provide recommendation but I'm not sure it's worth
> a warning but better a documentation for user who wants to set their
> slice

> Could you create a patch that only updates sysctl_sched_base_slice
> and normalized_sysctl_sched_base_slice to 700000UL with figures and
> explanation

Thank you for your suggestion! Adding a warning is not worth it. I will
submit a new patch soon, which changes the default value of slice
and add the code comments about this change. I am not sure if I
should change the files in the Documentation directory. If I should,
I will move the content in the comments to the Documentation directory.

> sysctl_sched_base_slice is updated by update_sysctl() for each cpu
> hotplug so you can't really set it directly
> 
> You can then try a 2nd patch which updates it with debugfs but I'm not
> convince at all by this benefit because it should update the
> normalized_sysctl_sched_base_slice which is really meaningless for
> user

There is indeed a big problem with this, and I overlooked it. Thank you
for your corrections. I actually intended to add a numerical range
requirement to slice through sched_base_slice_fops, because I noticed that
syscalls has a range requirement (NSEC_PER_MSEC/10, NSEC_PER_MSEC*100)
for modifying slice. However, it seems that the existence of this range is
not important.

> > diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c
> > index ff0e5ab4e37c..d0f90d61398f 100644
> > --- a/kernel/sched/syscalls.c
> > +++ b/kernel/sched/syscalls.c
> > @@ -309,6 +309,10 @@ static void __setscheduler_params(struct task_struct *p,
> >                         p->se.slice = clamp_t(u64, attr->sched_runtime,
> >                                               NSEC_PER_MSEC/10,   /* HZ=1000 * 10 */
> >                                               NSEC_PER_MSEC*100); /* HZ=100  / 10 */
> > +
> > +                       if (p->se.slice % TICK_NSEC == 0)
> > +                               pr_warn("It is not recommended to set the slice to an integer multiple of the tick\n");
> 
> You should better add documentation than a warning
> 
> Also, this code has moved in fair.c now

I'm a bit confused here. Has this code been moved from syscalls.c to
fair.c file? I haven't seen this change on the master kernel.
Is there any other code repository?


  reply	other threads:[~2025-01-20  7:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-25  5:40 zihan zhou
2025-01-02 10:00 ` Vincent Guittot
2025-01-09  5:48   ` zihan zhou
2025-01-14 10:16     ` Vincent Guittot
2025-01-16  8:12       ` zihan zhou
2025-01-17  8:18         ` Vincent Guittot
2025-01-20  7:38           ` zihan zhou [this message]
2025-01-20 11:42             ` Honglei Wang
2025-01-20 13:39               ` Vincent Guittot
2025-01-21  2:46                 ` zihan zhou
2025-01-17 11:38 [PATCH V1] sched/debug: change "runnable tasks" to "Tasks on cpu" on sched debug Peter Zijlstra
2025-01-20  7:44 ` [PATCH V2] sched: Forward deadline for early tick zihan zhou
2025-01-20  7:55   ` zihan zhou

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=20250120073857.47043-1-15645113830zzh@gmail.com \
    --to=15645113830zzh@gmail.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 \
    --cc=yaowenchao@jd.com \
    --cc=yaozhenguo@jd.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®