All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] md/raid5: simplify uninitialization of shrinker
@ 2017-12-23 18:20 Aliaksei Karaliou
  2018-02-17 20:34 ` Shaohua Li
  0 siblings, 1 reply; 2+ messages in thread
From: Aliaksei Karaliou @ 2017-12-23 18:20 UTC (permalink / raw)
  To: shli; +Cc: Aliaksei Karaliou, linux-raid

Don't use shrinker.nr_deferred to check whether shrinker was
initialized or not. Now this check was integrated into
unregister_shrinker(), so it is safe to call it against
unregistered shrinker.

Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>
---
 drivers/md/raid5.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 5a2a29bd02dd..8f985831b832 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -6764,9 +6764,7 @@ static void free_conf(struct r5conf *conf)
 
 	log_exit(conf);
 
-	if (conf->shrinker.nr_deferred)
-		unregister_shrinker(&conf->shrinker);
-
+	unregister_shrinker(&conf->shrinker);
 	free_thread_groups(conf);
 	shrink_stripes(conf);
 	raid5_free_percpu(conf);
-- 
2.11.0


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

* Re: [PATCH] md/raid5: simplify uninitialization of shrinker
  2017-12-23 18:20 [PATCH] md/raid5: simplify uninitialization of shrinker Aliaksei Karaliou
@ 2018-02-17 20:34 ` Shaohua Li
  0 siblings, 0 replies; 2+ messages in thread
From: Shaohua Li @ 2018-02-17 20:34 UTC (permalink / raw)
  To: Aliaksei Karaliou; +Cc: linux-raid

On Sat, Dec 23, 2017 at 09:20:31PM +0300, Aliaksei Karaliou wrote:
> Don't use shrinker.nr_deferred to check whether shrinker was
> initialized or not. Now this check was integrated into
> unregister_shrinker(), so it is safe to call it against
> unregistered shrinker.
> 
> Signed-off-by: Aliaksei Karaliou <akaraliou.dev@gmail.com>

applied, thanks!
> ---
>  drivers/md/raid5.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 5a2a29bd02dd..8f985831b832 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -6764,9 +6764,7 @@ static void free_conf(struct r5conf *conf)
>  
>  	log_exit(conf);
>  
> -	if (conf->shrinker.nr_deferred)
> -		unregister_shrinker(&conf->shrinker);
> -
> +	unregister_shrinker(&conf->shrinker);
>  	free_thread_groups(conf);
>  	shrink_stripes(conf);
>  	raid5_free_percpu(conf);
> -- 
> 2.11.0
> 

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

end of thread, other threads:[~2018-02-17 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-23 18:20 [PATCH] md/raid5: simplify uninitialization of shrinker Aliaksei Karaliou
2018-02-17 20:34 ` Shaohua Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.