All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Problems with CONFIG_PREEMPT
@ 2002-12-17  8:27 Colin.Helliwell
  2002-12-17 18:03 ` Jun Sun
  0 siblings, 1 reply; 8+ messages in thread
From: Colin.Helliwell @ 2002-12-17  8:27 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips


NEW_TIME_C is set. URL to the patch is:
http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/preempt-kernel-rml-2.4.19-2.patch

We ultimately want to add in real-time support, such as Ingo's O(1)
scheduler - if this is 'complete' for MIPS. I don't know if it would be
better just to go for this in one hit, or if we'd need the preemption
sorted out anyway first. Or should we just go to a 2.5.x kernel instead?

Colin




                                                                                                                                       
                      Jun Sun                                                                                                          
                      <jsun@mvista.com>        To:       Colin.Helliwell@Zarlink.Com                                                   
                                               cc:       linux-mips@linux-mips.org, jsun@mvista.com                                    
                      16-Dec-2002 08:45        Subject:  Re: Problems with CONFIG_PREEMPT                                              
                      PM                                                                                                               
                                                                                                                                       
                                                                                                                                       





Several possibilities:

1) Not all MIPS boards can run pre-k.  At minimum, you need to use
NEW_TIME_C, Or else you have to take a lot of stuff youself.

2) Not sure if all MIPS patches are in RML's patch.  If you pass the URL
pointer, I can take a look.

3) Even with all above taken care of, there are still unsolved issues
(such as math emul not pre-k safe, some cache operations, etc).
However, these problems usually are much harder to show up.  You won't
see them unless you delibrately want to. :-)

Jun

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Problems with CONFIG_PREEMPT
@ 2002-12-20 14:51 Colin.Helliwell
  2002-12-20 23:53 ` Jun Sun
  0 siblings, 1 reply; 8+ messages in thread
From: Colin.Helliwell @ 2002-12-20 14:51 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips, rml


Think I'm ok with respect to interrupt handling, but what does making
globals "safe or taken care of" consist of?




                                                                                                                                       
                      Jun Sun                                                                                                          
                      <jsun@mvista.com>        To:       Colin.Helliwell@Zarlink.Com                                                   
                                               cc:       linux-mips@linux-mips.org, rml@mvista.com, jsun@mvista.com                    
                      19-Dec-2002 05:59        Subject:  Re: Problems with CONFIG_PREEMPT                                              
                      PM                                                                                                               
                                                                                                                                       
                                                                                                                                       




On Thu, Dec 19, 2002 at 09:10:40AM +0000, Colin.Helliwell@Zarlink.Com
wrote:
>
> Thanks for the patch, but unfortunately the problem is still the same.

If the problem happens very soon after you boot up, there is something
*obviously* wrong.  The most common problem is that you have an interupt
handling path not going through standard do_IRQ().  Then you need to
do similar treatment like those in ll_timer_interrupt().

The second thing is to look for any *new* global variables you may
introduce in your kernel.  Most of current global variables are either
safe or taken care of (Although another update patch will come out
today or tomorrow to really close the final hole we have).

> I'm
> not sure whether it occurs as a result of interrupts, or just after a
> certain amount of scheduler 'activity' as it sits there copying the
initrd
> into ram disk. A few interrupts are enabled, but its only the MIPS timer
> which should be generating any interrupts at that point (I'll check that,
> in case its relevant).

FYI, I have mips kernel with initrd running just fine with preemptible
kernel.
In fact, it has passed some very stressful tests with initrd.

> I presume the change from "sti()" to "__sti()" was a semantic (or SMP)
> thing, since the former is #defined to the latter anyway? Please note
also
> the following modification which was required to 2.4.19:
>

This is true.  Since our kernel had synchronize_irq() added long time ago,
I probably forgot about it when I created the pre-k patch.

