public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Kernel panics on raw I/O stress test
@ 2001-04-19 12:01 Takanori Kawano
  2001-04-19 12:50 ` Alan Cox
  2001-04-19 17:33 ` Andrea Arcangeli
  0 siblings, 2 replies; 5+ messages in thread
From: Takanori Kawano @ 2001-04-19 12:01 UTC (permalink / raw)
  To: linux-kernel


When I ran raw I/O SCSI read/write test with 2.4.1 kernel 
on our IA64 8way SMP box, kernel paniced and following 
message was displayed.

  Aiee, killing interrupt handler!

No stack trace and register dump are displayed.

Then I analyze FSB traces around the panic, and found that 
following functions are called before panic().


   CPU0:                              CPU1:

      ・                                  ・
      ・                                  ・
      ・                                rw_raw_dev()
      ・                                  ・
      ・                                  ・
      ・                                 brw_kiovec()
      ・                                  ・
      ・                                  ・
      ・                                 free_kiovec()
      ・                                  ・
      ・                                  ・
    end_kio_request()
     __wake_up()
     ia64_do_page_fault()
      do_exit()
       panic()

I suppose that free_kiobuf() is called on CPU1 before 
end_kio_request() is called on CPU0 for the same kiobuf
and resulted in the panic.
In 2.4.1 source code, I think there is no assurance 
that free_kiovec() in rw_raw_dev() is called after 
end_kio_request() is done.

I tried following two workarounds. 

(1) Wait in rw_raw_dev() while io_count is positive. 

--- drivers/char/raw.c        Mon Oct  2 12:35:15 2000
+++ drivers/char/raw.c.workaround       Thu Apr 19 16:54:26 2001
@@ -333,6 +333,11 @@
                        break;
        }

+       while(atomic_read(&iobuf->io_count)) {
+         set_task_state(current, TASK_UNINTERRUPTIBLE);
+         schedule();
+       }
+
        free_kiovec(1, &iobuf);

        if (transferred) {



(2) Keep buffer lock until end_kio_request() is done.

--- fs/buffer.c       Tue Jan 16 05:42:32 2001
+++ fs/buffer.c.workaround      Thu Apr 19 17:22:19 2001
@@ -1990,8 +1990,8 @@
        mark_buffer_uptodate(bh, uptodate);

        kiobuf = bh->b_private;
-       unlock_buffer(bh);
        end_kio_request(kiobuf, uptodate);
+       unlock_buffer(bh);
 }



Both of them worked well for our raw I/O testing,
but I'm not sure they are right.

Does anybody have comments? 

regards,

---
Takanori Kawano
Hitachi Ltd,
Internet Systems Platform Division
t-kawano@ebina.hitachi.co.jp


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

end of thread, other threads:[~2001-04-20 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-19 12:01 Kernel panics on raw I/O stress test Takanori Kawano
2001-04-19 12:50 ` Alan Cox
2001-04-19 17:33 ` Andrea Arcangeli
2001-04-20 11:44   ` Takanori Kawano
2001-04-20 14:11     ` Andrea Arcangeli

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