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


Groups > linux.kernel > #1436143

[PATCH v2 7/8] mm/zsmalloc: add __init,__exit attribute

From Ganesh Mahendran <opensource.ganesh@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2 7/8] mm/zsmalloc: add __init,__exit attribute
Date 2016-07-04 09:00 +0200
Message-ID <rR61k-2jM-29@gated-at.bofh.it> (permalink)
References <rR61j-2jM-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
----
v2:
    add __init/__exit for zs_register_cpu_notifier/zs_unregister_cpu_notifier
---
 mm/zsmalloc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index df804b8..756f839 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1314,7 +1314,7 @@ static struct notifier_block zs_cpu_nb = {
 	.notifier_call = zs_cpu_notifier
 };
 
-static int zs_register_cpu_notifier(void)
+static int __init zs_register_cpu_notifier(void)
 {
 	int cpu, uninitialized_var(ret);
 
@@ -1331,7 +1331,7 @@ static int zs_register_cpu_notifier(void)
 	return notifier_to_errno(ret);
 }
 
-static void zs_unregister_cpu_notifier(void)
+static void __exit zs_unregister_cpu_notifier(void)
 {
 	int cpu;
 
@@ -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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/8] mm/zsmalloc: modify zs compact trace interface Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-04 09:00 +0200
  [PATCH v2 4/8] mm/zsmalloc: use class->objs_per_zspage to get num of max objects Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-04 09:00 +0200
  [PATCH v2 6/8] mm/zsmalloc: keep comments consistent with code Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-04 09:00 +0200
    Re: [PATCH v2 6/8] mm/zsmalloc: keep comments consistent with code Minchan Kim <minchan@kernel.org> - 2016-07-06 04:50 +0200
  [PATCH v2 5/8] mm/zsmalloc: avoid calculate max objects of zspage twice Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-04 09:00 +0200
    Re: [PATCH v2 5/8] mm/zsmalloc: avoid calculate max objects of  zspage twice Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-07-05 03:20 +0200
    Re: [PATCH v2 5/8] mm/zsmalloc: avoid calculate max objects of  zspage twice Minchan Kim <minchan@kernel.org> - 2016-07-06 04:50 +0200
  [PATCH v2 8/8] mm/zsmalloc: use helper to clear page->flags bit Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-04 09:00 +0200
    Re: [PATCH v2 8/8] mm/zsmalloc: use helper to clear page->flags bit Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-07-04 10:50 +0200
  [PATCH v2 2/8] mm/zsmalloc: use obj_index to keep consistent with others Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-04 09:00 +0200
    Re: [PATCH v2 2/8] mm/zsmalloc: use obj_index to keep consistent  with others Minchan Kim <minchan@kernel.org> - 2016-07-06 04:40 +0200
  [PATCH v2 7/8] mm/zsmalloc: add __init,__exit attribute Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-04 09:00 +0200
    Re: [PATCH v2 7/8] mm/zsmalloc: add __init,__exit attribute Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-07-04 10:50 +0200
      Re: [PATCH v2 7/8] mm/zsmalloc: add __init,__exit attribute Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-04 11:30 +0200
        Re: [PATCH v2 7/8] mm/zsmalloc: add __init,__exit attribute Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-07-05 03:10 +0200
          Re: [PATCH v2 7/8] mm/zsmalloc: add __init,__exit attribute Minchan Kim <minchan@kernel.org> - 2016-07-06 04:50 +0200
            Re: [PATCH v2 7/8] mm/zsmalloc: add __init,__exit attribute Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-06 08:30 +0200
  Re: [PATCH v2 1/8] mm/zsmalloc: modify zs compact trace interface Steven Rostedt <rostedt@goodmis.org> - 2016-07-05 19:00 +0200
  Re: [PATCH v2 1/8] mm/zsmalloc: modify zs compact trace interface Minchan Kim <minchan@kernel.org> - 2016-07-06 04:40 +0200
    Re: [PATCH v2 1/8] mm/zsmalloc: modify zs compact trace interface Ganesh Mahendran <opensource.ganesh@gmail.com> - 2016-07-06 08:30 +0200

csiph-web