Re: [LTP] [RFC] [KDUMP] [PROPOSED WORK] kdump on Xen hypervisor and guests, more tests for utilities, like makedumpfile, mkdumprd, kexec etc

2008-08-13 Thread Subrata Modak
Hi Cai, Thanks very much for explaining everything. Regards-- Subrata On Tue, 2008-08-12 at 16:48 +0800, Cai Qian wrote: Hi Subrata, From: Subrata Modak [EMAIL PROTECTED] Subject: Re: [LTP] [RFC] [KDUMP] [PROPOSED WORK] kdump on Xen hypervisor and guests, more tests for utilities, like

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

2008-08-13 Thread Huang Ying
Fix compiling warning on xchg(kexec_lock, 0) in kernel_kexec(). Signed-off-by: Huang Ying [EMAIL PROTECTED] --- kernel/kexec.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -1433,6 +1433,7 @@ module_init(crash_save_vmcoreinfo_init)

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

2008-08-13 Thread Andrew Morton
On Wed, 13 Aug 2008 17:12:40 +0800 Huang Ying [EMAIL PROTECTED] wrote: Fix compiling warning on xchg(kexec_lock, 0) in kernel_kexec(). Would prefer that thi code not use such a peculair idiom. I don't believe that it needs to. I guess that's a separate activity. --- kernel/kexec.c |

Re: [PATCH] kexec jump: fix code size checking

2008-08-13 Thread Vivek Goyal
On Wed, Aug 13, 2008 at 09:04:35AM +0800, Huang Ying wrote: Fix building issue when CONFIG_KEXEC=n. Thanks to Vivek Goyal for his reminding. Signed-off-by: Huang Ying [EMAIL PROTECTED] --- include/asm-x86/kexec.h |3 +++ 1 file changed, 3 insertions(+) ---

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

2008-08-13 Thread Linus Torvalds
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

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

2008-08-13 Thread Linus Torvalds
On Wed, 13 Aug 2008, Andrew Morton wrote: We don't need to create that local. I queued this: No, please don't. Just don't take this whole patch-series until it's cleaned up. There is absolutely no excuse for using xchg as a locking primitive. Nothing like this should be queued anywhere,

Re: [PATCH] kexec jump: fix code size checking

2008-08-13 Thread Andrew Morton
On Wed, 13 Aug 2008 09:19:27 -0400 Vivek Goyal [EMAIL PROTECTED] wrote: On Wed, Aug 13, 2008 at 09:04:35AM +0800, Huang Ying wrote: Fix building issue when CONFIG_KEXEC=n. Thanks to Vivek Goyal for his reminding. Signed-off-by: Huang Ying [EMAIL PROTECTED] ---

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

2008-08-13 Thread Ingo Molnar
* Andrew Morton [EMAIL PROTECTED] wrote: instead? Not that that's really right either, but at least it avoids the _ridiculous_ crap. The real solution is probably to use a spinlock and trylock/unlock. Or test_and_set_bit(). That's what I've been saying too, only differently ;)

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

2008-08-13 Thread Vivek Goyal
On Wed, Aug 13, 2008 at 11:12:48AM -0700, Eric W. Biederman wrote: Linus Torvalds [EMAIL PROTECTED] 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

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

2008-08-13 Thread Andrew Morton
On Wed, 13 Aug 2008 11:12:48 -0700 [EMAIL PROTECTED] (Eric W. Biederman) wrote: Linus Torvalds [EMAIL PROTECTED] 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

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

2008-08-13 Thread Linus Torvalds
On Wed, 13 Aug 2008, Andrew Morton wrote: - * in interrupt context :) + * Return true if we acquired the lock */ -static int kexec_lock; +static inline bool kexec_trylock(void) +{ + return !test_and_set_bit(0, kexec_bitlock); Nope. That needs to be an unsigned long. But more

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

2008-08-13 Thread Andrew Morton
On Wed, 13 Aug 2008 12:50:57 -0700 (PDT) Linus Torvalds [EMAIL PROTECTED] wrote: On Wed, 13 Aug 2008, Andrew Morton wrote: - * in interrupt context :) + * Return true if we acquired the lock */ -static int kexec_lock; +static inline bool kexec_trylock(void) +{ + return

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

2008-08-13 Thread Trond Myklebust
On Wed, 2008-08-13 at 12:44 -0700, Andrew Morton wrote: - Is xchg() guaranteed to be atomic? That's what atomic_xchg() is for. Yes, xchg() is guaranteed to be atomic. atomic_xchg() applies only to the atomic_t type, and is almost always #defined to xchg(). - xchg() isn't guaranteed to exist

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

2008-08-13 Thread Andrew Morton
On Wed, 13 Aug 2008 13:13:13 -0700 (PDT) Linus Torvalds [EMAIL PROTECTED] wrote: Used a bitop to preserve the runtime checking in there. spin_unlock() doesn't return the previous lockedness. Umm. spin_unlock does a lot more when you have lock debugging on, and doesn't do useless crap

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

2008-08-13 Thread Linus Torvalds
On Wed, 13 Aug 2008, Andrew Morton wrote: #2: I thought you said there were things that want to sleep in the region? If so, spinlocks will work as long as you don't have CONFIG_PREEMPT or lock validation (there's no way to deadlock thanks to all the lock getters using the trylock

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

2008-08-13 Thread Andrew Morton
On Wed, 13 Aug 2008 13:31:24 -0700 (PDT) Linus Torvalds [EMAIL PROTECTED] wrote: On Wed, 13 Aug 2008, Andrew Morton wrote: #2: I thought you said there were things that want to sleep in the region? be reasonable - that was over five minutes ago. ---

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

2008-08-13 Thread Vivek Goyal
On Wed, Aug 13, 2008 at 01:41:18PM -0700, Andrew Morton wrote: On Wed, 13 Aug 2008 13:31:24 -0700 (PDT) Linus Torvalds [EMAIL PROTECTED] wrote: On Wed, 13 Aug 2008, Andrew Morton wrote: #2: I thought you said there were things that want to sleep in the region? be reasonable -