[PATCH 2/3] Full conversion to early_initcall() interface, remove old interface.

Previous thread: [PATCH 3/3] relay: Add buffer-only channels; useful for early logging. by Eduard - Gabriel Munteanu on Monday, June 23, 2008 - 8:31 am. (5 messages)

Next thread: Re: [ANNOUNCE] Position Statement on Linux Kernel Modules by Matthew on Monday, June 23, 2008 - 9:02 am. (3 messages)
To: <tzanussi@...>
Cc: <penberg@...>, <akpm@...>, <torvalds@...>, <compudj@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Monday, June 23, 2008 - 8:30 am

A previous patch added the early_initcall(), to allow a cleaner hooking of
pre-SMP initcalls. Now we remove the older interface, converting all
existing users to the new one.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
---
include/linux/sched.h | 9 ---------
init/main.c | 22 +---------------------
kernel/sched.c | 6 +++++-
kernel/softirq.c | 4 +++-
kernel/softlockup.c | 27 ++++++++++++++++++++++++---
5 files changed, 33 insertions(+), 35 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index c5d3f84..efd8877 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -291,7 +291,6 @@ extern void sched_show_task(struct task_struct *p);

#ifdef CONFIG_DETECT_SOFTLOCKUP
extern void softlockup_tick(void);
-extern void spawn_softlockup_task(void);
extern void touch_softlockup_watchdog(void);
extern void touch_all_softlockup_watchdogs(void);
extern unsigned long softlockup_thresh;
@@ -2200,14 +2199,6 @@ static inline void inc_syscw(struct task_struct *tsk)
}
#endif

-#ifdef CONFIG_SMP
-void migration_init(void);
-#else
-static inline void migration_init(void)
-{
-}
-#endif
-
#ifndef TASK_SIZE_OF
#define TASK_SIZE_OF(tsk) TASK_SIZE
#endif
diff --git a/init/main.c b/init/main.c
index c5397f6..057f364 100644
--- a/init/main.c
+++ b/init/main.c
@@ -766,16 +766,7 @@ static void __init do_basic_setup(void)
do_initcalls();
}

-static int __initdata nosoftlockup;
-
-static int __init nosoftlockup_setup(char *str)
-{
- nosoftlockup = 1;
- return 1;
-}
-__setup("nosoftlockup", nosoftlockup_setup);
-
-static void __init __do_pre_smp_initcalls(void)
+static void __init do_pre_smp_initcalls(void)
{
initcall_t *call;

@@ -783,16 +774,6 @@ static void __init __do_pre_smp_initcalls(void)
do_one_initcall(*call);
}

-static void __init do_pre_smp_initcalls(void)
-{
- extern int spawn_ksoftirqd(void);
-
- migration_init();
- spawn_ksofti...

To: Eduard - Gabriel Munteanu <eduard.munteanu@...>
Cc: <tzanussi@...>, <penberg@...>, <torvalds@...>, <compudj@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Monday, June 23, 2008 - 8:27 pm

On Mon, 23 Jun 2008 15:30:56 +0300

The patch failed to convert init_call_single_data() because you're
working against a two-month-old codebase. Patches against linux-next
are more appropriate, particularly late in -rc.

Please check that what I committed actually worked, thanks.
--

To: Andrew Morton <akpm@...>, <tzanussi@...>
Cc: <penberg@...>, <torvalds@...>, <compudj@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Wednesday, June 25, 2008 - 5:01 am

A previous patch added the early_initcall(), to allow a cleaner hooking of
pre-SMP initcalls. Now we remove the older interface, converting all
existing users to the new one.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
---
include/linux/sched.h | 12 ------------
include/linux/smp.h | 8 --------
init/main.c | 23 +----------------------
kernel/sched.c | 6 +++++-
kernel/smp.c | 6 +++++-
kernel/softirq.c | 4 +++-
kernel/softlockup.c | 27 ++++++++++++++++++++++++---
7 files changed, 38 insertions(+), 48 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 239df23..495996d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -292,7 +292,6 @@ extern void sched_show_task(struct task_struct *p);

#ifdef CONFIG_DETECT_SOFTLOCKUP
extern void softlockup_tick(void);
-extern void spawn_softlockup_task(void);
extern void touch_softlockup_watchdog(void);
extern void touch_all_softlockup_watchdogs(void);
extern unsigned int softlockup_panic;
@@ -304,9 +303,6 @@ extern int softlockup_thresh;
static inline void softlockup_tick(void)
{
}
-static inline void spawn_softlockup_task(void)
-{
-}
static inline void touch_softlockup_watchdog(void)
{
}
@@ -2211,14 +2207,6 @@ static inline void inc_syscw(struct task_struct *tsk)
}
#endif

