mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] rcu/sync: remove un-used rcu_sync_enter_start function
       [not found] <CGME20240111092805epcas5p2ebb993010ae31d039e8f9de1e7818f7c@epcas5p2.samsung.com>
@ 2024-01-11  9:27 ` Onkarnarth
  2024-01-16 16:50   ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: Onkarnarth @ 2024-01-11  9:27 UTC (permalink / raw)
  To: paulmck, frederic, quic_neeraju, joel, josh, boqun.feng, rostedt,
	mathieu.desnoyers, jiangshanlai, qiang.zhang1211
  Cc: rcu, linux-kernel, r.thapliyal, maninder1.s, onkarnath.1

From: Onkarnath <onkarnath.1@samsung.com>

With commit '6a010a49b63a ("cgroup: Make !percpu threadgroup_rwsem
operations optional")' usage of rcu_sync_enter_start is removed.

So this function can also be removed.

Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
---
 include/linux/rcu_sync.h |  1 -
 kernel/rcu/sync.c        | 16 ----------------
 2 files changed, 17 deletions(-)

diff --git a/include/linux/rcu_sync.h b/include/linux/rcu_sync.h
index 0027d4c8087c..3860dbb9107a 100644
--- a/include/linux/rcu_sync.h
+++ b/include/linux/rcu_sync.h
@@ -37,7 +37,6 @@ static inline bool rcu_sync_is_idle(struct rcu_sync *rsp)
 }
 
 extern void rcu_sync_init(struct rcu_sync *);
-extern void rcu_sync_enter_start(struct rcu_sync *);
 extern void rcu_sync_enter(struct rcu_sync *);
 extern void rcu_sync_exit(struct rcu_sync *);
 extern void rcu_sync_dtor(struct rcu_sync *);
diff --git a/kernel/rcu/sync.c b/kernel/rcu/sync.c
index e550f97779b8..86df878a2fee 100644
--- a/kernel/rcu/sync.c
+++ b/kernel/rcu/sync.c
@@ -24,22 +24,6 @@ void rcu_sync_init(struct rcu_sync *rsp)
 	init_waitqueue_head(&rsp->gp_wait);
 }
 
-/**
- * rcu_sync_enter_start - Force readers onto slow path for multiple updates
- * @rsp: Pointer to rcu_sync structure to use for synchronization
- *
- * Must be called after rcu_sync_init() and before first use.
- *
- * Ensures rcu_sync_is_idle() returns false and rcu_sync_{enter,exit}()
- * pairs turn into NO-OPs.
- */
-void rcu_sync_enter_start(struct rcu_sync *rsp)
-{
-	rsp->gp_count++;
-	rsp->gp_state = GP_PASSED;
-}
-
-
 static void rcu_sync_func(struct rcu_head *rhp);
 
 static void rcu_sync_call(struct rcu_sync *rsp)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] rcu/sync: remove un-used rcu_sync_enter_start function
  2024-01-11  9:27 ` [PATCH 1/1] rcu/sync: remove un-used rcu_sync_enter_start function Onkarnarth
