[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-doc
Subject:    Re: Re: [V4 PATCH 3/4] kexec: Fix race between panic() and crash_kexec() called directly
From:       Peter Zijlstra <peterz () infradead ! org>
Date:       2015-09-30 11:53:47
Message-ID: 20150930115347.GH2881 () worktop ! programming ! kicks-ass ! net
[Download RAW message or body]

On Mon, Sep 28, 2015 at 07:08:19AM +0000, 河合英宏 / KAWAI,HIDEHIRO wrote:
> > >> kernel/kexec_core.c:899:3: note: in expansion of macro 'atomic_xchg'
> >       atomic_xchg(&panic_cpu, -1);
> >       ^
> 
> I changed to use atomic_xchg() instead of atomic_set() in V3
> because atomic_set() doesn't mean memory barrier.  However,
> I thought again and there is no need of barrier; there is no
> problem if a competitor sees old value of panic_cpu or new one.
> So, atomic_set() is sufficient and using it will remove this warning.
> 
> I will resend the fixed version later.

So if you rely on the memory barrier; you should have also put a comment
on explaining the ordering requirements.
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic