All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carmelo AMOROSO <carmelo.amoroso@st.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] resume_kernel fix for kernel oops built with CONFIG_BKL_PREEMPT=y
Date: Fri, 05 Sep 2008 05:45:34 +0000	[thread overview]
Message-ID: <48C0C77E.3050401@st.com> (raw)
In-Reply-To: <48BFD6F5.5030508@st.com>

Paul Mundt wrote:
> On Thu, Sep 04, 2008 at 02:39:17PM +0200, Carmelo AMOROSO wrote:
>> Hi All,
>> attached patch solves a kernel OOPS discovered while running LTP 
>> testsuite (doio test) with kernel 2.6.23.y (rootf on hd).
>> Attached for your reference the output of the test and the kernel oops.
>>
>> The problems is within the SH implementation of resume_kernel code,
>> that implements in assembly the bulk of preempt_schedule_irq function 
>> without taking care of the extra code needed to handle the BKL preemptible.
>>
>> The patch basically consists of removing this asm code and calling the 
>> common C implementation (see kernel/sched.c) as other archs do.
>>
> I don't recall that C implementation existing when I wrote that code back
> in the 2.4 days, so that's probably why the semantics are a bit
> different. We certainly should be doing what the other arches are doing
> though, so your patch looks good and I'll apply it. The irqflags tracing
> will probably need a bit more thinking there, but I'll look at that
> tomorrow.
> 

Hi Paul,
well irqflags tracing is managed internally by local_irq_[enable,diable]
as defined in include/linux/irqflags.h.

#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT

#include <asm/irqflags.h>

#define local_irq_enable() \
      do { trace_hardirqs_on(); raw_local_irq_enable(); } while (0)
#define local_irq_disable() \
      do { raw_local_irq_disable(); trace_hardirqs_off(); } while (0)

.........

#else /* !CONFIG_TRACE_IRQFLAGS_SUPPORT */
/*
  * The local_irq_*() APIs are equal to the raw_local_irq*()
  * if !TRACE_IRQFLAGS.
  */
# define raw_local_irq_disable()    local_irq_disable()
# define raw_local_irq_enable()     local_irq_enable()
......
#endif

Indeed, looking better, the macros within the #else path
are erroneously exchanged... we should have

# define local_irq_disable() raw_local_irq_disable()
# define local_irq_enable() raw_local_irq_enable()

These should be fixed on Linus' main stream.

> I'll add this in to the 2.6.27 queue, thanks.
> 
That's fine.

Cheers,
Carmelo



      parent reply	other threads:[~2008-09-05  5:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-04 12:39 [PATCH] resume_kernel fix for kernel oops built with CONFIG_BKL_PREEMPT=y Carmelo AMOROSO
2008-09-04 15:40 ` Paul Mundt
2008-09-05  5:45 ` Carmelo AMOROSO [this message]

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=48C0C77E.3050401@st.com \
    --to=carmelo.amoroso@st.com \
    --cc=linux-sh@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.