public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RCU question
@ 2004-12-09 23:59 George Anzinger
  2004-12-10  4:31 ` Dipankar Sarma
  0 siblings, 1 reply; 44+ messages in thread
From: George Anzinger @ 2004-12-09 23:59 UTC (permalink / raw)
  To: Dipankar Sarma, Manfred Spraul, lkml

I am working on VST code.  This code is called from the idle loop to check for 
future timers.  It then sets up a timer to interrupt in time to handle the 
nearest timer and turns off the time base interrupt source.  As part of 
qualifying the entry to this state I want to make sure there is no pending work 
so, from the idle task I have this:

	if (local_softirq_pending())
		do_softirq();

	BUG_ON(local_softirq_pending());

I did not really expect to find any pending softirqs, but, not only are there 
some, they don't go away and the system BUGs.  The offender is the RCU task. 
The question is: is this normal or is there something wrong?
-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/


^ permalink raw reply	[flat|nested] 44+ messages in thread
* Re: [patch, 2.6.10-rc3] safe_hlt() & NMIs
@ 2004-12-17 23:35 Chuck Ebbert
  0 siblings, 0 replies; 44+ messages in thread
From: Chuck Ebbert @ 2004-12-17 23:35 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Andi Kleen, Andrew Morton

On Tue, 14 Dec 2004 at 15:00:56 -0800 (PST) Linus Torvalds wrote:

> Checking for kernel CS also requires checking that it's not vm86 mode, 
> btw. So that's not just a "regs->xcs & 0xffff == __KERNEL_CS" either.
>
> But something like
> 
>       static inline int kernel_mode(struct pt_regs *regs)
>       {
>               return !((regs->eflags & VM_MASK) | (regs->xcs & 3));
>       }
>
> should DTRT.
>
> Can you pls double-check my thinking, and test?


 There is already a user_mode() macro in asm-i386/ptrace.h but it's slow.

 x86_64's macro is ugly but at least there's no logical-or in it.

 Your i386 code is better, so how about applying this patch (boots/runs/is faster
on my tests):

Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>

--- linux-2.6.9.1/include/asm-i386/ptrace.h     2004-10-19 15:28:18.000000000 -0400
+++ linux-2.6.9.2/include/asm-i386/ptrace.h     2004-12-17 16:59:39.956099664 -0500
@@ -55,7 +55,11 @@ struct pt_regs {
 #define PTRACE_SET_THREAD_AREA    26
 
 #ifdef __KERNEL__
-#define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs))
+static inline int kernel_mode(struct pt_regs *regs)
+{
+       return !((3 & (regs)->xcs) | (VM_MASK & (regs)->eflags));
+}
+#define user_mode(regs) (!kernel_mode(regs))
 #define instruction_pointer(regs) ((regs)->eip)
 #if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
 extern unsigned long profile_pc(struct pt_regs *regs);

--
Please take it as a sign of my infinite respect for you,
that I insist on you doing all the work.
                                        -- Rusty Russell

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2004-12-17 23:38 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-09 23:59 RCU question George Anzinger
2004-12-10  4:31 ` Dipankar Sarma
2004-12-10 19:42   ` George Anzinger
2004-12-10 20:40     ` Dipankar Sarma
2004-12-10 20:45       ` Lee Revell
2004-12-10 21:02         ` George Anzinger
2004-12-10 22:58           ` Zwane Mwaikambo
2004-12-11  2:22             ` George Anzinger
2004-12-11  2:45               ` Zwane Mwaikambo
2004-12-11  3:29                 ` George Anzinger
2004-12-11 14:52                   ` Zwane Mwaikambo
2004-12-11 16:32                     ` Manfred Spraul
2004-12-11 16:52                       ` George Anzinger
2004-12-12  2:53                         ` Zwane Mwaikambo
2004-12-12  8:59                           ` Manfred Spraul
2004-12-12  9:37                             ` Andrea Arcangeli
2004-12-12 10:22                               ` Manfred Spraul
2004-12-12 12:15                                 ` Andrea Arcangeli
2004-12-14 21:40                                   ` Lee Revell
2004-12-14 22:23                                     ` [patch, 2.6.10-rc3] safe_hlt() & NMIs Ingo Molnar
2004-12-14 22:47                                       ` Ingo Molnar
2004-12-14 23:09                                         ` Linus Torvalds
2004-12-15  8:52                                           ` Ingo Molnar
2004-12-15 15:44                                             ` Linus Torvalds
2004-12-15 16:35                                               ` Ingo Molnar
2004-12-16  0:37                                           ` Alan Cox
2004-12-16  1:58                                             ` Linus Torvalds
2004-12-16 14:51                                               ` Ingo Molnar
2004-12-16 15:08                                                 ` Maciej W. Rozycki
2004-12-16 15:11                                                   ` Ingo Molnar
2004-12-16 15:42                                                     ` Maciej W. Rozycki
2004-12-16 15:54                                                 ` Linus Torvalds
2004-12-16  2:10                                             ` Zwane Mwaikambo
2004-12-16 13:26                                               ` Alan Cox
2004-12-14 23:41                                         ` Andrea Arcangeli
2004-12-14 23:00                                       ` Linus Torvalds
2004-12-15  5:04                                         ` Andi Kleen
2004-12-15  6:27                                       ` Avi Kivity
2004-12-15  8:51                                         ` Ingo Molnar
2004-12-12 16:51                                 ` RCU question George Anzinger
2004-12-12 22:40                                   ` Manfred Spraul
2004-12-13  5:22                                     ` George Anzinger
2004-12-12 16:26                             ` Zwane Mwaikambo
  -- strict thread matches above, loose matches on Subject: below --
2004-12-17 23:35 [patch, 2.6.10-rc3] safe_hlt() & NMIs Chuck Ebbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox