[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1311211428450.30673@ionos.tec.linutronix.de>
Date: Thu, 21 Nov 2013 14:30:13 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
cc: Tony Luck <tony.luck@...il.com>,
LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andi Kleen <ak@...ux.intel.com>, Peter Anvin <hpa@...or.com>,
Mike Galbraith <bitbucket@...ine.de>,
Arjan van de Ven <arjan@...ux.intel.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Fenghua Yu <fenghua.yu@...el.com>
Subject: Re: [patch 4/6] ia64: Use preempt_schedule_irq
On Thu, 21 Nov 2013, Peter Zijlstra wrote:
> On Thu, Nov 21, 2013 at 12:41:44PM +0100, Thomas Gleixner wrote:
> > On Wed, 20 Nov 2013, Thomas Gleixner wrote:
> > > On Wed, 20 Nov 2013, Tony Luck wrote:
> > > > asmlinkage void __sched preempt_schedule_irq(void)
> > > > {
> > > > schedule();
> > > > }
> > > >
> > > > Or is life more complicated than that?
> > >
> > > Hmm, I think I fubared that and you decided to ignore my patch :)
> > >
> > > Let me look at it tomorrow morning with full awake brain cells.
> >
> > Ok, wrapped my brain around it. I tripped over the magic asm foo which
> > has a single need_resched check and schedule point for both sys call
> > return and interrupt return.
> >
> > So you need the schedule_preempt_irq() for kernel preemption from
> > interrupt return while on a normal syscall preemption a schedule would
> > be sufficient. But using schedule_preempt_irq() is not harmful here in
> > any way. It just sets the preempt_active bit also in cases where it
> > would not be required.
> >
> > Even on preempt=n kernels adding the preempt_active bit is completely
> > harmless. So instead of having an extra function, moving the existing
> > one out of the ifdef PREEMPT looks like the sanest thing to do.
> >
> > Peter, Ingo ?
>
> Uhm, preempt_schedule_irq() assumes interrupts are disabled and
> explicitly returns with interrupts disabled again. Does the ia64
> callsite conform?
Yep.
> If so, schedule() would actually be actively wrong, because that will
> whinge when called with interrupts disabled, and will return with
> interrupts enabled.
>
> Anyway, I don't object to the patch per se, but it might bloat a few
> !ia64 kernels for having to carry the extra text.
Well, we could get rid of quite some other sti/schedule/cli asm magic
all over the archs.
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists