lkml.org 
[lkml]   [2008]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kexec jump: fix compiling warning on xchg(&kexec_lock, 0) in kernel_kexec()
On Wed, Aug 13, 2008 at 11:12:48AM -0700, Eric W. Biederman wrote:
> Linus Torvalds <torvalds@linux-foundation.org> writes:
>
> > On Wed, 13 Aug 2008, Huang Ying wrote:
> >>
> >> - xchg(&kexec_lock, 0);
> >> + locked = xchg(&kexec_lock, 0);
> >> + BUG_ON(!locked);
> >
> > Why do you want to do this at all?
> >
> > And why do you implement your locks with xchg() in the first place? That's
> > total and utter crap.
> >
> > Hint: we have _real_ locking primitives in the kernel.
>
> This part certainly.
>
> The way the code should work, and the way it has in the past is:
> image = xchg(&kexec_image, NULL)
> if (!image)
> return -EINVAL;
>
> Very simple and very obvious and very easy to get right, and it has
> been that way for years.
>

Hi Eric,

Are there any issues with usage of test_and_set_bit() or usage of spinlock
primitives?

Thanks
Vivek


\
 
 \ /
  Last update: 2008-08-13 20:35    [W:0.068 / U:20.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site