Re: epoll: possible bug from wakeup_source activation

2013-03-11 Thread Eric Wong
Arve Hjønnevåg wrote: > On Mon, Mar 11, 2013 at 5:17 PM, Eric Wong wrote: > > Arve Hjønnevåg wrote: > >> On Fri, Mar 8, 2013 at 11:10 PM, Eric Wong wrote: > >> > Arve Hjønnevåg wrote: > >> >> On Fri, Mar 8, 2013 at 12:49 PM, Eric Wong > >> >> wrote: > >> >> > What happens if ep_modify calls

Re: epoll: possible bug from wakeup_source activation

2013-03-11 Thread Arve Hjønnevåg
On Mon, Mar 11, 2013 at 5:17 PM, Eric Wong wrote: > Arve Hjønnevåg wrote: >> On Fri, Mar 8, 2013 at 11:10 PM, Eric Wong wrote: >> > Arve Hjønnevåg wrote: >> >> On Fri, Mar 8, 2013 at 12:49 PM, Eric Wong wrote: >> >> > What happens if ep_modify calls ep_destroy_wakeup_source >> >> > while __pm_

Re: epoll: possible bug from wakeup_source activation

2013-03-11 Thread Eric Wong
Arve Hjønnevåg wrote: > On Fri, Mar 8, 2013 at 11:10 PM, Eric Wong wrote: > > Arve Hjønnevåg wrote: > >> On Fri, Mar 8, 2013 at 12:49 PM, Eric Wong wrote: > >> > What happens if ep_modify calls ep_destroy_wakeup_source > >> > while __pm_stay_awake is running on the same epi->ws? > >> > >> Yes,

Re: epoll: possible bug from wakeup_source activation

2013-03-11 Thread Arve Hjønnevåg
On Fri, Mar 8, 2013 at 11:10 PM, Eric Wong wrote: > Arve Hjønnevåg wrote: >> On Fri, Mar 8, 2013 at 12:49 PM, Eric Wong wrote: >> > What happens if ep_modify calls ep_destroy_wakeup_source >> > while __pm_stay_awake is running on the same epi->ws? >> >> Yes, that looks like a problem. I think ca

Re: epoll: possible bug from wakeup_source activation

2013-03-09 Thread Eric Dumazet
On Sun, 2013-03-10 at 01:11 +, Eric Wong wrote: > > static void ep_destroy_wakeup_source(struct epitem *epi) > { > - wakeup_source_unregister(epi->ws); > - epi->ws = NULL; > + struct wakeup_source *ws = epi->ws; > + > + rcu_assign_pointer(epi->ws, NULL); There is no need to

Re: epoll: possible bug from wakeup_source activation

2013-03-09 Thread Eric Wong
Eric Wong wrote: > Arve Hjønnevåg wrote: > > On Fri, Mar 8, 2013 at 12:49 PM, Eric Wong wrote: > > > What happens if ep_modify calls ep_destroy_wakeup_source > > > while __pm_stay_awake is running on the same epi->ws? > > > > Yes, that looks like a problem. I think calling > > ep_destroy_wakeup

Re: epoll: possible bug from wakeup_source activation

2013-03-08 Thread Eric Wong
Arve Hjønnevåg wrote: > On Fri, Mar 8, 2013 at 12:49 PM, Eric Wong wrote: > > What happens if ep_modify calls ep_destroy_wakeup_source > > while __pm_stay_awake is running on the same epi->ws? > > Yes, that looks like a problem. I think calling > ep_destroy_wakeup_source with ep->lock held shoul

Re: epoll: possible bug from wakeup_source activation

2013-03-08 Thread Arve Hjønnevåg
On Fri, Mar 8, 2013 at 12:49 PM, Eric Wong wrote: > Arve Hjønnevåg wrote: >> On Thu, Mar 7, 2013 at 5:30 PM, Eric Wong wrote: >> > Eric Wong wrote: >> >> Hi Arve, looking at commit 4d7e30d98939a0340022ccd49325a3d70f7e0238 >> >> (epoll: Add a flag, EPOLLWAKEUP, to prevent suspend ...) >> >> >> >

Re: epoll: possible bug from wakeup_source activation

2013-03-08 Thread Eric Wong
Arve Hjønnevåg wrote: > On Thu, Mar 7, 2013 at 5:30 PM, Eric Wong wrote: > > Eric Wong wrote: > >> Hi Arve, looking at commit 4d7e30d98939a0340022ccd49325a3d70f7e0238 > >> (epoll: Add a flag, EPOLLWAKEUP, to prevent suspend ...) > >> > >> I think the reason for using ep->ws instead of epi->ws in

Re: epoll: possible bug from wakeup_source activation

2013-03-07 Thread Arve Hjønnevåg
On Thu, Mar 7, 2013 at 5:30 PM, Eric Wong wrote: > Eric Wong wrote: >> Hi Arve, looking at commit 4d7e30d98939a0340022ccd49325a3d70f7e0238 >> (epoll: Add a flag, EPOLLWAKEUP, to prevent suspend ...) >> >> I think the reason for using ep->ws instead of epi->ws in the unlikely >> ovflist case appli

Re: epoll: possible bug from wakeup_source activation

2013-03-07 Thread Eric Wong
Eric Wong wrote: > Hi Arve, looking at commit 4d7e30d98939a0340022ccd49325a3d70f7e0238 > (epoll: Add a flag, EPOLLWAKEUP, to prevent suspend ...) > > I think the reason for using ep->ws instead of epi->ws in the unlikely > ovflist case applies to the likely rdllist case, too. Since epi->ws is >