-#ifdef CONFIG_SMP
-void migration_init(void);
-#else
-static inline void migration_init(void)
-{
-}
-#endif
-
#ifndef TASK_SIZE_OF
#define TASK_SIZE_OF(tsk) TASK_SIZE
#endif
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 4d4c6ad..3c26b21 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -75,12 +75,7 @@ void __smp_call_function_single(int cpuid, struct call_single_data *data);
#ifdef CONFIG_USE_GENERIC_SMP_HELPERS
void generic_smp_call_function_single_interrupt(void);
void generic_smp_call_function_interrupt(void);
-void init_call_single_data(void);
extern spinlock_t ...

To: Eduard - Gabriel Munteanu <eduard.munteanu@...>
Cc: Andrew Morton <akpm@...>, <tzanussi@...>, <penberg@...>, <torvalds@...>, <compudj@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Friday, June 27, 2008 - 6:54 am

Hi Eduard,

You forgot to remove the declaration from linux/interrupt.h.

Andrew, the following fix is needed for -mmotm:

From: Johannes Weiner <hannes@saeurebad.de>
Subject: full-conversion-to-early_initcall-interface-remove-old-interface-fix

Original patch made spawn_softirqd() static but failed to remove the
global definition. Do so now.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
---

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 30da779..62aa4f8 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -299,7 +299,6 @@ extern void softirq_init(void);
#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0)
extern void raise_softirq_irqoff(unsigned int nr);
extern void raise_softirq(unsigned int nr);
-extern int spawn_ksoftirqd(void);

/* Tasklets --- multithreaded analogue of BHs.
--

To: Johannes Weiner <hannes@...>
Cc: Andrew Morton <akpm@...>, <tzanussi@...>, <penberg@...>, <torvalds@...>, <compudj@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Friday, June 27, 2008 - 7:28 am

On Fri, 27 Jun 2008 12:54:21 +0200

The last patch was made against linux-next, as Andrew Morton
suggested, where spawn_ksoftirqd() was declared in the scope of
__do_pre_smp_initcall():
@@ -793,17 +784,6 @@ static void __init __do_pre_smp_initcalls(void)
do_one_initcall(*call);
}

-static void __init do_pre_smp_initcalls(void)
-{
- extern int spawn_ksoftirqd(void);
-
- init_call_single_data();
- migration_init();
- spawn_ksoftirqd();
- if (!nosoftlockup)
- spawn_softlockup_task();
-}
-

It may be that some other patch in -mmotm moves that into
include/linux/interrupt.h. In linux-next with my patch, running
$ find . -name \*.h | xargs grep "spawn_ksoftirqd"
shows nothing.

Thanks for spotting this difference.

(Using -mmotm + quilt myself is an additional headache, since git
already does what I want in terms of patch (read commits) management;

Cheers,
Eduard
--

To: Eduard - Gabriel Munteanu <eduard.munteanu@...>
Cc: <hannes@...>, <tzanussi@...>, <penberg@...>, <torvalds@...>, <compudj@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Friday, June 27, 2008 - 2:45 pm

On Fri, 27 Jun 2008 14:28:00 +0300

It is a bit of a pain. I avoid asking people to raise patches against
-mm unless it's really necessary.
--

To: Andrew Morton <akpm@...>
Cc: <hannes@...>, <tzanussi@...>, <penberg@...>, <torvalds@...>, <compudj@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Friday, June 27, 2008 - 3:41 pm

On Fri, 27 Jun 2008 11:45:15 -0700

Just my 2 cents... you said in a 2006 discussion that you don't use Git
because you modify and drop patches often. I'd like to point out that
newer Git releases support interactive rebasing, which can do very nice
things:
- reorder commits (also adds '<<<', '===', '>>>' merge-like stuff when
that fails, so you can fix it easier)
- squash a commit into the previous -> solves the "patch that fixes
another patch" problem.
- edit commits different than HEAD
That is all doable with 'git-rebase -i'.

But maybe you got used to quilt and changing requires more effort at
the beginning, so I'm not going to argue too much.

I hope this helps.

Cheers,
Eduard
--

To: Andrew Morton <akpm@...>
Cc: <tzanussi@...>, <penberg@...>, <torvalds@...>, <compudj@...>, <vegard.nossum@...>, <linux-kernel@...>
Date: Wednesday, June 25, 2008 - 5:07 am

Hi,

Please merge this instead, it's based on linux-next. Your change wasn't
enough.

And I don't think Tom Zanussi should be Cc-ed on patches 1 and 2, these
are mere prereqs for the 3rd. So add the Cc for Tom just for the third.
You could add yourself as Cc to the other two, or whoever you think is
responsible for such core stuff.

Cheers,
Eduard
--

Previous thread: [PATCH 3/3] relay: Add buffer-only channels; useful for early logging. by Eduard - Gabriel Munteanu on Monday, June 23, 2008 - 8:31 am. (5 messages)

Next thread: Re: [ANNOUNCE] Position Statement on Linux Kernel Modules by Matthew on Monday, June 23, 2008 - 9:02 am. (3 messages)