Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-20 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 18:56:51 -0600 (CST) Christopher Lameter wrote: > On Tue, 19 Dec 2017, Rao Shoaib wrote: > > > > > mm/slab_common.c > > > It would be great to have separate patches so that we can review it > > > properly: > > > > > > 1. Move the code into slab_common.c > >

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-20 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 18:56:51 -0600 (CST) Christopher Lameter wrote: > On Tue, 19 Dec 2017, Rao Shoaib wrote: > > > > > mm/slab_common.c > > > It would be great to have separate patches so that we can review it > > > properly: > > > > > > 1. Move the code into slab_common.c > > > 2. The actual

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-20 Thread Michal Hocko
On Tue 19-12-17 12:02:03, Rao Shoaib wrote: > BTW -- This is my first ever patch to Linux, so I am still learning the > etiquette. Reading through Documentation/process/submitting-patches.rst might be really helpful. Good luck! -- Michal Hocko SUSE Labs

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-20 Thread Michal Hocko
On Tue 19-12-17 12:02:03, Rao Shoaib wrote: > BTW -- This is my first ever patch to Linux, so I am still learning the > etiquette. Reading through Documentation/process/submitting-patches.rst might be really helpful. Good luck! -- Michal Hocko SUSE Labs

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 13:20:43 -0800 Rao Shoaib wrote: > On 12/19/2017 12:41 PM, Jesper Dangaard Brouer wrote: > > On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: > > > >> +/* Main RCU function that is called to free RCU structures */ > >> +static void >

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 13:20:43 -0800 Rao Shoaib wrote: > On 12/19/2017 12:41 PM, Jesper Dangaard Brouer wrote: > > On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: > > > >> +/* Main RCU function that is called to free RCU structures */ > >> +static void > >>

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 16:20:51 -0800 "Paul E. McKenney" wrote: > On Tue, Dec 19, 2017 at 02:12:06PM -0800, Matthew Wilcox wrote: > > On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: > > > If I had to implement this: I would choose to do the

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 16:20:51 -0800 "Paul E. McKenney" wrote: > On Tue, Dec 19, 2017 at 02:12:06PM -0800, Matthew Wilcox wrote: > > On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: > > > If I had to implement this: I would choose to do the optimization in > > >

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Paul E. McKenney
On Tue, Dec 19, 2017 at 05:53:36PM -0800, Matthew Wilcox wrote: > On Tue, Dec 19, 2017 at 04:20:51PM -0800, Paul E. McKenney wrote: > > If we are going to make this sort of change, we should do so in a way > > that allows the slab code to actually do the optimizations that might > > make this sort

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Paul E. McKenney
On Tue, Dec 19, 2017 at 05:53:36PM -0800, Matthew Wilcox wrote: > On Tue, Dec 19, 2017 at 04:20:51PM -0800, Paul E. McKenney wrote: > > If we are going to make this sort of change, we should do so in a way > > that allows the slab code to actually do the optimizations that might > > make this sort

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Matthew Wilcox
On Tue, Dec 19, 2017 at 04:20:51PM -0800, Paul E. McKenney wrote: > If we are going to make this sort of change, we should do so in a way > that allows the slab code to actually do the optimizations that might > make this sort of thing worthwhile. After all, if the main goal was small > code

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Matthew Wilcox
On Tue, Dec 19, 2017 at 04:20:51PM -0800, Paul E. McKenney wrote: > If we are going to make this sort of change, we should do so in a way > that allows the slab code to actually do the optimizations that might > make this sort of thing worthwhile. After all, if the main goal was small > code

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Christopher Lameter
On Tue, 19 Dec 2017, Rao Shoaib wrote: > > > mm/slab_common.c > > It would be great to have separate patches so that we can review it > > properly: > > > > 1. Move the code into slab_common.c > > 2. The actual code changes to the kfree rcu mechanism > > 3. The whitespace changes > I can

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Christopher Lameter
On Tue, 19 Dec 2017, Rao Shoaib wrote: > > > mm/slab_common.c > > It would be great to have separate patches so that we can review it > > properly: > > > > 1. Move the code into slab_common.c > > 2. The actual code changes to the kfree rcu mechanism > > 3. The whitespace changes > I can

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Paul E. McKenney
On Tue, Dec 19, 2017 at 02:12:06PM -0800, Matthew Wilcox wrote: > On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: > > If I had to implement this: I would choose to do the optimization in > > __rcu_process_callbacks() create small on-call-stack ptr-array for > >

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Paul E. McKenney
On Tue, Dec 19, 2017 at 02:12:06PM -0800, Matthew Wilcox wrote: > On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: > > If I had to implement this: I would choose to do the optimization in > > __rcu_process_callbacks() create small on-call-stack ptr-array for > >

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 02:12 PM, Matthew Wilcox wrote: On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: If I had to implement this: I would choose to do the optimization in __rcu_process_callbacks() create small on-call-stack ptr-array for kfree_bulk(). I would only optimize

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 02:12 PM, Matthew Wilcox wrote: On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: If I had to implement this: I would choose to do the optimization in __rcu_process_callbacks() create small on-call-stack ptr-array for kfree_bulk(). I would only optimize

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Matthew Wilcox
On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: > If I had to implement this: I would choose to do the optimization in > __rcu_process_callbacks() create small on-call-stack ptr-array for > kfree_bulk(). I would only optimize the case that call kfree() > directly. In the

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Matthew Wilcox
On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: > If I had to implement this: I would choose to do the optimization in > __rcu_process_callbacks() create small on-call-stack ptr-array for > kfree_bulk(). I would only optimize the case that call kfree() > directly. In the

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 12:41 PM, Jesper Dangaard Brouer wrote: On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: +/* Main RCU function that is called to free RCU structures */ +static void +__rcu_bulk_free(struct rcu_head *head, rcu_callback_t func, int cpu, bool lazy) +{ +

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 12:41 PM, Jesper Dangaard Brouer wrote: On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: +/* Main RCU function that is called to free RCU structures */ +static void +__rcu_bulk_free(struct rcu_head *head, rcu_callback_t func, int cpu, bool lazy) +{ +

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Paul E. McKenney
On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: > > On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: > > > +/* Main RCU function that is called to free RCU structures */ > > +static void > > +__rcu_bulk_free(struct rcu_head *head, rcu_callback_t func, int

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Paul E. McKenney
On Tue, Dec 19, 2017 at 09:41:58PM +0100, Jesper Dangaard Brouer wrote: > > On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: > > > +/* Main RCU function that is called to free RCU structures */ > > +static void > > +__rcu_bulk_free(struct rcu_head *head, rcu_callback_t func, int

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: > +/* Main RCU function that is called to free RCU structures */ > +static void > +__rcu_bulk_free(struct rcu_head *head, rcu_callback_t func, int cpu, bool > lazy) > +{ > + unsigned long offset; > + void *ptr; > +

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: > +/* Main RCU function that is called to free RCU structures */ > +static void > +__rcu_bulk_free(struct rcu_head *head, rcu_callback_t func, int cpu, bool > lazy) > +{ > + unsigned long offset; > + void *ptr; > +

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Paul E. McKenney
On Tue, Dec 19, 2017 at 11:56:30AM -0800, Rao Shoaib wrote: > On 12/19/2017 11:30 AM, Matthew Wilcox wrote: > >On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: [ . . . ] > >I've been doing a lot of thinking about this because I really want a > >way to kfree_rcu() an object

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Paul E. McKenney
On Tue, Dec 19, 2017 at 11:56:30AM -0800, Rao Shoaib wrote: > On 12/19/2017 11:30 AM, Matthew Wilcox wrote: > >On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: [ . . . ] > >I've been doing a lot of thinking about this because I really want a > >way to kfree_rcu() an object

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 11:33 AM, Christopher Lameter wrote: On Tue, 19 Dec 2017, rao.sho...@oracle.com wrote: This patch updates kfree_rcu to use new bulk memory free functions as they are more efficient. It also moves kfree_call_rcu() out of rcu related code to mm/slab_common.c It would be great to

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 11:33 AM, Christopher Lameter wrote: On Tue, 19 Dec 2017, rao.sho...@oracle.com wrote: This patch updates kfree_rcu to use new bulk memory free functions as they are more efficient. It also moves kfree_call_rcu() out of rcu related code to mm/slab_common.c It would be great to

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 11:30 AM, Matthew Wilcox wrote: On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: @@ -129,6 +130,7 @@ int __kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t nr, for (i = 0; i < nr; i++) { void *x = p[i] =

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 11:30 AM, Matthew Wilcox wrote: On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: @@ -129,6 +130,7 @@ int __kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t nr, for (i = 0; i < nr; i++) { void *x = p[i] =

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 11:12 AM, Matthew Wilcox wrote: On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: This patch updates kfree_rcu to use new bulk memory free functions as they are more efficient. It also moves kfree_call_rcu() out of rcu related code to mm/slab_common.c

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Rao Shoaib
On 12/19/2017 11:12 AM, Matthew Wilcox wrote: On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: This patch updates kfree_rcu to use new bulk memory free functions as they are more efficient. It also moves kfree_call_rcu() out of rcu related code to mm/slab_common.c

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Christopher Lameter
On Tue, 19 Dec 2017, rao.sho...@oracle.com wrote: > This patch updates kfree_rcu to use new bulk memory free functions as they > are more efficient. It also moves kfree_call_rcu() out of rcu related code to > mm/slab_common.c It would be great to have separate patches so that we can review it

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Christopher Lameter
On Tue, 19 Dec 2017, rao.sho...@oracle.com wrote: > This patch updates kfree_rcu to use new bulk memory free functions as they > are more efficient. It also moves kfree_call_rcu() out of rcu related code to > mm/slab_common.c It would be great to have separate patches so that we can review it

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: > diff --git a/mm/slab_common.c b/mm/slab_common.c > index c8cb367..06fd12c 100644 > --- a/mm/slab_common.c > +++ b/mm/slab_common.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > > #define

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Jesper Dangaard Brouer
On Tue, 19 Dec 2017 09:52:27 -0800 rao.sho...@oracle.com wrote: > diff --git a/mm/slab_common.c b/mm/slab_common.c > index c8cb367..06fd12c 100644 > --- a/mm/slab_common.c > +++ b/mm/slab_common.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > > #define

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Matthew Wilcox
On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: > @@ -129,6 +130,7 @@ int __kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t > flags, size_t nr, > > for (i = 0; i < nr; i++) { > void *x = p[i] = kmem_cache_alloc(s, flags); > + > if (!x)

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Matthew Wilcox
On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: > @@ -129,6 +130,7 @@ int __kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t > flags, size_t nr, > > for (i = 0; i < nr; i++) { > void *x = p[i] = kmem_cache_alloc(s, flags); > + > if (!x)

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Matthew Wilcox
On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: > This patch updates kfree_rcu to use new bulk memory free functions as they > are more efficient. It also moves kfree_call_rcu() out of rcu related code to > mm/slab_common.c > > Signed-off-by: Rao Shoaib

Re: [PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread Matthew Wilcox
On Tue, Dec 19, 2017 at 09:52:27AM -0800, rao.sho...@oracle.com wrote: > This patch updates kfree_rcu to use new bulk memory free functions as they > are more efficient. It also moves kfree_call_rcu() out of rcu related code to > mm/slab_common.c > > Signed-off-by: Rao Shoaib > --- >

[PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread rao . shoaib
From: Rao Shoaib This patch updates kfree_rcu to use new bulk memory free functions as they are more efficient. It also moves kfree_call_rcu() out of rcu related code to mm/slab_common.c Signed-off-by: Rao Shoaib --- include/linux/mm.h | 5 ++

[PATCH] kfree_rcu() should use the new kfree_bulk() interface for freeing rcu structures

2017-12-19 Thread rao . shoaib
From: Rao Shoaib This patch updates kfree_rcu to use new bulk memory free functions as they are more efficient. It also moves kfree_call_rcu() out of rcu related code to mm/slab_common.c Signed-off-by: Rao Shoaib --- include/linux/mm.h | 5 ++ kernel/rcu/tree.c | 14 kernel/sysctl.c