lkcd
[Top] [All Lists]

Re: LKCD 3.1.3 available ...

To: Michael Walfish <mwalfish@xxxxxxxxxxxxxxxxxxx>
Subject: Re: LKCD 3.1.3 available ...
From: "Matt D. Robinson" <yakker@xxxxxxxxxxxxxx>
Date: Tue, 05 Jun 2001 15:28:11 -0700
Cc: lkcd@xxxxxxxxxxx, Yoel Inbar <yoel@xxxxxxxxxxxxx>
Organization: Alacritech, Inc.
References: <NDBBIAJJGJIJCJJIKLKMGEIGCMAA.mwalfish@digitalfountain.com>
Sender: owner-lkcd@xxxxxxxxxxx
Michael Walfish wrote:
> 
> > Can you send me the code that you're
> > running to generate the interrupt crash?
> 
> The driver depends on a custom NIC, and the relevant snippets are below. If
> you'd like the whole driver, please let me know.
> 
> > is this an SMP or non-SMP system?
> 
> SMP. Two x86 processors. Not using interrupt-CPU affinities feature (so the
> interrupts can go to both CPUs).

If you want to try something I'm thinking about, try this patch.
Let me know if this makes any difference whatsoever (UNTESTED, BTW).
I'm sure you'll get the gist of what I'm trying to do ... just
to stop schedule() from happening.  Of course, this can lead
to lots of other "issues" which I haven't even tried out yet.

Otherwise, I'll work on this later tonight when I get home.

--Matt

> 
> -Mike
> 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> int nic_open(struct net_device* dev)
> {
>     [snip]
>     if (request_irq(dev->irq, &nic_interrupt, SA_SHIRQ, dev->name, dev)) {
>         printk(KERN_DEBUG "REPLICATOR request_irq failed\n");
>         return -EAGAIN;
>     }
>     [snip]
> }
> 
> /* a user-level program causes this flag to be set to 1 */
> int global_crash_flag = 0;
> 
> /* these interrupts are generated by the hardware */
> void nic_interrupt(int irq, void *dev_id, struct pt_regs *regs)
> {
>     volatile char* foo = 0;
> 
>     [snip]
> 
>     if (global_crash_flag)
>         *foo = 1;
> 
>     [snip]
> 
> }
> 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--- kernel/sched.c.orig Tue Jun  5 15:21:57 2001
+++ kernel/sched.c      Tue Jun  5 15:11:50 2001
@@ -105,16 +105,27 @@
 
 struct kernel_stat kstat;
 
+#if defined(CONFIG_VMDUMP)
+extern int dump_in_progress;
+#endif
+
 #ifdef CONFIG_SMP
 
 #define idle_task(cpu) (init_tasks[cpu_number_map(cpu)])
 #define can_schedule(p,cpu) ((!(p)->has_cpu) && \
+#if defined(CONFIG_VMDUMP)
+                               (!dump_in_progress) && \
+#endif
                                ((p)->cpus_allowed & (1 << cpu)))
 
 #else
 
 #define idle_task(cpu) (&init_task)
+#if defined(CONFIG_VMDUMP)
+#define can_schedule(p,cpu) (!(dump_in_progress))
+#else
 #define can_schedule(p,cpu) (1)
+#endif
 
 #endif
 
@@ -512,6 +523,11 @@
        struct list_head *tmp;
        int this_cpu, c;
 
+#if defined(CONFIG_VMDUMP)
+       if (dump_in_progress) {
+               goto dump_in_progress;
+       }
+#endif
        if (!current->active_mm) BUG();
 need_resched_back:
        prev = current;
@@ -686,6 +702,9 @@
 scheduling_in_interrupt:
        printk("Scheduling in interrupt\n");
        BUG();
+#if defined(CONFIG_VMDUMP)
+dump_in_progress:
+#endif
        return;
 }
 
--- drivers/block/vmdump.c.orig Tue Jun  5 15:24:21 2001
+++ drivers/block/vmdump.c      Tue Jun  5 15:25:46 2001
@@ -99,6 +99,7 @@
 char dumpdev_name[PATH_MAX];       /* the name of the dump device          */
 struct file *dump_file;            /* the file pointer of the dump device  */
 kdev_t dumpdev;                    /* the actual kdev_t device number      */
+int dump_in_progress = 0;          /* are we really dumping now?           */
 void *dump_page_buf;               /* dump page buffer for memcpy()!       */
 int dump_level = DUMP_KERN;        /* the current dump level               */
 int dump_compress_pages = TRUE;    /* whether to try to compress each page */
@@ -916,6 +917,7 @@
 
        /* we set this to FALSE so we don't ever re-enter this code! */
        dump_okay = FALSE;
+       dump_in_progress = 1;
 
        /* make sure the dump_level variable is in range (0 - 4) */
        if ((dump_level > DUMP_ALL) || (dump_level < DUMP_NONE)) {
<Prev in Thread] Current Thread [Next in Thread>