Jun

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Problems with CONFIG_PREEMPT
@ 2002-12-19  9:10 Colin.Helliwell
  2002-12-19 17:59 ` Jun Sun
  0 siblings, 1 reply; 8+ messages in thread
From: Colin.Helliwell @ 2002-12-19  9:10 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips, rml


Thanks for the patch, but unfortunately the problem is still the same. I'm
not sure whether it occurs as a result of interrupts, or just after a
certain amount of scheduler 'activity' as it sits there copying the initrd
into ram disk. A few interrupts are enabled, but its only the MIPS timer
which should be generating any interrupts at that point (I'll check that,
in case its relevant).
I presume the change from "sti()" to "__sti()" was a semantic (or SMP)
thing, since the former is #defined to the latter anyway? Please note also
the following modification which was required to 2.4.19:

diff -u -p -r1.1 -r1.2
--- scratch/include/asm-mips/hardirq.h    2002/09/26 15:58:11     1.1
+++ scratch/include/asm-mips/hardirq.h    2002/12/12 13:15:03     1.2
@@ -42,7 +42,7 @@
 #define irq_exit(cpu, irq)   (local_irq_count(cpu)--)

 #define synchronize_irq()    barrier();
-
+#define release_irqlock(cpu) do { } while (0)
 #else

 #include <asm/atomic.h>



(We had a look at the 2.5 (head) kernel, but this seems to have some wrong
coding, and doesn't build straight off. Things like duplicate #defines
ALIGN and a conditional branch instruction with only one operand!)




                                                                                                                                           
                      Jun Sun                                                                                                              
                      <jsun@mvista.com>            To:       Colin.Helliwell@Zarlink.Com                                                   
                      Sent by:                     cc:       linux-mips@linux-mips.org, jsun@mvista.com, rml@mvista.com                    
                      linux-mips-bounce@lin        Subject:  Re: Problems with CONFIG_PREEMPT                                              
                      ux-mips.org                                                                                                          
                                                                                                                                           
                                                                                                                                           
                      17-Dec-2002 06:03 PM                                                                                                 
                                                                                                                                           
                                                                                                                                           




On Tue, Dec 17, 2002 at 08:27:16AM +0000, Colin.Helliwell@Zarlink.Com
wrote:
>
> NEW_TIME_C is set. URL to the patch is:
>
http://www.kernel.org/pub/linux/kernel/people/rml/preempt-kernel/v2.4/preempt-kernel-rml-2.4.19-2.patch

>

There are some bits missing.  Not sure if it is related to your problem or
not.

Robert, please take the MIPS preemptible kernel update patch.

> We ultimately want to add in real-time support, such as Ingo's O(1)
> scheduler - if this is 'complete' for MIPS.

O(1) shortens process dispatching time, usually not a big time saver
unless you have *lots* of process and/or you are doing frequent context
switches.

Another patch which is probably more important is the Ingo's breaking
selected big lock patch.  That will preemption work more effectively.

> I don't know if it would be
> better just to go for this in one hit, or if we'd need the preemption
> sorted out anyway first.

You do have to sort them out one by one.  (Or you get them all by becoming
mvista customer. :-0)

> Or should we just go to a 2.5.x kernel instead?

We'd love to have more people bang on 2.5 MIPS *grin* ...

Jun

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Problems with CONFIG_PREEMPT
@ 2002-12-16 13:58 Colin.Helliwell
  2002-12-16 20:45 ` Jun Sun
  0 siblings, 1 reply; 8+ messages in thread
From: Colin.Helliwell @ 2002-12-16 13:58 UTC (permalink / raw)
  To: linux-mips

I've been porting the MIPS kernel to our system-on-chip hardware
(4KEc-based) and have encountered a problem with a pre-emptible patch. The
original kernel was the 2.4.19 from the CVS server, onto which I applied
Robert Love's preemptible patch (preempt-kernel-rml-2.4.19-2.patch), plus
the addition of a #include to softirq.h, and a missing definition for
release_irqlock() in hardirq.h.
I've found that when CONFIG_PREEMPT is set, it no longer loads the
(non-compressed) initrd correctly - about 1.8MB through loading (2MB total)
I get a Data Bus Error. A typical call trace shown by the oops is shown
below, and looks a little 'confused' to me, so I'm thinking there may be
some stack corruption going on?

Address         Function

801174fc        tasklet_hi_action
801af0a4        printChipInfo
801af0a4        printChipInfo
8013bf50        sys_write
801089c4        stack_done
80108b28        reschedule
801133d0        _call_console_drivers
80113ad8        release_console_sem
80113848        printk
801506b8        sys_ioctl
801af0f8        printChipInfo
8014ccd4        sys_mkdir
801af0a4        printChipInfo
80100470        init
80100470        init
80100840        prepare_namespace
80100470        init
8010049c        init
8010352c        kernel_thread
80100420        _stext
8010351c        kernel_thread


I wondered if anyone had any thoughts about what might be causing this, or
had seen this occuring before - were there perhaps some changes made just
after this point in time (now in the 2.5.x kernel)?



Thanks.

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

end of thread, other threads:[~2002-12-20 23:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-17  8:27 Problems with CONFIG_PREEMPT Colin.Helliwell
2002-12-17 18:03 ` Jun Sun
  -- strict thread matches above, loose matches on Subject: below --
2002-12-20 14:51 Colin.Helliwell
2002-12-20 23:53 ` Jun Sun
2002-12-19  9:10 Colin.Helliwell
2002-12-19 17:59 ` Jun Sun
2002-12-16 13:58 Colin.Helliwell
2002-12-16 20:45 ` Jun Sun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.