@ 2024-01-16 16:50   ` Paul E. McKenney
  2024-01-16 18:10     ` Oleg Nesterov
  2024-01-16 18:14     ` Tejun Heo
  0 siblings, 2 replies; 5+ messages in thread
From: Paul E. McKenney @ 2024-01-16 16:50 UTC (permalink / raw)
  To: Onkarnarth
  Cc: frederic, quic_neeraju, joel, josh, boqun.feng, rostedt,
	mathieu.desnoyers, jiangshanlai, qiang.zhang1211, rcu,
	linux-kernel, r.thapliyal, maninder1.s, tj, oleg, peterz

On Thu, Jan 11, 2024 at 02:57:22PM +0530, Onkarnarth wrote:
> From: Onkarnath <onkarnath.1@samsung.com>
> 
> With commit '6a010a49b63a ("cgroup: Make !percpu threadgroup_rwsem
> operations optional")' usage of rcu_sync_enter_start is removed.
> 
> So this function can also be removed.
> 
> Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>

Adding Oleg, Peter, and Tejun for their thoughts.  Any objections?

							Thanx, Paul

> ---
>  include/linux/rcu_sync.h |  1 -
>  kernel/rcu/sync.c        | 16 ----------------
>  2 files changed, 17 deletions(-)
> 
> diff --git a/include/linux/rcu_sync.h b/include/linux/rcu_sync.h
> index 0027d4c8087c..3860dbb9107a 100644
> --- a/include/linux/rcu_sync.h
> +++ b/include/linux/rcu_sync.h
> @@ -37,7 +37,6 @@ static inline bool rcu_sync_is_idle(struct rcu_sync *rsp)
>  }
>  
>  extern void rcu_sync_init(struct rcu_sync *);
> -extern void rcu_sync_enter_start(struct rcu_sync *);
>  extern void rcu_sync_enter(struct rcu_sync *);
>  extern void rcu_sync_exit(struct rcu_sync *);
>  extern void rcu_sync_dtor(struct rcu_sync *);
> diff --git a/kernel/rcu/sync.c b/kernel/rcu/sync.c
> index e550f97779b8..86df878a2fee 100644
> --- a/kernel/rcu/sync.c
> +++ b/kernel/rcu/sync.c
> @@ -24,22 +24,6 @@ void rcu_sync_init(struct rcu_sync *rsp)
>  	init_waitqueue_head(&rsp->gp_wait);
>  }
>  
> -/**
> - * rcu_sync_enter_start - Force readers onto slow path for multiple updates
> - * @rsp: Pointer to rcu_sync structure to use for synchronization
> - *
> - * Must be called after rcu_sync_init() and before first use.
> - *
> - * Ensures rcu_sync_is_idle() returns false and rcu_sync_{enter,exit}()
> - * pairs turn into NO-OPs.
> - */
> -void rcu_sync_enter_start(struct rcu_sync *rsp)
> -{
> -	rsp->gp_count++;
> -	rsp->gp_state = GP_PASSED;
> -}
> -
> -
>  static void rcu_sync_func(struct rcu_head *rhp);
>  
>  static void rcu_sync_call(struct rcu_sync *rsp)
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] rcu/sync: remove un-used rcu_sync_enter_start function
  2024-01-16 16:50   ` Paul E. McKenney
@ 2024-01-16 18:10     ` Oleg Nesterov
  2024-01-16 19:10       ` Paul E. McKenney
  2024-01-16 18:14     ` Tejun Heo
  1 sibling, 1 reply; 5+ messages in thread
From: Oleg Nesterov @ 2024-01-16 18:10 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Onkarnarth, frederic, quic_neeraju, joel, josh, boqun.feng,
	rostedt, mathieu.desnoyers, jiangshanlai, qiang.zhang1211, rcu,
	linux-kernel, r.thapliyal, maninder1.s, tj, peterz

On 01/16, Paul E. McKenney wrote:
>
> On Thu, Jan 11, 2024 at 02:57:22PM +0530, Onkarnarth wrote:
> > From: Onkarnath <onkarnath.1@samsung.com>
> >
> > With commit '6a010a49b63a ("cgroup: Make !percpu threadgroup_rwsem
> > operations optional")' usage of rcu_sync_enter_start is removed.
> >
> > So this function can also be removed.
> >
> > Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
> > Signed-off-by: Maninder Singh <maninder1.s@samsung.com>

Acked-by: Oleg Nesterov <oleg@redhat.com>



For the record, this was already discussed, see
https://lore.kernel.org/all/20220725121208.GB28662@redhat.com/

Note also the patch in this message, __rcu_sync_enter(wait => false)
is a better alternative if someone needs rcu_sync_enter_start() again.

This patch probably makes sense anyway. Not only cgroup_favor_dynmods()
can use __rcu_sync_enter(), freeze_super() can use it too to avoid
3 synchronize_rcu()'s in a row.

Oleg.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] rcu/sync: remove un-used rcu_sync_enter_start function
  2024-01-16 16:50   ` Paul E. McKenney
  2024-01-16 18:10     ` Oleg Nesterov
@ 2024-01-16 18:14     ` Tejun Heo
  1 sibling, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2024-01-16 18:14 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Onkarnarth, frederic, quic_neeraju, joel, josh, boqun.feng,
	rostedt, mathieu.desnoyers, jiangshanlai, qiang.zhang1211, rcu,
	linux-kernel, r.thapliyal, maninder1.s, oleg, peterz

