kernel stack torture

Gerard Roudier (groudier@iplus.fr)
Wed, 14 Feb 1996 01:50:50 +0000 (GMT)


Files: linux/drivers/block/ll_rw_blk.c
linux/fs/buffer.c
linux/drivers/scsi/sd.c

Linux-1.3.60

Imagine the following:
- a process initiate lots of IO requests (up to 64) asynchronously and sleep.
(NR_REQUESTS=64)
- another process try do an IO request.

What may happen?
- The kernel stack of the second process (4K) may be to short if it has to
queue and complete recursively all the requests.

With NR_REQUESTS=64 and Drew's scsi driver or ncrBsd2Linux, I get a kernel
stack corruption (it's an overflow) every 2 Bonnie tests.

I try with NR_REQUESTS=10. I ran 10 times Bonnie without any kernel stack
problem.

I am not quite sure, but it seems to me that the whole process of a scsi
command (queue, interrupt, complete) may take at least 300 bytes of kernel
stack. So NR_REQUESTS should not be greater than 16.

Regards, Gerard.