Re: [PATCH] epoll: prevent missed events on EPOLL_CTL_MOD

2013-01-02 Thread Eric Dumazet
On Wed, 2013-01-02 at 19:32 +, Eric Wong wrote: > That modification in ep_send_events_proc() is protected by ep->mtx > (as is ep_modify()), though. Maybe there are other places, but I > don't see it. Yes, and using a mutex for protecting this field while its read from interrupt context (so w

Re: [PATCH] epoll: prevent missed events on EPOLL_CTL_MOD

2013-01-02 Thread Eric Wong
Eric Wong wrote: > Linus Torvalds wrote: > > Please document the barrier that this mb() pairs with, and then give > > an explanation for the fix in the commit message, and I'll happily > > take it. Even if it's just duplicating the comments above the > > wq_has_sleeper() function, except modified

Re: [PATCH] epoll: prevent missed events on EPOLL_CTL_MOD

2013-01-02 Thread Eric Wong
Eric Dumazet wrote: > On Wed, 2013-01-02 at 18:40 +, Eric Wong wrote: > > Eric Dumazet wrote: > > > It seems the real problem is the epi->event.events = event->events; > > > which is done without taking ep->lock > > > > Yes. I am hoping it is possible to do it without a lock there, > > but

Re: [PATCH] epoll: prevent missed events on EPOLL_CTL_MOD

2013-01-02 Thread Eric Dumazet
On Wed, 2013-01-02 at 18:40 +, Eric Wong wrote: > Eric Dumazet wrote: > > First, thanks for working on this issue. > > No problem! > > > It seems the real problem is the epi->event.events = event->events; > > which is done without taking ep->lock > > Yes. I am hoping it is possible to do i

Re: [PATCH] epoll: prevent missed events on EPOLL_CTL_MOD

2013-01-02 Thread Eric Wong
Eric Dumazet wrote: > First, thanks for working on this issue. No problem! > It seems the real problem is the epi->event.events = event->events; > which is done without taking ep->lock Yes. I am hoping it is possible to do it without a lock there, but your change is more obviously correct. >

Re: [PATCH] epoll: prevent missed events on EPOLL_CTL_MOD

2013-01-02 Thread Eric Dumazet
On Tue, 2013-01-01 at 23:56 +, Eric Wong wrote: > Linus Torvalds wrote: > > Please document the barrier that this mb() pairs with, and then give > > an explanation for the fix in the commit message, and I'll happily > > take it. Even if it's just duplicating the comments above the > > wq_has_s