linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <frederic@kernel.org>,
	rafael@kernel.org, daniel.lezcano@linaro.org,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	len.brown@intel.com, Thomas Gleixner <tglx@linutronix.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [RFC/RFT PATCH 1/2] sched/core: Check and schedule ksoftirq
Date: Mon, 09 Jan 2023 18:33:37 -0800	[thread overview]
Message-ID: <cc9bd410208fb05fcfa32345a609fb1c6cde35d0.camel@linux.intel.com> (raw)
In-Reply-To: <Y6ImigCet+RXzds/@hirez.programming.kicks-ass.net>

On Tue, 2022-12-20 at 22:18 +0100, Peter Zijlstra wrote:
> On Tue, Dec 20, 2022 at 09:51:09PM +0100, Peter Zijlstra wrote:
> > On Mon, Dec 19, 2022 at 02:54:55PM -0800, srinivas pandruvada
> > wrote:
> > 
> > > But after ksoftirqd_run_end(), which will renable local irq, this
> > > may
> > > further cause more soft irq pending. Here RCU soft irq entry
> > > continues
> > 
> > Right you are.. what about if we spell the idle.c thing like so
> > instead?
> > 
> > Then we repeat the softirq thing every time we drop out of the idle
> > loop
> > for a reschedule.
> 
> Uff, that obviously can't work because we already have preemption
> disabled here, this needs a bit more work. I think it's possible to
> re-arrange things a bit.
Didn't work.
Also when __do_softirq returns, softirq can be pending again.  I think
if local_softirq_pending(), we can break do_idle() loop.

Thanks,
Srinivas

> 
> I'll try and have a look tomorrow, but the kids have their xmas play
> at
> school so who knows what I'll get done.
> 
> > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
> > index f26ab2675f7d..6dce49813bcc 100644
> > --- a/kernel/sched/idle.c
> > +++ b/kernel/sched/idle.c
> > @@ -381,8 +381,13 @@ void play_idle_precise(u64 duration_ns, u64
> > latency_ns)
> >         hrtimer_start(&it.timer, ns_to_ktime(duration_ns),
> >                       HRTIMER_MODE_REL_PINNED_HARD);
> >  
> > -       while (!READ_ONCE(it.done))
> > +       while (!READ_ONCE(it.done)) {
> > +               rt_mutex_lock(&per_cpu(ksoftirq_lock, cpu));
> > +               __run_ksoftirqd(smp_processor_id());
> > +               rt_mutex_unlock(&per_cpu(ksoftirq_lock, cpu));
> > +
> >                 do_idle();
> > +       }
> >  
> >         cpuidle_use_deepest_state(0);
> >         current->flags &= ~PF_IDLE;


  reply	other threads:[~2023-01-10  2:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 18:42 [RFC/RFT PATCH 0/2] Forced idle and Non-RCU local softirq pending Srinivas Pandruvada
2022-12-15 18:42 ` [RFC/RFT PATCH 1/2] sched/core: Check and schedule ksoftirq Srinivas Pandruvada
2022-12-16 11:19   ` Peter Zijlstra
2022-12-16 16:58     ` srinivas pandruvada
2022-12-16 22:07     ` Frederic Weisbecker
2022-12-19 11:33       ` Peter Zijlstra
2022-12-19 11:46         ` Sebastian Andrzej Siewior
2022-12-19 14:56           ` Peter Zijlstra
2022-12-19 22:54         ` srinivas pandruvada
2022-12-20 20:51           ` Peter Zijlstra
2022-12-20 21:18             ` Peter Zijlstra
2023-01-10  2:33               ` srinivas pandruvada [this message]
2022-12-15 18:43 ` [RFC/RFT PATCH 2/2] sched/core: Add max duration to play_precise_idle() Srinivas Pandruvada

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=cc9bd410208fb05fcfa32345a609fb1c6cde35d0.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=frederic@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).