Re: [PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread Hannes Reinecke
On 03/21/2017 04:33 PM, James Bottomley wrote: > On Tue, 2017-03-21 at 16:25 +0100, Hannes Reinecke wrote: >> On 03/21/2017 02:05 PM, James Bottomley wrote: >>> On Tue, 2017-03-21 at 13:14 +0100, Hannes Reinecke wrote: With the current design we're waiting for all async probes to finish

Re: [PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread Hannes Reinecke
On 03/21/2017 02:05 PM, James Bottomley wrote: > On Tue, 2017-03-21 at 13:14 +0100, Hannes Reinecke wrote: >> With the current design we're waiting for all async probes to >> finish when removing any sd device. >> This might lead to a livelock where the 'remove' call is blocking >> for any probe

Re: [PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread James Bottomley
On Tue, 2017-03-21 at 16:25 +0100, Hannes Reinecke wrote: > On 03/21/2017 02:05 PM, James Bottomley wrote: > > On Tue, 2017-03-21 at 13:14 +0100, Hannes Reinecke wrote: > > > With the current design we're waiting for all async probes to > > > finish when removing any sd device. > > > This might

Re: [PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread Hannes Reinecke
On 03/21/2017 02:33 PM, James Bottomley wrote: > On Tue, 2017-03-21 at 13:30 +, Bart Van Assche wrote: >> On Tue, 2017-03-21 at 09:05 -0400, James Bottomley wrote: >>> How does this preserve ordering? It looks like you have one cookie >>> per sdkp ... is there some sort of ordering guarantee

Re: [PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread Bart Van Assche
On Tue, 2017-03-21 at 09:33 -0400, James Bottomley wrote: > On Tue, 2017-03-21 at 13:30 +, Bart Van Assche wrote: > > On Tue, 2017-03-21 at 09:05 -0400, James Bottomley wrote: > > > How does this preserve ordering? It looks like you have one cookie > > > per sdkp ... is there some sort of

Re: [PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread James Bottomley
On Tue, 2017-03-21 at 13:30 +, Bart Van Assche wrote: > On Tue, 2017-03-21 at 09:05 -0400, James Bottomley wrote: > > How does this preserve ordering? It looks like you have one cookie > > per sdkp ... is there some sort of ordering guarantee I'm not > > seeing? > > Hello James, > > Since

Re: [PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread Bart Van Assche
On Tue, 2017-03-21 at 09:05 -0400, James Bottomley wrote: > How does this preserve ordering? It looks like you have one cookie per > sdkp ... is there some sort of ordering guarantee I'm not seeing? Hello James, Since the probe order depends on the order in which __async_probe() adds entries to

Re: [PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread James Bottomley
On Tue, 2017-03-21 at 13:14 +0100, Hannes Reinecke wrote: > With the current design we're waiting for all async probes to > finish when removing any sd device. > This might lead to a livelock where the 'remove' call is blocking > for any probe calls to finish, and the probe calls are waiting for >

Re: [PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread Bart Van Assche
On Tue, 2017-03-21 at 13:14 +0100, Hannes Reinecke wrote: > With the current design we're waiting for all async probes to > finish when removing any sd device. > This might lead to a livelock where the 'remove' call is blocking > for any probe calls to finish, and the probe calls are waiting for >

[PATCH] sd: use async_probe cookie to avoid deadlocks

2017-03-21 Thread Hannes Reinecke
With the current design we're waiting for all async probes to finish when removing any sd device. This might lead to a livelock where the 'remove' call is blocking for any probe calls to finish, and the probe calls are waiting for a response, which will never be processes as the thread handling