* [PATCH 01/10] mm: make cleancache.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
2015-08-25 0:10 ` Konrad Rzeszutek Wilk
2015-08-24 22:14 ` [PATCH 02/10] mm: make slab_common.c " Paul Gortmaker
` (8 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Paul Gortmaker, Konrad Rzeszutek Wilk
The Kconfig currently controlling compilation of this code is:
config CLEANCACHE
bool "Enable cleancache driver to cache clean pages if tmem is present"
...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
driver there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/cleancache.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/cleancache.c b/mm/cleancache.c
index 8fc50811119b..ee0646d1c2fa 100644
--- a/mm/cleancache.c
+++ b/mm/cleancache.c
@@ -11,7 +11,7 @@
* This work is licensed under the terms of the GNU GPL, version 2.
*/
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/fs.h>
#include <linux/exportfs.h>
#include <linux/mm.h>
@@ -316,4 +316,4 @@ static int __init init_cleancache(void)
#endif
return 0;
}
-module_init(init_cleancache)
+device_initcall(init_cleancache)
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 01/10] mm: make cleancache.c explicitly non-modular
2015-08-24 22:14 ` [PATCH 01/10] mm: make cleancache.c explicitly non-modular Paul Gortmaker
@ 2015-08-25 0:10 ` Konrad Rzeszutek Wilk
2015-08-25 1:10 ` Paul Gortmaker
0 siblings, 1 reply; 19+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-08-25 0:10 UTC (permalink / raw)
To: Paul Gortmaker, Andrew Morton; +Cc: linux-mm, linux-kernel
On August 24, 2015 6:14:33 PM EDT, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
>The Kconfig currently controlling compilation of this code is:
>
>config CLEANCACHE
>bool "Enable cleancache driver to cache clean pages if tmem is present"
>
>...meaning that it currently is not being built as a module by anyone.
Why not make it a tristate?
>
>Lets remove the couple traces of modularity so that when reading the
>driver there is no doubt it is builtin-only.
>
>Since module_init translates to device_initcall in the non-modular
>case, the init ordering remains unchanged with this commit.
>
>Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>Cc: linux-mm@kvack.org
>Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>---
> mm/cleancache.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/mm/cleancache.c b/mm/cleancache.c
>index 8fc50811119b..ee0646d1c2fa 100644
>--- a/mm/cleancache.c
>+++ b/mm/cleancache.c
>@@ -11,7 +11,7 @@
> * This work is licensed under the terms of the GNU GPL, version 2.
> */
>
>-#include <linux/module.h>
>+#include <linux/init.h>
> #include <linux/fs.h>
> #include <linux/exportfs.h>
> #include <linux/mm.h>
>@@ -316,4 +316,4 @@ static int __init init_cleancache(void)
> #endif
> return 0;
> }
>-module_init(init_cleancache)
>+device_initcall(init_cleancache)
--
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>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 01/10] mm: make cleancache.c explicitly non-modular
2015-08-25 0:10 ` Konrad Rzeszutek Wilk
@ 2015-08-25 1:10 ` Paul Gortmaker
2015-09-22 15:20 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-25 1:10 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: Andrew Morton, linux-mm, linux-kernel
[Re: [PATCH 01/10] mm: make cleancache.c explicitly non-modular] On 24/08/2015 (Mon 20:10) Konrad Rzeszutek Wilk wrote:
> On August 24, 2015 6:14:33 PM EDT, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
> >The Kconfig currently controlling compilation of this code is:
> >
> >config CLEANCACHE
> >bool "Enable cleancache driver to cache clean pages if tmem is present"
> >
> >...meaning that it currently is not being built as a module by anyone.
>
> Why not make it a tristate?
Simple. I'm making the code consistent with its current behaviour.
I'm not looking to extend functionality in code that I don't know
intimately. I can't do that and do it reliably and guarantee it
works as a module when it has never been used as such before.
I've got about 130 of these and counting. Some of them have been bool
since before git history ; before the turn of the century. If there was
demand for them to be tristate, then it would have happened by now. So
clearly there is no point in looking at making _those_ tristate.
I did have one uart driver author indicate that he _meant_ his code to
be tristate, and he tested it as such, and asked if I would convert it
to tristate on his behalf. And that was fine and I did exactly that.
But unless there are interested users who want their code tristate and
can vouch that their code works OK as such, I can only make the code
consistent with the implicit non-modular behaviour that the Kconfig and
Makefiles have dictated up to now. Are there such users for CLEANCACHE?
Paul.
--
>
>
> >
> >Lets remove the couple traces of modularity so that when reading the
> >driver there is no doubt it is builtin-only.
> >
> >Since module_init translates to device_initcall in the non-modular
> >case, the init ordering remains unchanged with this commit.
> >
> >Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> >Cc: linux-mm@kvack.org
> >Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> >---
> > mm/cleancache.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/mm/cleancache.c b/mm/cleancache.c
> >index 8fc50811119b..ee0646d1c2fa 100644
> >--- a/mm/cleancache.c
> >+++ b/mm/cleancache.c
> >@@ -11,7 +11,7 @@
> > * This work is licensed under the terms of the GNU GPL, version 2.
> > */
> >
> >-#include <linux/module.h>
> >+#include <linux/init.h>
> > #include <linux/fs.h>
> > #include <linux/exportfs.h>
> > #include <linux/mm.h>
> >@@ -316,4 +316,4 @@ static int __init init_cleancache(void)
> > #endif
> > return 0;
> > }
> >-module_init(init_cleancache)
> >+device_initcall(init_cleancache)
>
>
--
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>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 01/10] mm: make cleancache.c explicitly non-modular
2015-08-25 1:10 ` Paul Gortmaker
@ 2015-09-22 15:20 ` Konrad Rzeszutek Wilk
2015-09-22 21:28 ` Paul Gortmaker
0 siblings, 1 reply; 19+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-09-22 15:20 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: Andrew Morton, linux-mm, linux-kernel
On Mon, Aug 24, 2015 at 09:10:40PM -0400, Paul Gortmaker wrote:
> [Re: [PATCH 01/10] mm: make cleancache.c explicitly non-modular] On 24/08/2015 (Mon 20:10) Konrad Rzeszutek Wilk wrote:
>
> > On August 24, 2015 6:14:33 PM EDT, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
> > >The Kconfig currently controlling compilation of this code is:
> > >
> > >config CLEANCACHE
> > >bool "Enable cleancache driver to cache clean pages if tmem is present"
> > >
> > >...meaning that it currently is not being built as a module by anyone.
> >
> > Why not make it a tristate?
>
> Simple. I'm making the code consistent with its current behaviour.
> I'm not looking to extend functionality in code that I don't know
> intimately. I can't do that and do it reliably and guarantee it
> works as a module when it has never been used as such before.
>
> I've got about 130 of these and counting. Some of them have been bool
> since before git history ; before the turn of the century. If there was
> demand for them to be tristate, then it would have happened by now. So
> clearly there is no point in looking at making _those_ tristate.
>
> I did have one uart driver author indicate that he _meant_ his code to
> be tristate, and he tested it as such, and asked if I would convert it
> to tristate on his behalf. And that was fine and I did exactly that.
>
> But unless there are interested users who want their code tristate and
> can vouch that their code works OK as such, I can only make the code
> consistent with the implicit non-modular behaviour that the Kconfig and
> Makefiles have dictated up to now. Are there such users for CLEANCACHE?
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Sorry for taking so long. It really cannot be tri-state (I tried
making it an module) as the cleancache hooks are tied in the mm/filemap.c.
>
> Paul.
> --
>
> >
> >
> > >
> > >Lets remove the couple traces of modularity so that when reading the
> > >driver there is no doubt it is builtin-only.
> > >
> > >Since module_init translates to device_initcall in the non-modular
> > >case, the init ordering remains unchanged with this commit.
> > >
> > >Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > >Cc: linux-mm@kvack.org
> > >Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > >---
> > > mm/cleancache.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > >diff --git a/mm/cleancache.c b/mm/cleancache.c
> > >index 8fc50811119b..ee0646d1c2fa 100644
> > >--- a/mm/cleancache.c
> > >+++ b/mm/cleancache.c
> > >@@ -11,7 +11,7 @@
> > > * This work is licensed under the terms of the GNU GPL, version 2.
> > > */
> > >
> > >-#include <linux/module.h>
> > >+#include <linux/init.h>
> > > #include <linux/fs.h>
> > > #include <linux/exportfs.h>
> > > #include <linux/mm.h>
> > >@@ -316,4 +316,4 @@ static int __init init_cleancache(void)
> > > #endif
> > > return 0;
> > > }
> > >-module_init(init_cleancache)
> > >+device_initcall(init_cleancache)
> >
> >
--
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>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 01/10] mm: make cleancache.c explicitly non-modular
2015-09-22 15:20 ` Konrad Rzeszutek Wilk
@ 2015-09-22 21:28 ` Paul Gortmaker
0 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2015-09-22 21:28 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: Andrew Morton, linux-mm, linux-kernel
[Re: [PATCH 01/10] mm: make cleancache.c explicitly non-modular] On 22/09/2015 (Tue 11:20) Konrad Rzeszutek Wilk wrote:
> On Mon, Aug 24, 2015 at 09:10:40PM -0400, Paul Gortmaker wrote:
> > [Re: [PATCH 01/10] mm: make cleancache.c explicitly non-modular] On 24/08/2015 (Mon 20:10) Konrad Rzeszutek Wilk wrote:
> >
> > > On August 24, 2015 6:14:33 PM EDT, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
> > > >The Kconfig currently controlling compilation of this code is:
> > > >
> > > >config CLEANCACHE
> > > >bool "Enable cleancache driver to cache clean pages if tmem is present"
> > > >
> > > >...meaning that it currently is not being built as a module by anyone.
> > >
> > > Why not make it a tristate?
> >
> > Simple. I'm making the code consistent with its current behaviour.
> > I'm not looking to extend functionality in code that I don't know
> > intimately. I can't do that and do it reliably and guarantee it
> > works as a module when it has never been used as such before.
> >
> > I've got about 130 of these and counting. Some of them have been bool
> > since before git history ; before the turn of the century. If there was
> > demand for them to be tristate, then it would have happened by now. So
> > clearly there is no point in looking at making _those_ tristate.
> >
> > I did have one uart driver author indicate that he _meant_ his code to
> > be tristate, and he tested it as such, and asked if I would convert it
> > to tristate on his behalf. And that was fine and I did exactly that.
> >
> > But unless there are interested users who want their code tristate and
> > can vouch that their code works OK as such, I can only make the code
> > consistent with the implicit non-modular behaviour that the Kconfig and
> > Makefiles have dictated up to now. Are there such users for CLEANCACHE?
>
> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
> Sorry for taking so long. It really cannot be tri-state (I tried
> making it an module) as the cleancache hooks are tied in the mm/filemap.c.
No problem, AFAIK these aren't queued anywhere and after having done a
wider sweep, there are some 300+ of them (that give a net removal of ~5k
lines of dead code) with some in maintainer-less code; so it looks like
I'll inevitably have residuals that I'll have to ask Linus to pull directly.
Anyway, thanks for trying to modularize it. I'll add the reviewed tags
and update the commit log on the other one to add your comment.
Paul.
--
>
> >
> > Paul.
> > --
> >
> > >
> > >
> > > >
> > > >Lets remove the couple traces of modularity so that when reading the
> > > >driver there is no doubt it is builtin-only.
> > > >
> > > >Since module_init translates to device_initcall in the non-modular
> > > >case, the init ordering remains unchanged with this commit.
> > > >
> > > >Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > > >Cc: linux-mm@kvack.org
> > > >Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > > >---
> > > > mm/cleancache.c | 4 ++--
> > > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > >diff --git a/mm/cleancache.c b/mm/cleancache.c
> > > >index 8fc50811119b..ee0646d1c2fa 100644
> > > >--- a/mm/cleancache.c
> > > >+++ b/mm/cleancache.c
> > > >@@ -11,7 +11,7 @@
> > > > * This work is licensed under the terms of the GNU GPL, version 2.
> > > > */
> > > >
> > > >-#include <linux/module.h>
> > > >+#include <linux/init.h>
> > > > #include <linux/fs.h>
> > > > #include <linux/exportfs.h>
> > > > #include <linux/mm.h>
> > > >@@ -316,4 +316,4 @@ static int __init init_cleancache(void)
> > > > #endif
> > > > return 0;
> > > > }
> > > >-module_init(init_cleancache)
> > > >+device_initcall(init_cleancache)
> > >
> > >
--
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>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 02/10] mm: make slab_common.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
2015-08-24 22:14 ` [PATCH 01/10] mm: make cleancache.c explicitly non-modular Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
2015-08-25 14:59 ` Christoph Lameter
2015-08-24 22:14 ` [PATCH 03/10] mm: make hugetlb.c " Paul Gortmaker
` (7 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Paul Gortmaker, Christoph Lameter,
Pekka Enberg, David Rientjes, Joonsoo Kim
The Makefile currently controlling compilation of this code is obj-y
meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
code there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. However
one could argue that subsys_initcall() might make more sense here.
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/slab_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 5ce4faeb16fb..a27aff8d7cdc 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -10,7 +10,7 @@
#include <linux/interrupt.h>
#include <linux/memory.h>
#include <linux/compiler.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/cpu.h>
#include <linux/uaccess.h>
#include <linux/seq_file.h>
@@ -1113,7 +1113,7 @@ static int __init slab_proc_init(void)
&proc_slabinfo_operations);
return 0;
}
-module_init(slab_proc_init);
+device_initcall(slab_proc_init);
#endif /* CONFIG_SLABINFO */
static __always_inline void *__do_krealloc(const void *p, size_t new_size,
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 02/10] mm: make slab_common.c explicitly non-modular
2015-08-24 22:14 ` [PATCH 02/10] mm: make slab_common.c " Paul Gortmaker
@ 2015-08-25 14:59 ` Christoph Lameter
2015-08-25 15:33 ` Paul Gortmaker
0 siblings, 1 reply; 19+ messages in thread
From: Christoph Lameter @ 2015-08-25 14:59 UTC (permalink / raw)
To: Paul Gortmaker
Cc: Andrew Morton, linux-mm, linux-kernel, Pekka Enberg,
David Rientjes, Joonsoo Kim
On Mon, 24 Aug 2015, Paul Gortmaker wrote:
> @@ -1113,7 +1113,7 @@ static int __init slab_proc_init(void)
> &proc_slabinfo_operations);
> return 0;
> }
> -module_init(slab_proc_init);
> +device_initcall(slab_proc_init);
> #endif /* CONFIG_SLABINFO */
>
> static __always_inline void *__do_krealloc(const void *p, size_t new_size,
True memory management is not a module. But its also not a device.
--
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>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 02/10] mm: make slab_common.c explicitly non-modular
2015-08-25 14:59 ` Christoph Lameter
@ 2015-08-25 15:33 ` Paul Gortmaker
0 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-25 15:33 UTC (permalink / raw)
To: Christoph Lameter
Cc: Andrew Morton, linux-mm, linux-kernel, Pekka Enberg,
David Rientjes, Joonsoo Kim
On 2015-08-25 10:59 AM, Christoph Lameter wrote:
> On Mon, 24 Aug 2015, Paul Gortmaker wrote:
>
>> @@ -1113,7 +1113,7 @@ static int __init slab_proc_init(void)
>> &proc_slabinfo_operations);
>> return 0;
>> }
>> -module_init(slab_proc_init);
>> +device_initcall(slab_proc_init);
>> #endif /* CONFIG_SLABINFO */
>>
>> static __always_inline void *__do_krealloc(const void *p, size_t new_size,
>
> True memory management is not a module. But its also not a device.
Per the 0/N I'd rather make it equivalent to what it was already
at this point in time and then consider making it a core_initcall
or post_core early in the next dev cycle if we want to give it
a more appropriately matching category, so we can then watch for
init reordering fallout with more time on our hands.
--
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>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 03/10] mm: make hugetlb.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
2015-08-24 22:14 ` [PATCH 01/10] mm: make cleancache.c explicitly non-modular Paul Gortmaker
2015-08-24 22:14 ` [PATCH 02/10] mm: make slab_common.c " Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
2015-08-26 16:47 ` Mike Kravetz
2015-08-24 22:14 ` [PATCH 04/10] mm: make vmscan.c " Paul Gortmaker
` (6 subsequent siblings)
9 siblings, 1 reply; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Paul Gortmaker, Naoya Horiguchi,
Mike Kravetz, David Rientjes, Hillf Danton, Davidlohr Bueso
The Kconfig currently controlling compilation of this code is:
config HUGETLBFS
bool "HugeTLB file system support"
...meaning that it currently is not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the file there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. However
one could argue that fs_initcall() would make more sense here.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/hugetlb.c | 39 +--------------------------------------
1 file changed, 1 insertion(+), 38 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 586aa69df900..1154152c8b99 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4,7 +4,6 @@
*/
#include <linux/list.h>
#include <linux/init.h>
-#include <linux/module.h>
#include <linux/mm.h>
#include <linux/seq_file.h>
#include <linux/sysctl.h>
@@ -2439,25 +2438,6 @@ static void hugetlb_unregister_node(struct node *node)
nhs->hugepages_kobj = NULL;
}
-/*
- * hugetlb module exit: unregister hstate attributes from node devices
- * that have them.
- */
-static void hugetlb_unregister_all_nodes(void)
-{
- int nid;
-
- /*
- * disable node device registrations.
- */
- register_hugetlbfs_with_node(NULL, NULL);
-
- /*
- * remove hstate attributes from any nodes that have them.
- */
- for (nid = 0; nid < nr_node_ids; nid++)
- hugetlb_unregister_node(node_devices[nid]);
-}
/*
* Register hstate attributes for a single node device.
@@ -2522,27 +2502,10 @@ static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp)
return NULL;
}
-static void hugetlb_unregister_all_nodes(void) { }
-
static void hugetlb_register_all_nodes(void) { }
#endif
-static void __exit hugetlb_exit(void)
-{
- struct hstate *h;
-
- hugetlb_unregister_all_nodes();
-
- for_each_hstate(h) {
- kobject_put(hstate_kobjs[hstate_index(h)]);
- }
-
- kobject_put(hugepages_kobj);
- kfree(hugetlb_fault_mutex_table);
-}
-module_exit(hugetlb_exit);
-
static int __init hugetlb_init(void)
{
int i;
@@ -2580,7 +2543,7 @@ static int __init hugetlb_init(void)
mutex_init(&hugetlb_fault_mutex_table[i]);
return 0;
}
-module_init(hugetlb_init);
+device_initcall(hugetlb_init);
/* Should be called on processing a hugepagesz=... option */
void __init hugetlb_add_hstate(unsigned order)
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 03/10] mm: make hugetlb.c explicitly non-modular
2015-08-24 22:14 ` [PATCH 03/10] mm: make hugetlb.c " Paul Gortmaker
@ 2015-08-26 16:47 ` Mike Kravetz
0 siblings, 0 replies; 19+ messages in thread
From: Mike Kravetz @ 2015-08-26 16:47 UTC (permalink / raw)
To: Paul Gortmaker, Andrew Morton
Cc: linux-mm, linux-kernel, Naoya Horiguchi, David Rientjes,
Hillf Danton, Davidlohr Bueso
On 08/24/2015 03:14 PM, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
>
> config HUGETLBFS
> bool "HugeTLB file system support"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the file there is no doubt it is builtin-only.
>
> Since module_init translates to device_initcall in the non-modular
> case, the init ordering remains unchanged with this commit. However
> one could argue that fs_initcall() would make more sense here.
I would prefer that it NOT be changed to fs_initcall() as this is more
about generic mm code than fs code. If this was in a hugetlbfs specific
file, fs_initcall() might make more sense.
More about changing initcall below.
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> Cc: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
> Cc: Davidlohr Bueso <dave@stgolabs.net>
> Cc: linux-mm@kvack.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> mm/hugetlb.c | 39 +--------------------------------------
> 1 file changed, 1 insertion(+), 38 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 586aa69df900..1154152c8b99 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -4,7 +4,6 @@
> */
> #include <linux/list.h>
> #include <linux/init.h>
> -#include <linux/module.h>
> #include <linux/mm.h>
> #include <linux/seq_file.h>
> #include <linux/sysctl.h>
> @@ -2439,25 +2438,6 @@ static void hugetlb_unregister_node(struct node *node)
> nhs->hugepages_kobj = NULL;
> }
>
> -/*
> - * hugetlb module exit: unregister hstate attributes from node devices
> - * that have them.
> - */
> -static void hugetlb_unregister_all_nodes(void)
> -{
> - int nid;
> -
> - /*
> - * disable node device registrations.
> - */
> - register_hugetlbfs_with_node(NULL, NULL);
> -
> - /*
> - * remove hstate attributes from any nodes that have them.
> - */
> - for (nid = 0; nid < nr_node_ids; nid++)
> - hugetlb_unregister_node(node_devices[nid]);
> -}
>
> /*
> * Register hstate attributes for a single node device.
> @@ -2522,27 +2502,10 @@ static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp)
> return NULL;
> }
>
> -static void hugetlb_unregister_all_nodes(void) { }
> -
> static void hugetlb_register_all_nodes(void) { }
>
> #endif
>
> -static void __exit hugetlb_exit(void)
> -{
> - struct hstate *h;
> -
> - hugetlb_unregister_all_nodes();
> -
> - for_each_hstate(h) {
> - kobject_put(hstate_kobjs[hstate_index(h)]);
> - }
> -
> - kobject_put(hugepages_kobj);
> - kfree(hugetlb_fault_mutex_table);
> -}
> -module_exit(hugetlb_exit);
> -
> static int __init hugetlb_init(void)
> {
> int i;
> @@ -2580,7 +2543,7 @@ static int __init hugetlb_init(void)
> mutex_init(&hugetlb_fault_mutex_table[i]);
> return 0;
> }
I am all for removal of the module_exit and associated code. It is
dead and is not used today. It would be a good idea to remove this
in any case.
> -module_init(hugetlb_init);
> +device_initcall(hugetlb_init);
Other more experienced people have opinions on your staged approach
to changing these init calls. If the consensus is to take this
approach, I would have no objections.
--
Mike Kravetz
>
> /* Should be called on processing a hugepagesz=... option */
> void __init hugetlb_add_hstate(unsigned order)
>
--
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>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 04/10] mm: make vmscan.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
` (2 preceding siblings ...)
2015-08-24 22:14 ` [PATCH 03/10] mm: make hugetlb.c " Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
2015-08-24 22:14 ` [PATCH 05/10] mm: make page_alloc.c " Paul Gortmaker
` (5 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Paul Gortmaker, Michal Hocko,
Johannes Weiner, Vladimir Davydov, Mel Gorman
The Makefile currently controlling compilation of this code is obj-y
meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
code there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. However
one could argue that subsys_initcall() might make more sense.
We don't replace module.h with init.h since the file already has that.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/vmscan.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 110733a715f6..dd0b58ff3938 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -14,7 +14,6 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/mm.h>
-#include <linux/module.h>
#include <linux/gfp.h>
#include <linux/kernel_stat.h>
#include <linux/swap.h>
@@ -3687,8 +3686,7 @@ static int __init kswapd_init(void)
hotcpu_notifier(cpu_callback, 0);
return 0;
}
-
-module_init(kswapd_init)
+device_initcall(kswapd_init)
#ifdef CONFIG_NUMA
/*
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 05/10] mm: make page_alloc.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
` (3 preceding siblings ...)
2015-08-24 22:14 ` [PATCH 04/10] mm: make vmscan.c " Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
2015-08-24 22:14 ` [PATCH 06/10] mm: make vmstat.c " Paul Gortmaker
` (4 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Paul Gortmaker, Mel Gorman,
Vlastimil Babka, David Rientjes, Michal Hocko, Joonsoo Kim,
Johannes Weiner, Sasha Levin
The Makefile currently controlling compilation of this code is obj-y
meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
driver there is no doubt it is builtin-only. We have to leave the
module.h include though, as the file uses print_modules().
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. However
one could argue that subsys_initcall() would make more sense.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/page_alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c1024db4ac5f..b02c511320fa 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6327,7 +6327,7 @@ int __meminit init_per_zone_wmark_min(void)
setup_per_zone_inactive_ratio();
return 0;
}
-module_init(init_per_zone_wmark_min)
+device_initcall(init_per_zone_wmark_min)
/*
* min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 06/10] mm: make vmstat.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
` (4 preceding siblings ...)
2015-08-24 22:14 ` [PATCH 05/10] mm: make page_alloc.c " Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
2015-08-24 22:14 ` [PATCH 07/10] mm: make workingset.c " Paul Gortmaker
` (3 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Paul Gortmaker, Christoph Lameter,
Johannes Weiner, Mel Gorman, Michal Hocko, Davidlohr Bueso,
Minchan Kim, Joonsoo Kim
The Makefile currently controlling compilation of this code is obj-y
meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
code there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. However
one could argue that subsys_initcall might make more sense here.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/vmstat.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 1fd0886a389f..e6cd18cc4d75 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -12,7 +12,7 @@
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/err.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/slab.h>
#include <linux/cpu.h>
#include <linux/cpumask.h>
@@ -1536,7 +1536,7 @@ static int __init setup_vmstat(void)
#endif
return 0;
}
-module_init(setup_vmstat)
+device_initcall(setup_vmstat)
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_COMPACTION)
@@ -1695,6 +1695,5 @@ fail:
debugfs_remove_recursive(extfrag_debug_root);
return -ENOMEM;
}
-
-module_init(extfrag_debug_init);
+device_initcall(extfrag_debug_init);
#endif
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 07/10] mm: make workingset.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
` (5 preceding siblings ...)
2015-08-24 22:14 ` [PATCH 06/10] mm: make vmstat.c " Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
2015-08-24 22:14 ` [PATCH 08/10] mm: make vmalloc.c " Paul Gortmaker
` (2 subsequent siblings)
9 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm, linux-kernel, Paul Gortmaker, Vladimir Davydov
The Makefile currently controlling compilation of this code is obj-y
meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
code there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. However
one could argue that subsys_initcall might make more sense here.
Cc: Vladimir Davydov <vdavydov@parallels.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/workingset.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/workingset.c b/mm/workingset.c
index aa017133744b..c2c59f599610 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -8,7 +8,7 @@
#include <linux/writeback.h>
#include <linux/pagemap.h>
#include <linux/atomic.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/swap.h>
#include <linux/fs.h>
#include <linux/mm.h>
@@ -412,4 +412,4 @@ err_list_lru:
err:
return ret;
}
-module_init(workingset_init);
+device_initcall(workingset_init);
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 08/10] mm: make vmalloc.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
` (6 preceding siblings ...)
2015-08-24 22:14 ` [PATCH 07/10] mm: make workingset.c " Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
2015-08-24 22:14 ` [PATCH 09/10] mm: make frontswap.c " Paul Gortmaker
2015-08-24 22:14 ` [PATCH 10/10] mm: make kasan.c " Paul Gortmaker
9 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Paul Gortmaker, Joonsoo Kim, Roman Pen,
Andrey Ryabinin, Toshi Kani, David Rientjes, Rob Jones, WANG Chao
The Kconfig currently controlling compilation of this code is CONFIG_MMU
which is per arch, but in all cases it is bool or def_bool meaning that
it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
code there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. However
one could argue that subsys_initcall might make more sense here.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Roman Pen <r.peniaev@gmail.com>
Cc: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Rob Jones <rob.jones@codethink.co.uk>
Cc: WANG Chao <chaowang@redhat.com>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/vmalloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 2faaa2976447..a27e6b3d58f4 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -10,7 +10,7 @@
#include <linux/vmalloc.h>
#include <linux/mm.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/highmem.h>
#include <linux/sched.h>
#include <linux/slab.h>
@@ -2686,7 +2686,7 @@ static int __init proc_vmalloc_init(void)
proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations);
return 0;
}
-module_init(proc_vmalloc_init);
+device_initcall(proc_vmalloc_init);
void get_vmalloc_info(struct vmalloc_info *vmi)
{
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 09/10] mm: make frontswap.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
` (7 preceding siblings ...)
2015-08-24 22:14 ` [PATCH 08/10] mm: make vmalloc.c " Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
2015-09-22 15:28 ` Konrad Rzeszutek Wilk
2015-08-24 22:14 ` [PATCH 10/10] mm: make kasan.c " Paul Gortmaker
9 siblings, 1 reply; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Paul Gortmaker, Konrad Rzeszutek Wilk
The Kconfig currently controlling compilation of this code is:
config FRONTSWAP
bool "Enable frontswap to cache swap pages if tmem is present"
...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
driver there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. However
one could argue that subsys_initcall might make more sense here.
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/frontswap.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/mm/frontswap.c b/mm/frontswap.c
index 27a9924caf61..b36409766831 100644
--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -15,7 +15,7 @@
#include <linux/swap.h>
#include <linux/swapops.h>
#include <linux/security.h>
-#include <linux/module.h>
+#include <linux/init.h>
#include <linux/debugfs.h>
#include <linux/frontswap.h>
#include <linux/swapfile.h>
@@ -500,5 +500,4 @@ static int __init init_frontswap(void)
#endif
return 0;
}
-
-module_init(init_frontswap);
+device_initcall(init_frontswap);
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 09/10] mm: make frontswap.c explicitly non-modular
2015-08-24 22:14 ` [PATCH 09/10] mm: make frontswap.c " Paul Gortmaker
@ 2015-09-22 15:28 ` Konrad Rzeszutek Wilk
0 siblings, 0 replies; 19+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-09-22 15:28 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: Andrew Morton, linux-mm, linux-kernel
On Mon, Aug 24, 2015 at 06:14:41PM -0400, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
>
> config FRONTSWAP
> bool "Enable frontswap to cache swap pages if tmem is present"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the couple traces of modularity so that when reading the
> driver there is no doubt it is builtin-only.
>
> Since module_init translates to device_initcall in the non-modular
> case, the init ordering remains unchanged with this commit. However
> one could argue that subsys_initcall might make more sense here.
>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
I would add to the commit:
Frontswap depends on CONFIG_SWAP and there is currently no way
to make swap dynamically loaded.
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-mm@kvack.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> mm/frontswap.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/mm/frontswap.c b/mm/frontswap.c
> index 27a9924caf61..b36409766831 100644
> --- a/mm/frontswap.c
> +++ b/mm/frontswap.c
> @@ -15,7 +15,7 @@
> #include <linux/swap.h>
> #include <linux/swapops.h>
> #include <linux/security.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
> #include <linux/debugfs.h>
> #include <linux/frontswap.h>
> #include <linux/swapfile.h>
> @@ -500,5 +500,4 @@ static int __init init_frontswap(void)
> #endif
> return 0;
> }
> -
> -module_init(init_frontswap);
> +device_initcall(init_frontswap);
> --
> 2.5.0
>
--
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>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 10/10] mm: make kasan.c explicitly non-modular
2015-08-24 22:14 [PATCH 00/10] mm: fix instances of non-modular code using modular fcns Paul Gortmaker
` (8 preceding siblings ...)
2015-08-24 22:14 ` [PATCH 09/10] mm: make frontswap.c " Paul Gortmaker
@ 2015-08-24 22:14 ` Paul Gortmaker
9 siblings, 0 replies; 19+ messages in thread
From: Paul Gortmaker @ 2015-08-24 22:14 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-mm, linux-kernel, Paul Gortmaker, Andrey Ryabinin,
Andrey Konovalov
The Makefile currently controlling compilation of this code is obj-y
meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
code there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit. However
one could argue that subsys_initcall might make more sense here.
We don't replace module.h with init.h since the file already has that.
Cc: Andrey Ryabinin <a.ryabinin@samsung.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Konovalov <adech.fo@gmail.com>
Cc: linux-mm@kvack.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
mm/kasan/kasan.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c
index 7b28e9cdf1c7..19786018f172 100644
--- a/mm/kasan/kasan.c
+++ b/mm/kasan/kasan.c
@@ -22,7 +22,6 @@
#include <linux/memblock.h>
#include <linux/memory.h>
#include <linux/mm.h>
-#include <linux/module.h>
#include <linux/printk.h>
#include <linux/sched.h>
#include <linux/slab.h>
@@ -532,6 +531,5 @@ static int __init kasan_memhotplug_init(void)
return 0;
}
-
-module_init(kasan_memhotplug_init);
+device_initcall(kasan_memhotplug_init);
#endif
--
2.5.0
--
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>
^ permalink raw reply related [flat|nested] 19+ messages in thread