Re: [PATCH] zfcp: convert the zfcp_erp thread to the kthread api

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 29 Oct 2006 23:26:56 +0100,
Heiko Carstens <heiko.carstens@xxxxxxxxxx> wrote:

> What could happen:
> - code is in erp thread loop before down_interruptible(erp_ready_sem)
> - thread should be killed: somebody calls kthread_stop() hence
>   kthread_should_stop() gets true. But since the thread is not sleeping
>   (yet) there is no need to wake it. So kthread_stop() just waits.
> - erp thread comes to down_interruptible(erp_ready_sem) and sleeps.
> - the only "up" that would wake up the erp_thread comes after your
>   kthread_stop() which is waits that the thread terminates -> deadlock.

Grmpf, you're right. And even checking kthread_should_stop()
immediately before going to sleep would be racy. We need to up() after
we set should_stop and wait afterwards... Please drop this patch for
now until I have time to sort it out.

-- 
Cornelia Huck
Linux for zSeries Developer
Tel.: +49-7031-16-4837, Mail: cornelia.huck@xxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux