Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1437472 > unrolled thread

[PATCH v3 6/8] mm/zsmalloc: add __init,__exit attribute

Started byGanesh Mahendran <opensource.ganesh@gmail.com>
First post2016-07-06 08:30 +0200
Last post2016-07-06 10:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 6/8] mm/zsmalloc: add __init,__exit attribute Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-06 08:30 +0200
    Re: [PATCH v3 6/8] mm/zsmalloc: add __init,__exit attribute kbuild test robot <lkp@intel.com> - 2016-07-06 10:10 +0200
    Re: [PATCH v3 6/8] mm/zsmalloc: add __init,__exit attribute Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-06 10:30 +0200

#1437472 — [PATCH v3 6/8] mm/zsmalloc: add __init,__exit attribute

FromGanesh Mahendran <opensource.ganesh@gmail.com>
Date2016-07-06 08:30 +0200
Subject[PATCH v3 6/8] mm/zsmalloc: add __init,__exit attribute
Message-ID<rROvo-5Cf-43@gated-at.bofh.it>
Add __init,__exit attribute for function that only called in
module init/exit to save memory.

Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
----
v3:
    revert change in v2 - Sergey
v2:
    add __init/__exit for zs_register_cpu_notifier/zs_unregister_cpu_notifier
---
 mm/zsmalloc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index ded312b..46526b9 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1344,7 +1344,7 @@ static void zs_unregister_cpu_notifier(void)
 	cpu_notifier_register_done();
 }
 
-static void init_zs_size_classes(void)
+static void __init init_zs_size_classes(void)
 {
 	int nr;
 
@@ -1887,7 +1887,7 @@ static struct file_system_type zsmalloc_fs = {
 	.kill_sb	= kill_anon_super,
 };
 
-static int zsmalloc_mount(void)
+static int __init zsmalloc_mount(void)
 {
 	int ret = 0;
 
@@ -1898,7 +1898,7 @@ static int zsmalloc_mount(void)
 	return ret;
 }
 
-static void zsmalloc_unmount(void)
+static void __exit zsmalloc_unmount(void)
 {
 	kern_unmount(zsmalloc_mnt);
 }
-- 
1.9.1

[toc] | [next] | [standalone]


#1437531

Fromkbuild test robot <lkp@intel.com>
Date2016-07-06 10:10 +0200
Message-ID<rRQ4a-6FO-33@gated-at.bofh.it>
In reply to#1437472

[Multipart message — attachments visible in raw view] — view raw

Hi,

[auto build test WARNING on next-20160705]
[cannot apply to tip/perf/core v4.7-rc6 v4.7-rc5 v4.7-rc4 v4.7-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Ganesh-Mahendran/mm-zsmalloc-use-obj_index-to-keep-consistent-with-others/20160706-150030
config: i386-randconfig-a0-201627 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

>> WARNING: mm/built-in.o(.init.text+0x4c3f): Section mismatch in reference from the function zs_init() to the function .exit.text:zsmalloc_unmount()
   The function __init zs_init() references
   a function __exit zsmalloc_unmount().
   This is often seen when error handling in the init function
   uses functionality in the exit path.
   The fix is often to remove the __exit annotation of
   zsmalloc_unmount() so it may be used outside an exit section.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1437539

FromGanesh Mahendran <opensource.ganesh@gmail.com>
Date2016-07-06 10:30 +0200
Message-ID<rRQnv-6Mg-11@gated-at.bofh.it>
In reply to#1437472
On Wed, Jul 06, 2016 at 02:23:51PM +0800, Ganesh Mahendran wrote:
> Add __init,__exit attribute for function that only called in
> module init/exit to save memory.
> 
> Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
> ----
> v3:
>     revert change in v2 - Sergey
> v2:
>     add __init/__exit for zs_register_cpu_notifier/zs_unregister_cpu_notifier
> ---
>  mm/zsmalloc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> index ded312b..46526b9 100644
> --- a/mm/zsmalloc.c
> +++ b/mm/zsmalloc.c
> @@ -1344,7 +1344,7 @@ static void zs_unregister_cpu_notifier(void)
>  	cpu_notifier_register_done();
>  }
>  
> -static void init_zs_size_classes(void)
> +static void __init init_zs_size_classes(void)
>  {
>  	int nr;
>  
> @@ -1887,7 +1887,7 @@ static struct file_system_type zsmalloc_fs = {
>  	.kill_sb	= kill_anon_super,
>  };
>  
> -static int zsmalloc_mount(void)
> +static int __init zsmalloc_mount(void)
>  {
>  	int ret = 0;
>  
> @@ -1898,7 +1898,7 @@ static int zsmalloc_mount(void)
>  	return ret;
>  }
>  
> -static void zsmalloc_unmount(void)
> +static void __exit zsmalloc_unmount(void)
>  {
>  	kern_unmount(zsmalloc_mnt);
>  }

Sorry, the __exit zsmalloc_umount is called in __init zs_init.

updated patch is :

---
From 0980a277158958210b671b79e9ddf98699dd6b50 Mon Sep 17 00:00:00 2001
From: Ganesh Mahendran <opensource.ganesh@gmail.com>
Date: Fri, 1 Jul 2016 14:05:50 +0800
Subject: [PATCH] mm/zsmalloc: add __init,__exit attribute

Add __init,__exit attribute for function that only called in
module init/exit to save memory.

Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
----
v4:
    remove __init/__exit for zsmalloc_mount/zsmalloc_umount
v3:
    revert change in v2 - Sergey
v2:
    add __init/__exit for zs_register_cpu_notifier/zs_unregister_cpu_notifier
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index ded312b..780eabd 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1344,7 +1344,7 @@ static void zs_unregister_cpu_notifier(void)
 	cpu_notifier_register_done();
 }
 
-static void init_zs_size_classes(void)
+static void __init init_zs_size_classes(void)
 {
 	int nr;
 
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web