All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Mahendran Ganesh <opensource.ganesh@gmail.com>,
	ngupta@vflare.org, ddstreet@ieee.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] mm/zsmalloc: avoid unregister a NOT-registered zsmalloc zpool driver
Date: Fri, 14 Nov 2014 08:29:09 +0900	[thread overview]
Message-ID: <20141113232909.GB8997@bbox> (raw)
In-Reply-To: <20141113223127.GA951@swordfish>

Hello Sergey,

On Fri, Nov 14, 2014 at 07:31:27AM +0900, Sergey Senozhatsky wrote:
> On (11/14/14 00:30), Sergey Senozhatsky wrote:
> > Factor out zsmalloc cpu notifier unregistration code and call
> > it from both zs_exit() and zs_init() error path.
> 
> I should had have a good sleep before posting this.
> shame on me!
> 
> v3
> 
> Signed-ogg-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

Looks good to me. a nitpick.
Could you factor out cpu register part as well as cpu unregister, too?
Then, please resend it with formal description and includes reported-by.

Thanks.

> 
> ---
> 
>  mm/zsmalloc.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> index b3b57ef..cd4efa1 100644
> --- a/mm/zsmalloc.c
> +++ b/mm/zsmalloc.c
> @@ -881,14 +881,10 @@ static struct notifier_block zs_cpu_nb = {
>  	.notifier_call = zs_cpu_notifier
>  };
>  
> -static void zs_exit(void)
> +static void zs_unregister_cpu_notifier(void)
>  {
>  	int cpu;
>  
> -#ifdef CONFIG_ZPOOL
> -	zpool_unregister_driver(&zs_zpool_driver);
> -#endif
> -
>  	cpu_notifier_register_begin();
>  
>  	for_each_online_cpu(cpu)
> @@ -898,6 +894,14 @@ static void zs_exit(void)
>  	cpu_notifier_register_done();
>  }
>  
> +static void zs_exit(void)
> +{
> +#ifdef CONFIG_ZPOOL
> +	zpool_unregister_driver(&zs_zpool_driver);
> +#endif
> +	zs_unregister_cpu_notifier();
> +}
> +
>  static int zs_init(void)
>  {
>  	int cpu, ret;
> @@ -921,7 +925,7 @@ static int zs_init(void)
>  
>  	return 0;
>  fail:
> -	zs_exit();
> +	zs_unregister_cpu_notifier();
>  	return notifier_to_errno(ret);
>  }
>  
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

-- 
Kind regards,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Minchan Kim <minchan@kernel.org>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Mahendran Ganesh <opensource.ganesh@gmail.com>,
	ngupta@vflare.org, ddstreet@ieee.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] mm/zsmalloc: avoid unregister a NOT-registered zsmalloc zpool driver
Date: Fri, 14 Nov 2014 08:29:09 +0900	[thread overview]
Message-ID: <20141113232909.GB8997@bbox> (raw)
In-Reply-To: <20141113223127.GA951@swordfish>

Hello Sergey,

On Fri, Nov 14, 2014 at 07:31:27AM +0900, Sergey Senozhatsky wrote:
> On (11/14/14 00:30), Sergey Senozhatsky wrote:
> > Factor out zsmalloc cpu notifier unregistration code and call
> > it from both zs_exit() and zs_init() error path.
> 
> I should had have a good sleep before posting this.
> shame on me!
> 
> v3
> 
> Signed-ogg-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

Looks good to me. a nitpick.
Could you factor out cpu register part as well as cpu unregister, too?
Then, please resend it with formal description and includes reported-by.

Thanks.

> 
> ---
> 
>  mm/zsmalloc.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> index b3b57ef..cd4efa1 100644
> --- a/mm/zsmalloc.c
> +++ b/mm/zsmalloc.c
> @@ -881,14 +881,10 @@ static struct notifier_block zs_cpu_nb = {
>  	.notifier_call = zs_cpu_notifier
>  };
>  
> -static void zs_exit(void)
> +static void zs_unregister_cpu_notifier(void)
>  {
>  	int cpu;
>  
> -#ifdef CONFIG_ZPOOL
> -	zpool_unregister_driver(&zs_zpool_driver);
> -#endif
> -
>  	cpu_notifier_register_begin();
>  
>  	for_each_online_cpu(cpu)
> @@ -898,6 +894,14 @@ static void zs_exit(void)
>  	cpu_notifier_register_done();
>  }
>  
> +static void zs_exit(void)
> +{
> +#ifdef CONFIG_ZPOOL
> +	zpool_unregister_driver(&zs_zpool_driver);
> +#endif
> +	zs_unregister_cpu_notifier();
> +}
> +
>  static int zs_init(void)
>  {
>  	int cpu, ret;
> @@ -921,7 +925,7 @@ static int zs_init(void)
>  
>  	return 0;
>  fail:
> -	zs_exit();
> +	zs_unregister_cpu_notifier();
>  	return notifier_to_errno(ret);
>  }
>  
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

-- 
Kind regards,
Minchan Kim

  reply	other threads:[~2014-11-13 23:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 13:37 [PATCH 1/3] mm/zsmalloc: avoid unregister a NOT-registered zsmalloc zpool driver Mahendran Ganesh
2014-11-13 13:37 ` Mahendran Ganesh
2014-11-13 13:37 ` [PATCH 2/3] mm/zsmalloc: add __init/__exit to zs_init/zs_exit Mahendran Ganesh
2014-11-13 13:37   ` Mahendran Ganesh
2014-11-14 12:59   ` Sergey Senozhatsky
2014-11-14 12:59     ` Sergey Senozhatsky
2014-11-13 13:37 ` [PATCH 3/3] mm/zsmalloc: adjust zs_init/zs_exit location Mahendran Ganesh
2014-11-13 13:37   ` Mahendran Ganesh
2014-11-13 15:22 ` [PATCH 1/3] mm/zsmalloc: avoid unregister a NOT-registered zsmalloc zpool driver Sergey Senozhatsky
2014-11-13 15:22   ` Sergey Senozhatsky
2014-11-13 15:30   ` Sergey Senozhatsky
2014-11-13 15:30     ` Sergey Senozhatsky
2014-11-13 22:31     ` Sergey Senozhatsky
2014-11-13 22:31       ` Sergey Senozhatsky
2014-11-13 23:29       ` Minchan Kim [this message]
2014-11-13 23:29         ` Minchan Kim
2014-11-13 23:38   ` Ganesh Mahendran
2014-11-13 23:38     ` Ganesh Mahendran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141113232909.GB8997@bbox \
    --to=minchan@kernel.org \
    --cc=ddstreet@ieee.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ngupta@vflare.org \
    --cc=opensource.ganesh@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.