The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Huang Ying <ying.huang@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATH -mm] Fix a race condtion of oops_in_progress
Date: Mon, 18 Aug 2008 22:46:43 -0700	[thread overview]
Message-ID: <20080818224643.865da7a3.akpm@linux-foundation.org> (raw)
In-Reply-To: <1219124280.5663.88.camel@yhuang-dev.sh.intel.com>

On Tue, 19 Aug 2008 13:38:00 +0800 Huang Ying <ying.huang@intel.com> wrote:

> On Mon, 2008-08-18 at 21:06 -0700, Andrew Morton wrote:
> > On Mon, 18 Aug 2008 10:03:27 +0800 Huang Ying <ying.huang@intel.com> wrote:
> > 
> > > This patch fix a race condition of oops_in_progress. Which may be
> > > changed on multiple CPU simultaneously, but it is changed via
> > > non-atomic operation ++/--. This patch changes the definition of
> > > oops_in_process from int to atomic_t, and accessing method to atomic
> > > operations.
> > 
> > 
> > > extern atomic_t oops_in_progress;
> > 
> > In file included from include/asm/system.h:10,
> >                  from include/asm/processor.h:17,
> >                  from include/asm/atomic_32.h:5,
> >                  from include/asm/atomic.h:2,
> >                  from include/linux/crypto.h:20,
> >                  from arch/x86/kernel/asm-offsets_32.c:7,
> >                  from arch/x86/kernel/asm-offsets.c:2:
> > include/linux/kernel.h:236: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'oops_in_progress'
> > make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
> > make: *** [prepare0] Error 2
> > 
> > we can't inlude asm/atomic.h from linux/kernel.h because asm/atomic.h
> > includes linux/kernel.h via the above route.
> > 
> > And we cannot forward-declare atomic_t by hand because it's a typedef.
> > 
> > Not sure what to do, really.  Find a different header file in which to
> > declare oops_in_progress?
> 
> It seems that asm/atomic.h is used for both atomic_t declaration and
> implementation, how about separate them? That it, add a new file
> asm/atomic_def.h, put typedef there, and include asm/atomic_def.h in
> kernel.h?

yup, that sounds sensible.

Of course, it may be the case that we no longer need to include
kernel.h from within asm-x86/system.h.  But that's the sort of thing
which once done is awfully hard to undo.


  reply	other threads:[~2008-08-19  5:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-18  2:03 [PATH -mm] Fix a race condtion of oops_in_progress Huang Ying
2008-08-19  4:06 ` Andrew Morton
2008-08-19  5:38   ` Huang Ying
2008-08-19  5:46     ` Andrew Morton [this message]
2008-08-19  9:41       ` Andrew Morton
2008-08-20  1:42         ` Huang Ying

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=20080818224643.865da7a3.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ying.huang@intel.com \
    /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