Re: [PATCH] sched: Warn on long periods of pending need_resched

2021-03-22 Thread Josh Don
On Fri, Mar 19, 2021 at 2:02 AM Mel Gorman wrote: > > Default disabling and hidden behind a static branch would be useful > because the majority of users are not going to know what to do about > a need_resched warning and the sysctl is not documented. As Ingo said, > SCHED_DEBUG is enabled by

Re: [PATCH] sched: Warn on long periods of pending need_resched

2021-03-19 Thread Mel Gorman
On Wed, Mar 17, 2021 at 05:06:31PM -0700, Josh Don wrote: > On Wed, Mar 17, 2021 at 1:25 AM Ingo Molnar wrote: > > > > * Josh Don wrote: > > > > > If resched_latency_warn_ms is set to the default value, only one warning > > > will be produced per boot. > > > > Looks like a value hack, should

Re: [PATCH] sched: Warn on long periods of pending need_resched

2021-03-17 Thread Josh Don
On Wed, Mar 17, 2021 at 1:31 AM Ingo Molnar wrote: > > > * Josh Don wrote: > > > +static inline u64 resched_latency_check(struct rq *rq) > > +{ > > + int latency_warn_ms = READ_ONCE(sysctl_resched_latency_warn_ms); > > + bool warn_only_once = (latency_warn_ms == > >

Re: [PATCH] sched: Warn on long periods of pending need_resched

2021-03-17 Thread Josh Don
On Wed, Mar 17, 2021 at 1:25 AM Ingo Molnar wrote: > > * Josh Don wrote: > > > If resched_latency_warn_ms is set to the default value, only one warning > > will be produced per boot. > > Looks like a value hack, should probably be a separate flag, > defaulting to warn-once. Agreed, done. > >

Re: [PATCH] sched: Warn on long periods of pending need_resched

2021-03-17 Thread Ingo Molnar
* Josh Don wrote: > +static inline u64 resched_latency_check(struct rq *rq) > +{ > + int latency_warn_ms = READ_ONCE(sysctl_resched_latency_warn_ms); > + bool warn_only_once = (latency_warn_ms == > RESCHED_DEFAULT_WARN_LATENCY_MS); > + u64 need_resched_latency, now = rq_clock(rq);

Re: [PATCH] sched: Warn on long periods of pending need_resched

2021-03-17 Thread Ingo Molnar
* Josh Don wrote: > From: Paul Turner > > CPU scheduler marks need_resched flag to signal a schedule() on a > particular CPU. But, schedule() may not happen immediately in cases > where the current task is executing in the kernel mode (no > preemption state) for extended periods of time. >

[PATCH] sched: Warn on long periods of pending need_resched

2021-03-16 Thread Josh Don
From: Paul Turner CPU scheduler marks need_resched flag to signal a schedule() on a particular CPU. But, schedule() may not happen immediately in cases where the current task is executing in the kernel mode (no preemption state) for extended periods of time. This patch adds a warn_on if