Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-09-01 Thread Eugene Shatokhin
01.09.2015 10:58, Oliver Neukum пишет: On Mon, 2015-08-31 at 11:50 +0300, Eugene Shatokhin wrote: But I would have liked it much better if the code became simpler instead of more complex. Me too, but I can see no other way here. The code is simpler without locking, indeed, but locking is nee

Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-09-01 Thread Oliver Neukum
On Mon, 2015-08-31 at 11:50 +0300, Eugene Shatokhin wrote: > > But I would have liked it much better if the code became simpler > instead > > of more complex. > > Me too, but I can see no other way here. The code is simpler without > locking, indeed, but locking is needed to prevent the problems

Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-09-01 Thread Oliver Neukum
On Fri, 2015-08-28 at 11:09 +0300, Eugene Shatokhin wrote: > > Exactly what problem will that result in? The tasklet_kill() will > wait > > for the processing of the single element done queue, and everything > will > > be fine. Or? > > Given enough time, what prevents defer_bh() from calling >

Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-08-31 Thread Eugene Shatokhin
31.08.2015 10:32, Bjørn Mork пишет: Eugene Shatokhin writes: 28.08.2015 11:55, Bjørn Mork пишет: I guess you are right. At least I cannot prove that you are not :) There is a bit too much complexity involved here for me... :-) Yes, it is quite complex. I admit, it was easier for me to f

Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-08-31 Thread Bjørn Mork
Eugene Shatokhin writes: > 28.08.2015 11:55, Bjørn Mork пишет: > >> I guess you are right. At least I cannot prove that you are not :) >> >> There is a bit too much complexity involved here for me... > > :-) > > Yes, it is quite complex. > > I admit, it was easier for me to find the races in usbn

Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-08-28 Thread Eugene Shatokhin
28.08.2015 11:55, Bjørn Mork пишет: Eugene Shatokhin writes: 25.08.2015 00:01, Bjørn Mork пишет: Eugene Shatokhin writes: The race may happen when a device (e.g. YOTA 4G LTE Modem) is unplugged while the system is downloading a large file from the Net. Hardware breakpoints and Kprobes wit

Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-08-28 Thread Bjørn Mork
Eugene Shatokhin writes: > 25.08.2015 00:01, Bjørn Mork пишет: >> Eugene Shatokhin writes: >> >>> The race may happen when a device (e.g. YOTA 4G LTE Modem) is >>> unplugged while the system is downloading a large file from the Net. >>> >>> Hardware breakpoints and Kprobes with delays were used

Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-08-28 Thread Eugene Shatokhin
25.08.2015 00:01, Bjørn Mork пишет: Eugene Shatokhin writes: The race may happen when a device (e.g. YOTA 4G LTE Modem) is unplugged while the system is downloading a large file from the Net. Hardware breakpoints and Kprobes with delays were used to confirm that the race does actually happen.

Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-08-25 Thread David Miller
From: Eugene Shatokhin Date: Mon, 24 Aug 2015 23:13:43 +0300 > The race may happen when a device (e.g. YOTA 4G LTE Modem) is > unplugged while the system is downloading a large file from the Net. > > Hardware breakpoints and Kprobes with delays were used to confirm that > the race does actually

Re: [PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-08-24 Thread Bjørn Mork
Eugene Shatokhin writes: > The race may happen when a device (e.g. YOTA 4G LTE Modem) is > unplugged while the system is downloading a large file from the Net. > > Hardware breakpoints and Kprobes with delays were used to confirm that > the race does actually happen. > > The race is on skb_queue

[PATCH 2/2] usbnet: Fix a race between usbnet_stop() and the BH

2015-08-24 Thread Eugene Shatokhin
The race may happen when a device (e.g. YOTA 4G LTE Modem) is unplugged while the system is downloading a large file from the Net. Hardware breakpoints and Kprobes with delays were used to confirm that the race does actually happen. The race is on skb_queue ('next' pointer) between usbnet_stop()