[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YcHCEm/6AL0DQrv7@hirez.programming.kicks-ass.net>
Date: Tue, 21 Dec 2021 13:01:22 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: xuhaifeng <xuhaifeng@...o.com>
Cc: mingo@...hat.com, juri.lelli@...hat.com, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, linux-kernel@...r.kernel.org,
Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH] sched: optimize __cond_resched_lock()
On Tue, Dec 21, 2021 at 11:09:00AM +0100, Peter Zijlstra wrote:
> On Tue, Dec 21, 2021 at 09:52:28AM +0100, Peter Zijlstra wrote:
> > On Tue, Dec 21, 2021 at 03:23:16PM +0800, xuhaifeng wrote:
> > > if the kernel is preemptible(CONFIG_PREEMPTION=y), schedule()may be
> > > called twice, once via spin_unlock, once via preempt_schedule_common.
> > >
> > > we can add one conditional, check TIF_NEED_RESCHED flag again,
> > > to avoid this.
> >
> > You can also make it more similar to __cond_resched() instead of making
> > it more different.
>
> Bah, sorry, had to wake up first :/
>
> cond_resched_lock still needs to exist for PREEMPT because locks won't
> magically release themselves.
>
> Still don't much like the patch though, how's this work for you?
>
> That's arguably the right thing to do work PREEMPT_DYNAMIC too.
Duh, those would need cond_resched() proper, clearly I should just give
up and call it a holiday already..
Powered by blists - more mailing lists