Re: [PATCH net-next v6 10/11] net: sched: atomically check-allocate action

2018-08-13 Thread Vlad Buslov
On Fri 10 Aug 2018 at 21:45, Cong Wang wrote: > On Fri, Aug 10, 2018 at 3:29 AM Vlad Buslov wrote: >> >> Approach you suggest is valid, but has its own trade-offs: >> >> - As you noted, lock granularity becomes coarse-grained due to per-netns >> scope. > > Sure, you acquire idrinfo->lock too, t

Re: [PATCH net-next v6 10/11] net: sched: atomically check-allocate action

2018-08-10 Thread Cong Wang
On Fri, Aug 10, 2018 at 3:29 AM Vlad Buslov wrote: > > Approach you suggest is valid, but has its own trade-offs: > > - As you noted, lock granularity becomes coarse-grained due to per-netns > scope. Sure, you acquire idrinfo->lock too, the only difference is how long you take it. The bottleneck

Re: [PATCH net-next v6 10/11] net: sched: atomically check-allocate action

2018-08-10 Thread Vlad Buslov
On Thu 09 Aug 2018 at 23:43, Cong Wang wrote: > On Wed, Aug 8, 2018 at 5:06 AM Vlad Buslov wrote: >> >> >> On Wed 08 Aug 2018 at 01:20, Cong Wang wrote: >> > On Thu, Jul 5, 2018 at 7:24 AM Vlad Buslov wrote: >> >> >> >> Implement function that atomically checks if action exists and either >>

Re: [PATCH net-next v6 10/11] net: sched: atomically check-allocate action

2018-08-09 Thread Cong Wang
On Wed, Aug 8, 2018 at 5:06 AM Vlad Buslov wrote: > > > On Wed 08 Aug 2018 at 01:20, Cong Wang wrote: > > On Thu, Jul 5, 2018 at 7:24 AM Vlad Buslov wrote: > >> > >> Implement function that atomically checks if action exists and either takes > >> reference to it, or allocates idr slot for action

Re: [PATCH net-next v6 10/11] net: sched: atomically check-allocate action

2018-08-08 Thread Vlad Buslov
On Wed 08 Aug 2018 at 01:20, Cong Wang wrote: > On Thu, Jul 5, 2018 at 7:24 AM Vlad Buslov wrote: >> >> Implement function that atomically checks if action exists and either takes >> reference to it, or allocates idr slot for action index to prevent >> concurrent allocations of actions with sam

Re: [PATCH net-next v6 10/11] net: sched: atomically check-allocate action

2018-08-07 Thread Cong Wang
On Thu, Jul 5, 2018 at 7:24 AM Vlad Buslov wrote: > > Implement function that atomically checks if action exists and either takes > reference to it, or allocates idr slot for action index to prevent > concurrent allocations of actions with same index. Use EBUSY error pointer > to indicate that idr

[PATCH net-next v6 10/11] net: sched: atomically check-allocate action

2018-07-05 Thread Vlad Buslov
Implement function that atomically checks if action exists and either takes reference to it, or allocates idr slot for action index to prevent concurrent allocations of actions with same index. Use EBUSY error pointer to indicate that idr slot is reserved. Implement cleanup helper function that re