From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Weinberger <rw@linutronix.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -rt] printk: Disable migration instead of preemption
Date: Mon, 12 Dec 2011 17:35:52 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.02.1112121734580.3020@ionos> (raw)
In-Reply-To: <1323703531.21400.1.camel@twins>
On Mon, 12 Dec 2011, Peter Zijlstra wrote:
> On Mon, 2011-12-12 at 14:35 +0100, Richard Weinberger wrote:
> > There is no need do disable preemption in vprintk(),
> > disable_migrate() is sufficient.
> > This fixes also a the following bug in -rt:
> >
> > [ 14.759233] BUG: sleeping function called from invalid context
> > at /home/rw/linux-rt/kernel/rtmutex.c:645
>
> > ---
> > kernel/printk.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/kernel/printk.c b/kernel/printk.c
> > index a50af4e..13d0825 100644
> > --- a/kernel/printk.c
> > +++ b/kernel/printk.c
> > @@ -898,7 +898,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
> > boot_delay_msec();
> > printk_delay();
> >
> > - preempt_disable();
> > + migrate_disable();
> > /* This stops the holder of console_sem just where we want him */
> > raw_local_irq_save(flags);
> > this_cpu = smp_processor_id();
> > @@ -1029,7 +1029,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
> > out_restore_irqs:
> > raw_local_irq_restore(flags);
> >
> > - preempt_enable();
> > + migrate_enable();
> > return printed_len;
> > }
> > EXPORT_SYMBOL(printk);
>
> One has to wonder why this patch makes any difference what so ever, note
> how right after/before the preempt_disable/enable there's a
> raw_local_irq_save/restore and last time I checked those really did
> disable IRQs, even on -rt.
The point is that we drop that lock further down and on RT we also
reenable interrupts, so we have to prevent that we get migrated away.
Thanks,
tglx
next prev parent reply other threads:[~2011-12-12 16:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-12 13:35 Richard Weinberger
2011-12-12 15:25 ` Peter Zijlstra
2011-12-12 16:35 ` Thomas Gleixner [this message]
2011-12-12 16:47 ` Peter Zijlstra
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=alpine.LFD.2.02.1112121734580.3020@ionos \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=rw@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
all inboxes | Powered by JetHome®