Re: [PATCH] kexec jump: fix compiling warning on xchg(&kexec_lock, 0) in kernel_kexec()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Eric W. Biederman <ebiederm@...>, <ying.huang@...>, <pavel@...>, <nigel@...>, <rjw@...>, <vgoyal@...>, <mingo@...>, <linux-kernel@...>, <kexec@...>
Date: Wednesday, August 13, 2008 - 3:50 pm

On Wed, 13 Aug 2008, Andrew Morton wrote:

Nope. That needs to be an "unsigned long".

But more importantl, why not just make it a lock in the first place?

	static DEFINE_SPINLOCK(kexec_lock);

	#define kexec_trylock() spin_trylock(&kexec_lock)
	#define kexec_unlock() spin_unlock(&kexec_lock)

and then you get it all right and clear and obvious.

Yeah, and I didn't check whether there is anything that is supposed to be 
able to sleep. If there is, use a mutex instead of a spinlock, of course.

		Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] kexec jump: fix compiling warning on xchg(&amp;k..., Eric W. Biederman, (Wed Aug 13, 2:12 pm)
Re: [PATCH] kexec jump: fix compiling warning on xchg(&k..., Linus Torvalds, (Wed Aug 13, 3:50 pm)