Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Paul E. McKenney
On Mon, Jul 22, 2019 at 12:32:17PM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 22, 2019 at 09:25:51AM -0700, Paul E. McKenney wrote: > > On Mon, Jul 22, 2019 at 12:13:40PM -0400, Michael S. Tsirkin wrote: > > > On Mon, Jul 22, 2019 at 08:55:34AM -0700, Paul E. McKenney wrote: > > > > On Mon, Jul

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Michael S. Tsirkin
On Mon, Jul 22, 2019 at 09:25:51AM -0700, Paul E. McKenney wrote: > On Mon, Jul 22, 2019 at 12:13:40PM -0400, Michael S. Tsirkin wrote: > > On Mon, Jul 22, 2019 at 08:55:34AM -0700, Paul E. McKenney wrote: > > > On Mon, Jul 22, 2019 at 11:47:24AM -0400, Michael S. Tsirkin wrote: > > > > On Mon, Jul

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Paul E. McKenney
On Mon, Jul 22, 2019 at 12:13:40PM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 22, 2019 at 08:55:34AM -0700, Paul E. McKenney wrote: > > On Mon, Jul 22, 2019 at 11:47:24AM -0400, Michael S. Tsirkin wrote: > > > On Mon, Jul 22, 2019 at 11:14:39AM -0400, Joel Fernandes wrote: > > > > [snip] > > >

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Paul E. McKenney
On Mon, Jul 22, 2019 at 01:04:48PM -0300, Jason Gunthorpe wrote: > On Mon, Jul 22, 2019 at 08:52:35AM -0700, Paul E. McKenney wrote: > > So why then is there a problem? > > I'm not sure there is a real problem, I thought Michael was just > asking how to design with RCU in the case where the user c

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Michael S. Tsirkin
On Mon, Jul 22, 2019 at 01:04:48PM -0300, Jason Gunthorpe wrote: > On Mon, Jul 22, 2019 at 08:52:35AM -0700, Paul E. McKenney wrote: > > So why then is there a problem? > > I'm not sure there is a real problem, I thought Michael was just > asking how to design with RCU in the case where the user c

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Michael S. Tsirkin
On Mon, Jul 22, 2019 at 08:55:34AM -0700, Paul E. McKenney wrote: > On Mon, Jul 22, 2019 at 11:47:24AM -0400, Michael S. Tsirkin wrote: > > On Mon, Jul 22, 2019 at 11:14:39AM -0400, Joel Fernandes wrote: > > > [snip] > > > > > Would it make sense to have call_rcu() check to see if there are many >

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Jason Gunthorpe
On Mon, Jul 22, 2019 at 08:52:35AM -0700, Paul E. McKenney wrote: > So why then is there a problem? I'm not sure there is a real problem, I thought Michael was just asking how to design with RCU in the case where the user controls the kfree_rcu?? Sounds like the answer is "don't worry about it" ?

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Paul E. McKenney
On Mon, Jul 22, 2019 at 11:47:24AM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 22, 2019 at 11:14:39AM -0400, Joel Fernandes wrote: > > [snip] > > > > Would it make sense to have call_rcu() check to see if there are many > > > > outstanding requests on this CPU and if so process them before > >

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Paul E. McKenney
On Mon, Jul 22, 2019 at 10:41:52AM -0300, Jason Gunthorpe wrote: > On Mon, Jul 22, 2019 at 04:51:49AM -0700, Paul E. McKenney wrote: > > > > > > Would it make sense to have call_rcu() check to see if there are many > > > > > outstanding requests on this CPU and if so process them before > > > > >

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Michael S. Tsirkin
On Mon, Jul 22, 2019 at 11:14:39AM -0400, Joel Fernandes wrote: > [snip] > > > Would it make sense to have call_rcu() check to see if there are many > > > outstanding requests on this CPU and if so process them before returning? > > > That would ensure that frequent callers usually ended up doing t

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Joel Fernandes
[snip] > > Would it make sense to have call_rcu() check to see if there are many > > outstanding requests on this CPU and if so process them before returning? > > That would ensure that frequent callers usually ended up doing their > > own processing. Other than what Paul already mentioned about d

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Jason Gunthorpe
On Mon, Jul 22, 2019 at 04:51:49AM -0700, Paul E. McKenney wrote: > > > > Would it make sense to have call_rcu() check to see if there are many > > > > outstanding requests on this CPU and if so process them before > > > > returning? > > > > That would ensure that frequent callers usually ended u

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Paul E. McKenney
On Mon, Jul 22, 2019 at 03:56:22AM -0400, Michael S. Tsirkin wrote: > On Sun, Jul 21, 2019 at 12:28:41PM -0700, Paul E. McKenney wrote: > > On Sun, Jul 21, 2019 at 01:53:23PM -0400, Michael S. Tsirkin wrote: > > > On Sun, Jul 21, 2019 at 06:17:25AM -0700, Paul E. McKenney wrote: > > > > On Sun, Jul

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Paul E. McKenney
On Mon, Jul 22, 2019 at 03:52:05AM -0400, Michael S. Tsirkin wrote: > On Sun, Jul 21, 2019 at 04:31:13PM -0700, Paul E. McKenney wrote: > > On Sun, Jul 21, 2019 at 02:08:37PM -0700, Matthew Wilcox wrote: > > > On Sun, Jul 21, 2019 at 06:17:25AM -0700, Paul E. McKenney wrote: > > > > Also, the overh

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Michael S. Tsirkin
On Sun, Jul 21, 2019 at 12:28:41PM -0700, Paul E. McKenney wrote: > On Sun, Jul 21, 2019 at 01:53:23PM -0400, Michael S. Tsirkin wrote: > > On Sun, Jul 21, 2019 at 06:17:25AM -0700, Paul E. McKenney wrote: > > > On Sun, Jul 21, 2019 at 08:28:05AM -0400, Michael S. Tsirkin wrote: > > > > Hi Paul, ot

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-22 Thread Michael S. Tsirkin
On Sun, Jul 21, 2019 at 04:31:13PM -0700, Paul E. McKenney wrote: > On Sun, Jul 21, 2019 at 02:08:37PM -0700, Matthew Wilcox wrote: > > On Sun, Jul 21, 2019 at 06:17:25AM -0700, Paul E. McKenney wrote: > > > Also, the overhead is important. For example, as far as I know, > > > current RCU graceful

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-21 Thread Paul E. McKenney
On Sun, Jul 21, 2019 at 02:08:37PM -0700, Matthew Wilcox wrote: > On Sun, Jul 21, 2019 at 06:17:25AM -0700, Paul E. McKenney wrote: > > Also, the overhead is important. For example, as far as I know, > > current RCU gracefully handles close(open(...)) in a tight userspace > > loop. But there migh

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-21 Thread Matthew Wilcox
On Sun, Jul 21, 2019 at 06:17:25AM -0700, Paul E. McKenney wrote: > Also, the overhead is important. For example, as far as I know, > current RCU gracefully handles close(open(...)) in a tight userspace > loop. But there might be trouble due to tight userspace loops around > lighter-weight operat

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-21 Thread Paul E. McKenney
On Sun, Jul 21, 2019 at 01:53:23PM -0400, Michael S. Tsirkin wrote: > On Sun, Jul 21, 2019 at 06:17:25AM -0700, Paul E. McKenney wrote: > > On Sun, Jul 21, 2019 at 08:28:05AM -0400, Michael S. Tsirkin wrote: > > > Hi Paul, others, > > > > > > So it seems that vhost needs to call kfree_rcu from an

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-21 Thread Michael S. Tsirkin
On Sun, Jul 21, 2019 at 06:17:25AM -0700, Paul E. McKenney wrote: > On Sun, Jul 21, 2019 at 08:28:05AM -0400, Michael S. Tsirkin wrote: > > Hi Paul, others, > > > > So it seems that vhost needs to call kfree_rcu from an ioctl. My worry > > is what happens if userspace starts cycling through lots o

Re: RFC: call_rcu_outstanding (was Re: WARNING in __mmdrop)

2019-07-21 Thread Paul E. McKenney
On Sun, Jul 21, 2019 at 08:28:05AM -0400, Michael S. Tsirkin wrote: > Hi Paul, others, > > So it seems that vhost needs to call kfree_rcu from an ioctl. My worry > is what happens if userspace starts cycling through lots of these > ioctls. Given we actually use rcu as an optimization, we could ju