unify init_task
Subsystems (13)
cover unify init_task
Create a common kernel/init_task.c, and convert low hanging fruit to use it. Architecture maintainers will need to ensure that I didn't break anything before applying the init_task removal patch to their arch.
A few architectures appear to possibly rely on link-ordering (with an extra-y makefile rule) and may need additional linker script rules.
Unconverted architectures so far are m68k (because it doesn't use an explicit init_task.c), ia64 (because it faffs about with init_thread_union), and sparc{,64} (which appear to rely on some magic.)
The other open question is what to do about init_mm, which was supposed to be removed in 2.6.26...
Kyle McMartin (19):
add HAVE_ARCH_INIT_TASK
add generic kernel/init_task.c
x86: convert to generic init_task.c
alpha: rename .data.init_thread to .data.init_task
alpha: convert to generic init_task.c
arm: convert to generic init_task.c
avr32: convert to generic init_task.c
blackfin: convert to generic init_task.c
frv: convert to generic init_task.c
h8300: convert to generic init_task.c
m32r: convert to generic init_task.c
m68knommu: convert to generic init_task.c
mips: convert to generic init_task.c
mn10300: convert to generic init_task.c
parisc: convert to generic init_task.c
powerpc: convert to generic init_task.c
s390: convert to generic init_task.c
sh: convert to generic init_task.c
xtensa: convert to generic init_task.c
arch/Kconfig | 9 +++++ arch/alpha/kernel/Makefile | 2 +- arch/alpha/kernel/init_task.c | 22 ------------- arch/alpha/kernel/vmlinux.lds.S | 4 +- arch/arm/kernel/Makefile | 2 +- arch/arm/kernel/init_task.c | 43 -------------------------- arch/avr32/kernel/Makefile | 2 +- arch/avr32/kernel/init_task.c | 37 ---------------------- arch/blackfin/kernel/Makefile | 2 +- arch/blackfin/kernel/init_task.c | 60 ------------------------------------- arch/cris/Kconfig | 1 + arch/frv/kernel/Makefile | 2 +- arch/frv/kernel/init_task.c | 38 ----------------------- arch/h8300/kernel/Makefile | 2 +- arch/h8300/kernel/init_task.c | 42 -------------------------- arch/ia64/Kconfig | 1 + arch/m32r/kernel/Makefile | 2 +- arch/m32r/kernel/init_task.c | 40 ------------------------ arch/m68k/Kconfig | 1 + arch/m68knommu/kernel/Makefile | 2 +- arch/m68knommu/kernel/init_task.c | 42 -------------------------- arch/mips/kernel/Makefile | 2 +- arch/mips/kernel/init_task.c | 41 ------------------------- arch/mn10300/kernel/Makefile | 2 +- arch/mn10300/kernel/init_task.c | 44 --------------------------- arch/parisc/kernel/init_task.c | 28 ----------------- arch/powerpc/kernel/Makefile | 2 +- arch/powerpc/kernel/init_task.c | 35 --------------------- arch/s390/kernel/Makefile | 2 +- arch/s390/kernel/init_task.c | 44 --------------------------- arch/sh/kernel/init_task.c | 25 --------------- arch/sparc/Kconfig | 1 + arch/sparc64/Kconfig | 1 + arch/x86/kernel/init_task.c | 25 --------------- arch/xtensa/kernel/Makefile | 2 +- arch/xtensa/kernel/init_task.c | 37 ---------------------- kernel/Makefile | 4 ++ kernel/init_task.c | 36 ++++++++++++++++++++++ 38 files changed, 69 insertions(+), 618 deletions(-) delete mode 100644 arch/alpha/kernel/init_task.c delete mode 100644 arch/arm/kernel/init_task.c delete mode 100644 arch/avr32/kernel/init_task.c delete mode 100644 arch/blackfin/kernel/init_task.c delete mode 100644 arch/frv/kernel/init_task.c delete mode 100644 arch/h8300/kernel/init_task.c delete mode 100644 arch/m32r/kernel/init_task.c delete mode 100644 arch/m68knommu/kernel/init_task.c delete mode 100644 arch/mips/kernel/init_task.c delete mode 100644 arch/mn10300/kernel/init_task.c delete mode 100644 arch/powerpc/kernel/init_task.c delete mode 100644 arch/s390/kernel/init_task.c delete mode 100644 arch/xtensa/kernel/init_task.c create mode 100644 kernel/init_task.c
PATCH 1/19 add HAVE_ARCH_INIT_TASK
Since some architectures faff about with init_task.c (*cough ia64 cough*) for various reasons, we may not be able to entirely convert most architectures. To ensure bisect-ability, this is an omnibus commit declaring a new config option which all architectures will select to begin with, selecting the status quo of arch/$a/kernel/init_task.c (or whatever.)
Once the maintainers apply a patch removing their init_task.c, the option will be removed, and a generic kernel/init_task.c will be used.
--- arch/Kconfig | 9 +++++++++ arch/alpha/Kconfig | 1 + arch/arm/Kconfig | 1 + arch/avr32/Kconfig | 1 + arch/blackfin/Kconfig | 1 + arch/cris/Kconfig | 1 + arch/frv/Kconfig | 1 + arch/h8300/Kconfig | 1 + arch/ia64/Kconfig | 1 + arch/m32r/Kconfig | 1 + arch/m68k/Kconfig | 1 + arch/m68knommu/Kconfig | 1 + arch/mips/Kconfig | 1 + arch/mn10300/Kconfig | 1 + arch/parisc/Kconfig | 1 + arch/powerpc/Kconfig | 1 + arch/s390/Kconfig | 1 + arch/sh/Kconfig | 1 + arch/sparc/Kconfig | 1 + arch/sparc64/Kconfig | 1 + arch/x86/Kconfig | 1 + arch/xtensa/Kconfig | 1 + 22 files changed, 30 insertions(+), 0 deletions(-)
arch/Kconfig +9 -0
@@ -89,6 +89,15 @@ config HAVE_KRETPROBES config HAVE_ARCH_TRACEHOOK bool +config HAVE_ARCH_INIT_TASK + bool + help + Select this option from your arch Kconfig if your architecture + provides its own init_task.c primitives. If your architecture + has been converted to use the generic kernel/init_task.c, this + option must be unselected. Once all have been converted, this + option will be removed. + config HAVE_DMA_ATTRS bool
arch/alpha/Kconfig +1 -0
@@ -8,6 +8,7 @@ config ALPHA select HAVE_AOUT select HAVE_IDE select HAVE_OPROFILE + select HAVE_ARCH_INIT_TASK help The Alpha is a 64-bit general-purpose processor designed and marketed by the Digital Equipment Corporation of blessed memory,
arch/arm/Kconfig +1 -0
@@ -18,6 +18,7 @@ config ARM select HAVE_KRETPROBES if (HAVE_KPROBES) select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) select HAVE_GENERIC_DMA_COHERENT + select HAVE_ARCH_INIT_TASK help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and
arch/avr32/Kconfig +1 -0
@@ -13,6 +13,7 @@ config AVR32 select HAVE_CLK select HAVE_OPROFILE select HAVE_KPROBES + select HAVE_ARCH_INIT_TASK help AVR32 is a high-performance 32-bit RISC microprocessor core, designed for cost-sensitive embedded applications, with particular
arch/blackfin/Kconfig +1 -0
@@ -26,6 +26,7 @@ config BLACKFIN default y select HAVE_IDE select HAVE_OPROFILE + select HAVE_ARCH_INIT_TASK config ZONE_DMA bool
arch/cris/Kconfig +1 -0
@@ -55,6 +55,7 @@ config CRIS bool default y select HAVE_IDE + select HAVE_ARCH_INIT_TASK config HZ int
arch/frv/Kconfig +1 -0
@@ -6,6 +6,7 @@ config FRV bool default y select HAVE_IDE + select HAVE_ARCH_INIT_TASK config ZONE_DMA bool
arch/h8300/Kconfig +1 -0
@@ -9,6 +9,7 @@ config H8300 bool default y select HAVE_IDE + select HAVE_ARCH_INIT_TASK config MMU bool
arch/ia64/Kconfig +1 -0
@@ -24,6 +24,7 @@ config IA64 select HAVE_DMA_ATTRS select HAVE_KVM select HAVE_ARCH_TRACEHOOK + select HAVE_ARCH_INIT_TASK default y help The Itanium Processor Family is Intel's 64-bit successor to
arch/m32r/Kconfig +1 -0
@@ -10,6 +10,7 @@ config M32R default y select HAVE_IDE select HAVE_OPROFILE + select HAVE_ARCH_INIT_TASK config SBUS bool
arch/m68k/Kconfig +1 -0
@@ -7,6 +7,7 @@ config M68K default y select HAVE_AOUT select HAVE_IDE + select HAVE_ARCH_INIT_TASK config MMU bool
arch/m68knommu/Kconfig +1 -0
@@ -9,6 +9,7 @@ config M68K bool default y select HAVE_IDE + select HAVE_ARCH_INIT_TASK config MMU bool
arch/mips/Kconfig +1 -0
@@ -7,6 +7,7 @@ config MIPS # Horrible source of confusion. Die, die, die ... select EMBEDDED select RTC_LIB + select HAVE_ARCH_INIT_TASK mainmenu "Linux/MIPS Kernel Configuration"
arch/mn10300/Kconfig +1 -0
@@ -7,6 +7,7 @@ mainmenu "Linux Kernel Configuration" config MN10300 def_bool y + select HAVE_ARCH_INIT_TASK config AM33 def_bool y
arch/parisc/Kconfig +1 -0
@@ -11,6 +11,7 @@ config PARISC select HAVE_OPROFILE select RTC_CLASS select RTC_DRV_PARISC + select HAVE_ARCH_INIT_TASK help The PA-RISC microprocessor is designed by Hewlett-Packard and used in many of their workstations & servers (HP9000 700 and 800 series,
arch/powerpc/Kconfig +1 -0
@@ -121,6 +121,7 @@ config PPC select HAVE_DMA_ATTRS if PPC64 select USE_GENERIC_SMP_HELPERS if SMP select HAVE_OPROFILE + select HAVE_ARCH_INIT_TASK config EARLY_PRINTK bool
arch/s390/Kconfig +1 -0
@@ -75,6 +75,7 @@ config S390 select HAVE_KRETPROBES select HAVE_KVM if 64BIT select HAVE_ARCH_TRACEHOOK + select HAVE_ARCH_INIT_TASK source "init/Kconfig"
arch/sh/Kconfig +1 -0
@@ -13,6 +13,7 @@ config SUPERH select HAVE_OPROFILE select HAVE_GENERIC_DMA_COHERENT select HAVE_IOREMAP_PROT if MMU + select HAVE_ARCH_INIT_TASK help The SuperH is a RISC processor targeted for use in embedded systems and consumer electronics; it was also used in the Sega Dreamcast
arch/sparc/Kconfig +1 -0
@@ -79,6 +79,7 @@ config SPARC select ARCH_WANT_OPTIONAL_GPIOLIB select RTC_CLASS select RTC_DRV_M48T59 + select HAVE_ARCH_INIT_TASK # Identify this as a Sparc32 build config SPARC32
arch/sparc64/Kconfig +1 -0
@@ -24,6 +24,7 @@ config SPARC64 select RTC_DRV_BQ4802 select RTC_DRV_SUN4V select RTC_DRV_STARFIRE + select HAVE_ARCH_INIT_TASK config GENERIC_TIME bool
arch/x86/Kconfig +1 -0
@@ -34,6 +34,7 @@ config X86 select HAVE_ARCH_TRACEHOOK select HAVE_GENERIC_DMA_COHERENT if X86_32 select HAVE_EFFICIENT_UNALIGNED_ACCESS + select HAVE_ARCH_INIT_TASK config ARCH_DEFCONFIG string
arch/xtensa/Kconfig +1 -0
@@ -15,6 +15,7 @@ config XTENSA bool default y select HAVE_IDE + select HAVE_ARCH_INIT_TASK help Xtensa processors are 32-bit RISC machines designed by Tensilica primarily for embedded systems. These processors are both
Signature · 1 line
1.6.0.4
PATCH 2/19 add generic kernel/init_task.c
Add a generic kernel/init_task.c, since it is basically identical across all the architectures Linux supports.
--- kernel/Makefile | 4 ++++ kernel/init_task.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 0 deletions(-) create mode 100644 kernel/init_task.c
kernel/Makefile +4 -0
@@ -11,6 +11,10 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \ notifier.o ksysfs.o pm_qos_params.o sched_clock.o +ifneq ($(CONFIG_HAVE_ARCH_INIT_TASK),y) +obj-y += init_task.o +endif + ifdef CONFIG_FUNCTION_TRACER # Do not trace debug files and internal ftrace files CFLAGS_REMOVE_lockdep.o = -pg
kernel/init_task.c new file +36 -0
@@ -0,0 +1,36 @@ +#include <linux/mm.h> +#include <linux/module.h> +#include <linux/sched.h> +#include <linux/init.h> +#include <linux/init_task.h> +#include <linux/fs.h> +#include <linux/mqueue.h> + +#include <asm/uaccess.h> +#include <asm/pgtable.h> + +static struct fs_struct init_fs =INIT_FS ; +static struct signal_struct init_signals =INIT_SIGNALS (init_signals); +static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); +struct mm_struct init_mm =INIT_MM (init_mm); +EXPORT_UNUSED_SYMBOL (init_mm);/* will be removed in 2.6.26 */ + +/* +* Initial thread structure. +* +* We need to make sure that this is THREAD_SIZE aligned due to the +* way process stacks are handled. This is done by having a special +* "init_task" linker map entry.. +*/ +union thread_union init_thread_union + __attribute__((__section__(".data.init_task"))) = + { INIT_THREAD_INFO(init_task) }; + +/* +* Initial task structure. +* +* All other task structs will be allocated on slabs in fork.c +*/ +struct task_struct init_task =INIT_TASK (init_task); +EXPORT_SYMBOL (init_task); +
Signature · 1 line
1.6.0.4
PATCH 3/19 x86: convert to generic init_task.c
Leave arch/x86/kernel/init_task.c hanging around with the INIT_TSS definition in it, a later patch will move it to an appropriate place and nuke the file.
--- arch/x86/Kconfig | 1 - arch/x86/kernel/init_task.c | 25 ------------------------- 2 files changed, 0 insertions(+), 26 deletions(-)
arch/x86/Kconfig +0 -1
@@ -34,7 +34,6 @@ config X86 select HAVE_ARCH_TRACEHOOK select HAVE_GENERIC_DMA_COHERENT if X86_32 select HAVE_EFFICIENT_UNALIGNED_ACCESS - select HAVE_ARCH_INIT_TASK config ARCH_DEFCONFIG string
arch/x86/kernel/init_task.c +0 -25
@@ -10,31 +10,6 @@#include <asm/pgtable.h> #include <asm/desc.h> -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); -EXPORT_UNUSED_SYMBOL (init_mm);/* will be removed in 2.6.26 */ - -/* -* Initial thread structure. -* -* We need to make sure that this is THREAD_SIZE aligned due to the -* way process stacks are handled. This is done by having a special -* "init_task" linker map entry.. -*/ -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = - { INIT_THREAD_INFO(init_task) }; - -/* -* Initial task structure. -* -* All other task structs will be allocated on slabs in fork.c -*/ -struct task_struct init_task =INIT_TASK (init_task); -EXPORT_SYMBOL (init_task); -/* * per-CPU TSS segments. Threads are completely 'soft' on Linux, * no more per-task TSS's. The TSS size is kept cacheline-aligned
Signature · 1 line
1.6.0.4
PATCH 4/19 alpha: rename .data.init_thread to .data.init_task
Everyone else calls it .init_task, and it's one less special case for a generic kernel/init_task.c...
--- arch/alpha/kernel/init_task.c | 2 +- arch/alpha/kernel/vmlinux.lds.S | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/alpha/kernel/init_task.c +1 -1
@@ -18,5 +18,5 @@ EXPORT_SYMBOL(init_mm);EXPORT_SYMBOL (init_task); union thread_union init_thread_union - __attribute__((section(".data.init_thread"))) + __attribute__((section(".data.init_task"))) = { INIT_THREAD_INFO(init_task) };
arch/alpha/kernel/vmlinux.lds.S +2 -2
@@ -93,8 +93,8 @@ SECTIONS /* Freed after init ends here */ /* Note 2 page alignment above. */ - .data.init_thread : { - *(.data.init_thread) + .data.init_task : { + *(.data.init_task) } . = ALIGN(PAGE_SIZE);
Signature · 1 line
1.6.0.4
PATCH 5/19 alpha: convert to generic init_task.c
--- arch/alpha/Kconfig | 1 - arch/alpha/kernel/Makefile | 2 +- arch/alpha/kernel/init_task.c | 22 ---------------------- 3 files changed, 1 insertions(+), 24 deletions(-) delete mode 100644 arch/alpha/kernel/init_task.c
arch/alpha/Kconfig +0 -1
@@ -8,7 +8,6 @@ config ALPHA select HAVE_AOUT select HAVE_IDE select HAVE_OPROFILE - select HAVE_ARCH_INIT_TASK help The Alpha is a 64-bit general-purpose processor designed and marketed by the Digital Equipment Corporation of blessed memory,
arch/alpha/kernel/Makefile +1 -1
@@ -6,7 +6,7 @@ extra-y := head.o vmlinux.lds EXTRA_AFLAGS := $(KBUILD_CFLAGS) EXTRA_CFLAGS := -Werror -Wno-sign-compare -obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \ +obj-y := entry.o traps.o process.o osf_sys.o irq.o \ irq_alpha.o signal.o setup.o ptrace.o time.o \ alpha_ksyms.o systbls.o err_common.o io.o
arch/alpha/kernel/init_task.c deleted +0 -22
@@ -1,22 +0,0 @@ -#include <linux/mm.h> -#include <linux/module.h> -#include <linux/sched.h> -#include <linux/init.h> -#include <linux/init_task.h> -#include <linux/fs.h> -#include <linux/mqueue.h> -#include <asm/uaccess.h> - - -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); -struct task_struct init_task =INIT_TASK (init_task); - -EXPORT_SYMBOL (init_mm); -EXPORT_SYMBOL (init_task); - -union thread_union init_thread_union - __attribute__((section(".data.init_task"))) - = { INIT_THREAD_INFO(init_task) };
Signature · 1 line
1.6.0.4
PATCH 6/19 arm: convert to generic init_task.c
--- arch/arm/Kconfig | 1 - arch/arm/kernel/Makefile | 2 +- arch/arm/kernel/init_task.c | 43 ------------------------------------------- 3 files changed, 1 insertions(+), 45 deletions(-) delete mode 100644 arch/arm/kernel/init_task.c
arch/arm/Kconfig +0 -1
@@ -18,7 +18,6 @@ config ARM select HAVE_KRETPROBES if (HAVE_KPROBES) select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) select HAVE_GENERIC_DMA_COHERENT - select HAVE_ARCH_INIT_TASK help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and
arch/arm/kernel/Makefile +1 -1
@@ -45,4 +45,4 @@ endif head-y := head$(MMUEXT).o obj-$(CONFIG_DEBUG_LL) += debug.o -extra-y := $(head-y) init_task.o vmlinux.lds +extra-y := $(head-y) vmlinux.lds
arch/arm/kernel/init_task.c deleted +0 -43
43 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 7/19 avr32: convert to generic init_task.c
--- arch/avr32/Kconfig | 1 - arch/avr32/kernel/Makefile | 2 +- arch/avr32/kernel/init_task.c | 37 ------------------------------------- 3 files changed, 1 insertions(+), 39 deletions(-) delete mode 100644 arch/avr32/kernel/init_task.c
arch/avr32/Kconfig +0 -1
@@ -13,7 +13,6 @@ config AVR32 select HAVE_CLK select HAVE_OPROFILE select HAVE_KPROBES - select HAVE_ARCH_INIT_TASK help AVR32 is a high-performance 32-bit RISC microprocessor core, designed for cost-sensitive embedded applications, with particular
arch/avr32/kernel/Makefile +1 -1
@@ -8,7 +8,7 @@ obj-$(CONFIG_SUBARCH_AVR32B) += entry-avr32b.o obj-y += syscall_table.o syscall-stubs.o irq.o obj-y += setup.o traps.o ocd.o ptrace.o obj-y += signal.o sys_avr32.o process.o time.o -obj-y += init_task.o switch_to.o cpu.o +obj-y += switch_to.o cpu.o obj-$(CONFIG_MODULES) += module.o avr32_ksyms.o obj-$(CONFIG_KPROBES) += kprobes.o obj-$(CONFIG_STACKTRACE) += stacktrace.o
arch/avr32/kernel/init_task.c deleted +0 -37
@@ -1,37 +0,0 @@ -/* -* Copyright (C) 2004-2006 Atmel Corporation -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ -#include <linux/module.h> -#include <linux/fs.h> -#include <linux/sched.h> -#include <linux/init_task.h> -#include <linux/mqueue.h> - -#include <asm/pgtable.h> - -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); - -EXPORT_SYMBOL (init_mm); - -/* -* Initial thread structure. Must be aligned on an 8192-byte boundary. -*/ -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = - { INIT_THREAD_INFO(init_task) }; - -/* -* Initial task structure. -* -* All other task structs will be allocated on slabs in fork.c -*/ -struct task_struct init_task =INIT_TASK (init_task); - -EXPORT_SYMBOL (init_task);
Signature · 1 line
1.6.0.4
PATCH 8/19 blackfin: convert to generic init_task.c
--- arch/blackfin/Kconfig | 1 - arch/blackfin/kernel/Makefile | 2 +- arch/blackfin/kernel/init_task.c | 60 -------------------------------------- 3 files changed, 1 insertions(+), 62 deletions(-) delete mode 100644 arch/blackfin/kernel/init_task.c
arch/blackfin/Kconfig +0 -1
@@ -26,7 +26,6 @@ config BLACKFIN default y select HAVE_IDE select HAVE_OPROFILE - select HAVE_ARCH_INIT_TASK config ZONE_DMA bool
arch/blackfin/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # arch/blackfin/kernel/Makefile # -extra-y := init_task.o vmlinux.lds +extra-y := vmlinux.lds obj-y := \ entry.o process.o bfin_ksyms.o ptrace.o setup.o signal.o \
arch/blackfin/kernel/init_task.c deleted +0 -60
60 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 9/19 frv: convert to generic init_task.c
--- arch/frv/Kconfig | 1 - arch/frv/kernel/Makefile | 2 +- arch/frv/kernel/init_task.c | 38 -------------------------------------- 3 files changed, 1 insertions(+), 40 deletions(-) delete mode 100644 arch/frv/kernel/init_task.c
arch/frv/Kconfig +0 -1
@@ -6,7 +6,6 @@ config FRV bool default y select HAVE_IDE - select HAVE_ARCH_INIT_TASK config ZONE_DMA bool
arch/frv/kernel/Makefile +1 -1
@@ -5,7 +5,7 @@ heads-y := head-uc-fr401.o head-uc-fr451.o head-uc-fr555.o heads-$(CONFIG_MMU) := head-mmu-fr451.o -extra-y:= head.o init_task.o vmlinux.lds +extra-y:= head.o vmlinux.lds obj-y := $(heads-y) entry.o entry-table.o break.o switch_to.o kernel_thread.o \ kernel_execve.o process.o traps.o ptrace.o signal.o dma.o \
arch/frv/kernel/init_task.c deleted +0 -38
@@ -1,38 +0,0 @@ -#include <linux/mm.h> -#include <linux/module.h> -#include <linux/sched.h> -#include <linux/init.h> -#include <linux/init_task.h> -#include <linux/fs.h> -#include <linux/mqueue.h> - -#include <asm/uaccess.h> -#include <asm/pgtable.h> - - -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); - -EXPORT_SYMBOL (init_mm); - -/* -* Initial thread structure. -* -* We need to make sure that this is THREAD_SIZE aligned due to the -* way process stacks are handled. This is done by having a special -* "init_task" linker map entry.. -*/ -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = - { INIT_THREAD_INFO(init_task) }; - -/* -* Initial task structure. -* -* All other task structs will be allocated on slabs in fork.c -*/ -struct task_struct init_task =INIT_TASK (init_task); - -EXPORT_SYMBOL (init_task);
Signature · 1 line
1.6.0.4
PATCH 10/19 h8300: convert to generic init_task.c
This one has a bizarre 4-byte align on init_task, but that would (at least) be implied alignment on a struct...
--- arch/h8300/Kconfig | 1 - arch/h8300/kernel/Makefile | 2 +- arch/h8300/kernel/init_task.c | 42 ----------------------------------------- 3 files changed, 1 insertions(+), 44 deletions(-) delete mode 100644 arch/h8300/kernel/init_task.c
arch/h8300/Kconfig +0 -1
@@ -9,7 +9,6 @@ config H8300 bool default y select HAVE_IDE - select HAVE_ARCH_INIT_TASK config MMU bool
arch/h8300/kernel/Makefile +1 -1
@@ -6,7 +6,7 @@ extra-y := vmlinux.lds obj-y := process.o traps.o ptrace.o irq.o \ sys_h8300.o time.o signal.o \ - setup.o gpio.o init_task.o syscalls.o \ + setup.o gpio.o syscalls.o \ entry.o timer/ obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o
arch/h8300/kernel/init_task.c deleted +0 -42
42 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 11/19 m32r: convert to generic init_task.c
--- arch/m32r/Kconfig | 1 - arch/m32r/kernel/Makefile | 2 +- arch/m32r/kernel/init_task.c | 40 ---------------------------------------- 3 files changed, 1 insertions(+), 42 deletions(-) delete mode 100644 arch/m32r/kernel/init_task.c
arch/m32r/Kconfig +0 -1
@@ -10,7 +10,6 @@ config M32R default y select HAVE_IDE select HAVE_OPROFILE - select HAVE_ARCH_INIT_TASK config SBUS bool
arch/m32r/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the Linux/M32R kernel. # -extra-y := head.o init_task.o vmlinux.lds +extra-y := head.o vmlinux.lds obj-y := process.o entry.o traps.o align.o irq.o setup.o time.o \ m32r_ksyms.o sys_m32r.o signal.o ptrace.o
arch/m32r/kernel/init_task.c deleted +0 -40
@@ -1,40 +0,0 @@ -/* orig : i386 init_task.c */ - -#include <linux/mm.h> -#include <linux/module.h> -#include <linux/sched.h> -#include <linux/init.h> -#include <linux/init_task.h> -#include <linux/fs.h> -#include <linux/mqueue.h> - -#include <asm/uaccess.h> -#include <asm/pgtable.h> - -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); - -EXPORT_SYMBOL (init_mm); - -/* -* Initial thread structure. -* -* We need to make sure that this is 8192-byte aligned due to the -* way process stacks are handled. This is done by having a special -* "init_task" linker map entry.. -*/ -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = - { INIT_THREAD_INFO(init_task) }; - -/* -* Initial task structure. -* -* All other task structs will be allocated on slabs in fork.c -*/ -struct task_struct init_task =INIT_TASK (init_task); - -EXPORT_SYMBOL (init_task); -
Signature · 1 line
1.6.0.4
PATCH 12/19 m68knommu: convert to generic init_task.c
--- arch/m68knommu/Kconfig | 1 - arch/m68knommu/kernel/Makefile | 2 +- arch/m68knommu/kernel/init_task.c | 42 ------------------------------------- 3 files changed, 1 insertions(+), 44 deletions(-) delete mode 100644 arch/m68knommu/kernel/init_task.c
arch/m68knommu/Kconfig +0 -1
@@ -9,7 +9,6 @@ config M68K bool default y select HAVE_IDE - select HAVE_ARCH_INIT_TASK config MMU bool
arch/m68knommu/kernel/Makefile +1 -1
@@ -4,7 +4,7 @@ extra-y := vmlinux.lds -obj-y += dma.o entry.o init_task.o irq.o m68k_ksyms.o process.o ptrace.o \ +obj-y += dma.o entry.o irq.o m68k_ksyms.o process.o ptrace.o \ setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o obj-$(CONFIG_MODULES) += module.o
arch/m68knommu/kernel/init_task.c deleted +0 -42
42 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 13/19 mips: convert to generic init_task.c
--- arch/mips/Kconfig | 1 - arch/mips/kernel/Makefile | 2 +- arch/mips/kernel/init_task.c | 41 ----------------------------------------- 3 files changed, 1 insertions(+), 43 deletions(-) delete mode 100644 arch/mips/kernel/init_task.c
arch/mips/Kconfig +0 -1
@@ -7,7 +7,6 @@ config MIPS # Horrible source of confusion. Die, die, die ... select EMBEDDED select RTC_LIB - select HAVE_ARCH_INIT_TASK mainmenu "Linux/MIPS Kernel Configuration"
arch/mips/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the Linux/MIPS kernel. # -extra-y := head.o init_task.o vmlinux.lds +extra-y := head.o vmlinux.lds obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ ptrace.o reset.o setup.o signal.o syscall.o \
arch/mips/kernel/init_task.c deleted +0 -41
41 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 14/19 mn10300: convert to generic init_task.c
--- arch/mn10300/Kconfig | 1 - arch/mn10300/kernel/Makefile | 2 +- arch/mn10300/kernel/init_task.c | 44 --------------------------------------- 3 files changed, 1 insertions(+), 46 deletions(-) delete mode 100644 arch/mn10300/kernel/init_task.c
arch/mn10300/Kconfig +0 -1
@@ -7,7 +7,6 @@ mainmenu "Linux Kernel Configuration" config MN10300 def_bool y - select HAVE_ARCH_INIT_TASK config AM33 def_bool y
arch/mn10300/kernel/Makefile +1 -1
@@ -1,7 +1,7 @@ # # Makefile for the MN10300-specific core kernel code # -extra-y := head.o init_task.o vmlinux.lds +extra-y := head.o vmlinux.lds obj-y := process.o signal.o entry.o fpu.o traps.o irq.o \ ptrace.o setup.o time.o sys_mn10300.o io.o kthread.o \
arch/mn10300/kernel/init_task.c deleted +0 -44
44 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 15/19 parisc: convert to generic init_task.c
swapper page tables need to be moved before this file can be nuked...
--- arch/parisc/Kconfig | 1 - arch/parisc/kernel/init_task.c | 28 ---------------------------- 2 files changed, 0 insertions(+), 29 deletions(-)
arch/parisc/Kconfig +0 -1
@@ -11,7 +11,6 @@ config PARISC select HAVE_OPROFILE select RTC_CLASS select RTC_DRV_PARISC - select HAVE_ARCH_INIT_TASK help The PA-RISC microprocessor is designed by Hewlett-Packard and used in many of their workstations & servers (HP9000 700 and 800 series,
arch/parisc/kernel/init_task.c +0 -28
@@ -34,24 +34,6 @@#include <asm/pgtable.h> #include <asm/pgalloc.h> -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); - -EXPORT_SYMBOL (init_mm); - -/* -* Initial task structure. -* -* We need to make sure that this is 16384-byte aligned due to the -* way process stacks are handled. This is done by having a special -* "init_task" linker map entry.. -*/ -union thread_union init_thread_union - __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) = - { INIT_THREAD_INFO(init_task) }; -#if PT_NLEVELS ==3 /* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout * with the first pmd adjacent to the pgd and below it. gcc doesn't actually
@@ -63,13 +45,3 @@ pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data.vm0.pmd"), aligned( pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data.vm0.pgd"), aligned(PAGE_SIZE))); pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data.vm0.pte"), aligned(PAGE_SIZE))); - -/* -* Initial task structure. -* -* All other task structs will be allocated on slabs in fork.c -*/ -EXPORT_SYMBOL (init_task); - -__asm__(".data" ); -struct task_struct init_task =INIT_TASK (init_task);
Signature · 1 line
1.6.0.4
PATCH 16/19 powerpc: convert to generic init_task.c
--- arch/powerpc/Kconfig | 1 - arch/powerpc/kernel/Makefile | 2 +- arch/powerpc/kernel/init_task.c | 35 ----------------------------------- 3 files changed, 1 insertions(+), 37 deletions(-) delete mode 100644 arch/powerpc/kernel/init_task.c
arch/powerpc/Kconfig +0 -1
@@ -121,7 +121,6 @@ config PPC select HAVE_DMA_ATTRS if PPC64 select USE_GENERIC_SMP_HELPERS if SMP select HAVE_OPROFILE - select HAVE_ARCH_INIT_TASK config EARLY_PRINTK bool
arch/powerpc/kernel/Makefile +1 -1
@@ -27,7 +27,7 @@ endif obj-y := cputable.o ptrace.o syscalls.o \ irq.o align.o signal_32.o pmc.o vdso.o \ - init_task.o process.o systbl.o idle.o \ + process.o systbl.o idle.o \ signal.o sysfs.o obj-y += vdso32/ obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \
arch/powerpc/kernel/init_task.c deleted +0 -35
@@ -1,35 +0,0 @@ -#include <linux/mm.h> -#include <linux/module.h> -#include <linux/sched.h> -#include <linux/init.h> -#include <linux/init_task.h> -#include <linux/fs.h> -#include <linux/mqueue.h> -#include <asm/uaccess.h> - -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); - -EXPORT_SYMBOL (init_mm); - -/* -* Initial thread structure. -* -* We need to make sure that this is 16384-byte aligned due to the -* way process stacks are handled. This is done by having a special -* "init_task" linker map entry.. -*/ -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = - { INIT_THREAD_INFO(init_task) }; - -/* -* Initial task structure. -* -* All other task structs will be allocated on slabs in fork.c -*/ -struct task_struct init_task =INIT_TASK (init_task); - -EXPORT_SYMBOL (init_task);
Signature · 1 line
1.6.0.4
PATCH 17/19 s390: convert to generic init_task.c
--- arch/s390/Kconfig | 1 - arch/s390/kernel/Makefile | 2 +- arch/s390/kernel/init_task.c | 44 ------------------------------------------ 3 files changed, 1 insertions(+), 46 deletions(-) delete mode 100644 arch/s390/kernel/init_task.c
arch/s390/Kconfig +0 -1
@@ -75,7 +75,6 @@ config S390 select HAVE_KRETPROBES select HAVE_KVM if 64BIT select HAVE_ARCH_TRACEHOOK - select HAVE_ARCH_INIT_TASK source "init/Kconfig"
arch/s390/kernel/Makefile +1 -1
@@ -19,7 +19,7 @@ obj-y := bitmap.o traps.o time.o process.o base.o early.o \ obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o) obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o) -extra-y += head.o init_task.o vmlinux.lds +extra-y += head.o vmlinux.lds obj-$(CONFIG_MODULES) += s390_ksyms.o module.o obj-$(CONFIG_SMP) += smp.o topology.o
arch/s390/kernel/init_task.c deleted +0 -44
44 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 18/19 sh: convert to generic init_task.c
struct pt_regs fake_swapper_regs needs to be moved to a more appropriate location before this file can be nuked.
--- arch/sh/Kconfig | 1 - arch/sh/kernel/init_task.c | 25 ------------------------- 2 files changed, 0 insertions(+), 26 deletions(-)
arch/sh/Kconfig +0 -1
@@ -13,7 +13,6 @@ config SUPERH select HAVE_OPROFILE select HAVE_GENERIC_DMA_COHERENT select HAVE_IOREMAP_PROT if MMU - select HAVE_ARCH_INIT_TASK help The SuperH is a RISC processor targeted for use in embedded systems and consumer electronics; it was also used in the Sega Dreamcast
arch/sh/kernel/init_task.c +0 -25
@@ -7,29 +7,4 @@#include <asm/uaccess.h> #include <asm/pgtable.h> -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand);struct pt_regs fake_swapper_regs; -struct mm_struct init_mm =INIT_MM (init_mm); -EXPORT_SYMBOL (init_mm); - -/* -* Initial thread structure. -* -* We need to make sure that this is 8192-byte aligned due to the -* way process stacks are handled. This is done by having a special -* "init_task" linker map entry.. -*/ -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = - { INIT_THREAD_INFO(init_task) }; - -/* -* Initial task structure. -* -* All other task structs will be allocated on slabs in fork.c -*/ -struct task_struct init_task =INIT_TASK (init_task); - -EXPORT_SYMBOL (init_task);
Signature · 1 line
1.6.0.4
PATCH 19/19 xtensa: convert to generic init_task.c
--- arch/xtensa/Kconfig | 1 - arch/xtensa/kernel/Makefile | 2 +- arch/xtensa/kernel/init_task.c | 37 ------------------------------------- 3 files changed, 1 insertions(+), 39 deletions(-) delete mode 100644 arch/xtensa/kernel/init_task.c
arch/xtensa/Kconfig +0 -1
@@ -15,7 +15,6 @@ config XTENSA bool default y select HAVE_IDE - select HAVE_ARCH_INIT_TASK help Xtensa processors are 32-bit RISC machines designed by Tensilica primarily for embedded systems. These processors are both
arch/xtensa/kernel/Makefile +1 -1
@@ -7,7 +7,7 @@ extra-y := head.o vmlinux.lds obj-y := align.o entry.o irq.o coprocessor.o process.o ptrace.o \ setup.o signal.o syscall.o time.o traps.o vectors.o platform.o \ - pci-dma.o init_task.o io.o + pci-dma.o io.o ## windowspill.o
arch/xtensa/kernel/init_task.c deleted +0 -37
@@ -1,37 +0,0 @@ -/* -* arch/xtensa/kernel/init_task.c -* -* Xtensa Processor version. -* -* This file is subject to the terms and conditions of the GNU General Public -* License. See the file "COPYING" in the main directory of this archive -* for more details. -* -* Copyright (C) 2007 Tensilica Inc. -* -* Chris Zankel <[email protected]> -*/ - -#include <linux/mm.h> -#include <linux/fs.h> -#include <linux/init.h> -#include <linux/init_task.h> -#include <linux/module.h> -#include <linux/mqueue.h> - -#include <asm/uaccess.h> - -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); - -EXPORT_SYMBOL (init_mm); - -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = -{ INIT_THREAD_INFO(init_task) }; - -struct task_struct init_task =INIT_TASK (init_task); - -EXPORT_SYMBOL (init_task);
Signature · 1 line
1.6.0.4
Arnd Bergmann
maintainerRe: [PATCH 13/19] mips: convert to generic init_task.c
In reply to Kyle McMartinarch/mips/kernel/init_task.c line 33
Quoted 6 lines · Kyle McMartin
- */
arch/mips/kernel/init_task.c deleted +0
-5-union thread_union init_thread_union - __attribute__((__section__(".data.init_task"), - __aligned__(THREAD_SIZE))) = - { INIT_THREAD_INFO(init_task) }; -
The __aligned__(THREAD_SIZE) is only present in sparc, mips and parisc (though the latter uses 128 byte align). I guess you verified that dropping it is ok for parisc, but is that also true for mips and sparc?
Arnd <><
Re: [PATCH 13/19] mips: convert to generic init_task.c
Quoted 12 lines · Arnd Bergmann
arch/mips/kernel/init_task.c line 33
Quoted 6 lines · Kyle McMartin
- */
arch/mips/kernel/init_task.c deleted +0
-5-union thread_union init_thread_union - __attribute__((__section__(".data.init_task"), - __aligned__(THREAD_SIZE))) = - { INIT_THREAD_INFO(init_task) }; -The
__aligned__(THREAD_SIZE)is only present in sparc, mips and parisc (though the latter uses 128 byte align). I guess you verified that dropping it is ok for parisc, but is that also true for mips and sparc?
Duhh... Good point. The alignment is also enforced or at least should be enforced in vmlinux.lds.S. Which in case of MIPS
[...]
. = ALIGN(_PAGE_SIZE);
*(.data.init_task)[...]
only enforces _PAGE_SIZE alignment and _PAGE_SIZE can be less than THREAD_SIZE so removing the __aligned__ would have broken things. Of course that's a bug of the linker script not Kyle's patches.
Ralf
Arnd Bergmann
maintainerRe: [PATCH 10/19] h8300: convert to generic init_task.c
In reply to Kyle McMartinQuoted 4 lines · Kyle McMartin
This one has a bizarre 4-byte align on
init_task, but that would (at least) be implied alignment on a struct...Signed-off-by Kyle McMartin <[email protected]>
I'm pretty sure that the .align was copied from m68knommu, which does indeed have bizarre alignment rules and needs this.
Arnd <><
Arnd Bergmann
maintainerRe: [PATCH 08/19] blackfin: convert to generic init_task.c
In reply to Kyle McMartinarch/blackfin/kernel/init_task.c line 60
Quoted 3 lines · Kyle McMartin
arch/blackfin/kernel/init_task.c deleted +0
-3-union thread_union init_thread_union - __attribute__ ((__section__(".init_task.data"))) = { -INIT_THREAD_INFO(init_task)};
Did you notice that this is init_task.data, not data.init_task? The blackfin vmlinux.lds.S file references data.* sections together, so this appears broken to me with your patch.
Arnd <><
Re: [PATCH 07/19] avr32: convert to generic init_task.c
In reply to Kyle McMartinQuoted 2 lines · Kyle McMartin
Signed-off-by Kyle McMartin <[email protected]>
Re: [PATCH 06/19] arm: convert to generic init_task.c
In reply to Kyle McMartinQuoted 2 lines · Kyle McMartin
Signed-off-by Kyle McMartin <[email protected]>
Looks fine.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
Geert Uytterhoeven
maintainerQuoted 11 lines · Kyle McMartin
Create a common
kernel/init_task.c, and convert low hanging fruit to use it. Architecture maintainers will need to ensure that I didn't break anything before applying theinit_taskremoval patch to their arch.A few architectures appear to possibly rely on link-ordering (with an extra-y makefile rule) and may need additional linker script rules.
Unconverted architectures so far are m68k (because it doesn't use an explicit
init_task.c), ia64 (because it faffs about withinit_thread_union), and sparc{,64} (which appear to rely on some magic.)
m68k just has the same code as anyone else embedded in arch/m68k/kernel/process.c.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Arnd Bergmann
maintainerQuoted 6 lines · Geert Uytterhoeven
Quoted 3 lines
Unconverted architectures so far are m68k (because it doesn't use an explicit
init_task.c), ia64 (because it faffs about withinit_thread_union), and sparc{,64} (which appear to rely on some magic.)m68k just has the same code as anyone else embedded in
arch/m68k/kernel/process.c.
There is an extra aligned(THREAD_SIZE))) attribute in the m68k thread_info definition, just like sparc and mips. Are you sure that removing it is safe on m68k?
Arnd <><
Geert Uytterhoeven
maintainerQuoted 11 lines · Arnd Bergmann
Quoted 6 lines · Geert Uytterhoeven
Quoted 3 lines
Unconverted architectures so far are m68k (because it doesn't use an explicit
init_task.c), ia64 (because it faffs about withinit_thread_union), and sparc{,64} (which appear to rely on some magic.)m68k just has the same code as anyone else embedded in
arch/m68k/kernel/process.c.There is an extra
aligned(THREAD_SIZE))) attribute in the m68kthread_infodefinition, just like sparc and mips. Are you sure that removing it is safe on m68k?
Thanks, I missed that one. I should have launched `diff' instead of my own eyes...
Wondering, would it harm a lot having the aligned(THREAD_SIZE) everywhere?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Arnd Bergmann
maintainerQuoted 1 line · Geert Uytterhoeven
Wondering, would it harm a lot having the
aligned(THREAD_SIZE)everywhere?
No real harm, but some architectures don't require alignment of thread_info, and they might waste a few kb because of the forced alignment.
The easier solution should be to force the alignment in arch/{sparc,m68k}/vmlinux.lds.S, like the other architectures have it.
m68k-sun3 currently aligns thread_info to PAGE_SIZE, m68k aligns it to 8192. AFAICT, you can simply replace both with THREAD_SIZE.
Arnd <><
Hi Kyle.
Quoted 4 lines
Unconverted architectures so far are m68k (because it doesn't use an explicit
init_task.c), ia64 (because it faffs about withinit_thread_union), and sparc{,64} (which appear to rely on some magic.)
sparc has harcoded the alignment requirments in init_task.c. I will try to make it look like all others by moving this to vmlinux.lds.
Speaking of that there seems to be another bit that could be shared between the arch vmlinux.lds as all arch has init_task included.
Sam
Arnd Bergmann
maintainerLeave arch/x86/kernel/init_task.c hanging around with the cpu0_irqstack definition in it, a later patch can move it to an appropriate place and nuke the file.
---
Quoted 3 lines · Kyle McMartin
Unconverted architectures so far are m68k (because it doesn't use an explicit
init_task.c), ia64 (because it faffs about withinit_thread_union), and sparc{,64} (which appear to rely on some magic.)
Apparently, you also forget arch/um. It is similar to the x86 version.
arch/um/kernel/init_task.c +1 -25
@@ -10,34 +10,10 @@#include "linux/mqueue.h" #include "asm/uaccess.h" -static struct fs_struct init_fs =INIT_FS ; -struct mm_struct init_mm =INIT_MM (init_mm); -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -EXPORT_SYMBOL (init_mm); - -/* -* Initial task structure. -* -* All other task structs will be allocated on slabs in fork.c -*/ - -struct task_struct init_task =INIT_TASK (init_task); - -EXPORT_SYMBOL (init_task); -/* -* Initial thread structure. -* -* We need to make sure that this is aligned due to the -* way process stacks are handled. This is done by having a special -* "init_task" linker map entry.. +* This definition is left over from the move to kernel/init_task.c */ -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = - { INIT_THREAD_INFO(init_task) }; - union thread_union cpu0_irqstack __attribute__((__section__(".data.init_irqstack"))) = { INIT_THREAD_INFO(init_task) };
Arnd Bergmann
maintainerQuoted 4 lines · Kyle McMartin
Create a common
kernel/init_task.c, and convert low hanging fruit to use it. Architecture maintainers will need to ensure that I didn't break anything before applying theinit_taskremoval patch to their arch.
Incidentally, I was working on the same stuff already, just didn't get around to posting it before the discussion arose here. My patches were largely identical, so I'm just commenting on what I found beyond what you did.
The major difference to my patch is that I added a CONFIG_GENERIC_INIT_TASK to each architecture I converted rather than remove the HAVE_ARCH_INIT_TASK.
Quoted 2 lines
A few architectures appear to possibly rely on link-ordering (with an extra-y makefile rule) and may need additional linker script rules.
My approach was add "head-y += kernel/init_task" to each architecture Makefile in order to keep the link order the same. If it work without that, even better.
Quoted 3 lines
Unconverted architectures so far are m68k (because it doesn't use an explicit
init_task.c), ia64 (because it faffs about withinit_thread_union), and sparc{,64} (which appear to rely on some magic.)
And you forgot about um and cris. I'll follow up with trivial patches.
Quoted 2 lines
The other open question is what to do about
init_mm, which was supposed to be removed in 2.6.26...
Only the EXPORT_SYMBOL was to be removed, not the init_mm itself, because it is still referenced by init_task. I'd vote for not putting the export into kernel/init_task.c. There are no modular users in the kernel.
Arnd <><
Arnd Bergmann
maintainerPATCH 1/1 cris: convert to generic init_task
In reply to Kyle McMartin---
This assumes that the kernel/init_task.c file is already present.
arch/cris/kernel/process.c +0 -34
@@ -31,40 +31,6 @@//#define DEBUG /* -* Initial task structure. Make this a per-architecture thing, -* because different architectures tend to have different -* alignment requirements and potentially different initial -* setup. -*/ - -static struct fs_struct init_fs =INIT_FS ; -static struct signal_struct init_signals =INIT_SIGNALS (init_signals); -static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); - -EXPORT_SYMBOL (init_mm); - -/* -* Initial thread structure. -* -* We need to make sure that this is 8192-byte aligned due to the -* way process stacks are handled. This is done by having a special -* "init_task" linker map entry.. -*/ -union thread_union init_thread_union - __attribute__((__section__(".data.init_task"))) = - { INIT_THREAD_INFO(init_task) }; - -/* -* Initial task structure. -* -* All other task structs will be allocated on slabs in fork.c -*/ -struct task_struct init_task =INIT_TASK (init_task); - -EXPORT_SYMBOL (init_task); - -/* * The hlt_counter, disable_hlt and enable_hlt is just here as a hook if * there would ever be a halt sequence (for power save when idle) with * some largish delay when halting or resuming *and* a driver that can't
Arnd Bergmann
maintainerQuoted 7 lines · Kyle McMartin
Create a common
kernel/init_task.c, and convert low hanging fruit to use it. Architecture maintainers will need to ensure that I didn't break anything before applying theinit_taskremoval patch to their arch.A few architectures appear to possibly rely on link-ordering (with an extra-y makefile rule) and may need additional linker script rules.
FWIW, here is the alignment of init_thread_info on all architectures:
alpha: 2 * PAGE_SIZE
arm, avr32, frv, mn10300, s390, sh, x86: THREAD_SIZE
blackfin: THREAD_SIZE, but uses a different section cris, m68k-sun3: PAGE_SIZE
h8300, m32r, m68knommu, ppc32, xtensa, m68k-std: 0x2000/8192
ia64: PAGE_SIZE (but ia64 is different)
mips: _PAGE_SIZE
parisc, ppc64: 16384
ppc32: 8192
um: KERNEL_STACK_SIZE
sparc: PAGE_SIZE with .text section
sparc64: 16384 (implicit)
This is the same as THREAD_SIZE on all architectures, except for mips in certain configurations, which should be fixed.
Maybe we can get all of them to just use THREAD_SIZE in there?
Arnd <><