On Tue, Jan 16, 2024 at 08:50:35AM -0800, Paul E. McKenney wrote:
> On Thu, Jan 11, 2024 at 02:57:22PM +0530, Onkarnarth wrote:
> > From: Onkarnath <onkarnath.1@samsung.com>
> > 
> > With commit '6a010a49b63a ("cgroup: Make !percpu threadgroup_rwsem
> > operations optional")' usage of rcu_sync_enter_start is removed.
> > 
> > So this function can also be removed.
> > 
> > Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
> > Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> 
> Adding Oleg, Peter, and Tejun for their thoughts.  Any objections?

Looks good to me. FWIW,

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] rcu/sync: remove un-used rcu_sync_enter_start function
  2024-01-16 18:10     ` Oleg Nesterov
@ 2024-01-16 19:10       ` Paul E. McKenney
  0 siblings, 0 replies; 5+ messages in thread
From: Paul E. McKenney @ 2024-01-16 19:10 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: Onkarnarth, frederic, quic_neeraju, joel, josh, boqun.feng,
	rostedt, mathieu.desnoyers, jiangshanlai, qiang.zhang1211, rcu,
	linux-kernel, r.thapliyal, maninder1.s, tj, peterz

On Tue, Jan 16, 2024 at 07:10:59PM +0100, Oleg Nesterov wrote:
> On 01/16, Paul E. McKenney wrote:
> >
> > On Thu, Jan 11, 2024 at 02:57:22PM +0530, Onkarnarth wrote:
> > > From: Onkarnath <onkarnath.1@samsung.com>
> > >
> > > With commit '6a010a49b63a ("cgroup: Make !percpu threadgroup_rwsem
> > > operations optional")' usage of rcu_sync_enter_start is removed.
> > >
> > > So this function can also be removed.
> > >
> > > Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
> > > Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> 
> Acked-by: Oleg Nesterov <oleg@redhat.com>

Queued, thank you all!

> For the record, this was already discussed, see
> https://lore.kernel.org/all/20220725121208.GB28662@redhat.com/

I am clearly not keeping up.  ;-)

> Note also the patch in this message, __rcu_sync_enter(wait => false)
> is a better alternative if someone needs rcu_sync_enter_start() again.

Good to know!  I added this to the commit log, so please let me know
if this is in any way inappropriate:

------------------------------------------------------------------------

In the words of Oleg Nesterov:

	__rcu_sync_enter(wait => false) is a better alternative if
	someone needs rcu_sync_enter_start() again.

Link: https://lore.kernel.org/all/20220725121208.GB28662@redhat.com/

------------------------------------------------------------------------

> This patch probably makes sense anyway. Not only cgroup_favor_dynmods()
> can use __rcu_sync_enter(), freeze_super() can use it too to avoid
> 3 synchronize_rcu()'s in a row.

Thank you for the background information, much appreciated!

							Thanx, Paul

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-16 19:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20240111092805epcas5p2ebb993010ae31d039e8f9de1e7818f7c@epcas5p2.samsung.com>
2024-01-11  9:27 ` [PATCH 1/1] rcu/sync: remove un-used rcu_sync_enter_start function Onkarnarth
2024-01-16 16:50   ` Paul E. McKenney
2024-01-16 18:10     ` Oleg Nesterov
2024-01-16 19:10       ` Paul E. McKenney
2024-01-16 18:14     ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®