linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Consolidate init_task handling and expand macros
@ 2017-12-08 15:51 David Howells
  2017-12-08 15:51 ` [PATCH 1/5] Construct init thread stack in the linker script rather than by union David Howells
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: David Howells @ 2017-12-08 15:51 UTC (permalink / raw)
  To: linux-arch, x86, linux-ia64; +Cc: dhowells, torvalds, linux-kernel


It doesn't seem useful to have the init_task in a header file rather than
in a normal source file.  We could consolidate init_task handling instead and
expand out various macros.

Here's a series of patches that consolidate init_task handling:

 (1) Alter the INIT_TASK_DATA linker script macro to set init_thread_union
     and init_stack rather than defining these in C.

     Insert init_task and init_thread_into into the init_stack area in the
     linker script as appropriate to the configuration, with different
     section markers so that they end up correctly ordered.

     We can then get merge ia64's init_task.c into the main one.

We then have a bunch of single-use INIT_*() macros that seem only to be
macros because they used to be used per-arch.  We can then expand these in
place of the user and get rid of a few lines and a lot of backslashes.

 (2) Expand INIT_TASK() in place.

 (3) Expand in place various small INIT_*() macros that are defined
     conditionally.  Expand them and surround them by #if[n]def/#endif in
     the .c file as it takes fewer lines.

 (4) Expand INIT_SIGNALS() and INIT_SIGHAND() in place.

 (5) Expand INIT_STRUCT_PID in place.

These macros can then be discarded.

The patches can be found here also:

	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=init_task

David
---
David Howells (5):
      Construct init thread stack in the linker script rather than by union
      Expand INIT_TASK() in init/init_task.c and remove
      Expand various INIT_* macros and remove
      Expand the INIT_SIGNALS and INIT_SIGHAND macros and remove
      Expand INIT_STRUCT_PID and remove


 arch/Kconfig                              |    4 
 arch/alpha/include/asm/thread_info.h      |    3 
 arch/arc/include/asm/thread_info.h        |    3 
 arch/arm/include/asm/thread_info.h        |    3 
 arch/arm64/include/asm/thread_info.h      |    2 
 arch/blackfin/include/asm/thread_info.h   |    2 
 arch/c6x/include/asm/thread_info.h        |    3 
 arch/cris/include/asm/processor.h         |    2 
 arch/cris/include/asm/thread_info.h       |    2 
 arch/frv/include/asm/thread_info.h        |    3 
 arch/h8300/include/asm/thread_info.h      |    3 
 arch/hexagon/include/asm/thread_info.h    |    3 
 arch/ia64/Kconfig                         |    2 
 arch/ia64/Makefile                        |    2 
 arch/ia64/include/asm/thread_info.h       |    4 
 arch/ia64/kernel/Makefile                 |    2 
 arch/ia64/kernel/init_task.c              |   44 -----
 arch/ia64/kernel/vmlinux.lds.S            |    1 
 arch/m32r/include/asm/thread_info.h       |    3 
 arch/m68k/include/asm/thread_info.h       |    4 
 arch/metag/include/asm/thread_info.h      |    3 
 arch/microblaze/include/asm/thread_info.h |    3 
 arch/mips/include/asm/thread_info.h       |    3 
 arch/mn10300/include/asm/thread_info.h    |    2 
 arch/nios2/include/asm/thread_info.h      |    3 
 arch/openrisc/include/asm/processor.h     |    2 
 arch/openrisc/include/asm/thread_info.h   |    2 
 arch/parisc/include/asm/thread_info.h     |    3 
 arch/powerpc/include/asm/thread_info.h    |    3 
 arch/s390/include/asm/thread_info.h       |    2 
 arch/score/include/asm/thread_info.h      |    3 
 arch/sh/include/asm/thread_info.h         |    3 
 arch/sparc/include/asm/thread_info_32.h   |    3 
 arch/sparc/include/asm/thread_info_64.h   |    3 
 arch/tile/include/asm/thread_info.h       |    3 
 arch/um/include/asm/processor-generic.h   |    5 -
 arch/um/include/asm/thread_info.h         |    9 -
 arch/um/include/asm/vmlinux.lds.h         |    2 
 arch/um/kernel/dyn.lds.S                  |    3 
 arch/um/kernel/um_arch.c                  |    2 
 arch/um/kernel/uml.lds.S                  |    2 
 arch/unicore32/include/asm/thread_info.h  |    3 
 arch/x86/include/asm/thread_info.h        |    2 
 arch/xtensa/include/asm/thread_info.h     |    3 
 include/asm-generic/vmlinux.lds.h         |    4 
 include/linux/ftrace.h                    |   12 -
 include/linux/init_task.h                 |  258 +----------------------------
 include/linux/irqflags.h                  |    2 
 include/linux/lockdep.h                   |    3 
 include/linux/sched.h                     |    9 +
 init/Makefile                             |    2 
 init/init_task.c                          |  170 ++++++++++++++++++-
 kernel/pid.c                              |   14 +-
 53 files changed, 219 insertions(+), 422 deletions(-)
 delete mode 100644 arch/ia64/kernel/init_task.c
 create mode 100644 arch/um/include/asm/vmlinux.lds.h

^ permalink raw reply	[flat|nested] 24+ messages in thread
* [PATCH 0/5] Consolidate init_task handling
@ 2017-11-24 15:31 David Howells
  2017-11-24 15:31 ` [PATCH 1/5] Construct init thread stack in the linker script rather than by union David Howells
  0 siblings, 1 reply; 24+ messages in thread
From: David Howells @ 2017-11-24 15:31 UTC (permalink / raw)
  To: torvalds; +Cc: dhowells, linux-kernel


Hi Linus,

It doesn't seem useful to have the init_task in a header file rather than
in a normal source file.  We could consolidate init_task handling instead.
Do want to do this?  If so, this is probably something we'd want to do at
the end of the merge window, though not necessarily this one.

Here's a series of patches that consolidate init_task handling:

 (1) Alter the INIT_TASK_DATA linker script macro to set init_thread_union
     and init_stack rather than defining these in C.

     Insert init_task and init_thread_into into the init_stack area in the
     linker script as appropriate to the configuration, with different
     section markers so that they end up correctly ordered.

     We can then get merge ia64's init_task.c into the main one.

We then have a bunch of single-use INIT_*() macros that seem only to be
macros because they used to be used per-arch.  We can then unroll these in
place of the user and get rid of a few lines and a lot of backslashes.

 (2) Unroll INIT_TASK().

 (3) Unroll various small INIT_*() macros that are defined conditionally.
     Unroll them and surround them by #if[n]def/#endif in the .c file as it
     takes fewer lines.

 (4) Unroll INIT_SIGNALS() and INIT_SIGHAND().

 (5) Unroll INIT_STRUCT_PID.

The patches can be found here also:

	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=init_task

David
---
David Howells (5):
      Construct init thread stack in the linker script rather than by union
      Unroll INIT_TASK() in init/init_task.c
      Unroll various INIT_* macros
      Unroll the INIT_SIGNALS and INIT_SIGHAND macros
      Unroll INIT_STRUCT_PID


 arch/Kconfig                              |    4 
 arch/alpha/include/asm/thread_info.h      |    3 
 arch/arc/include/asm/thread_info.h        |    3 
 arch/arm/include/asm/thread_info.h        |    3 
 arch/arm64/include/asm/thread_info.h      |    2 
 arch/blackfin/include/asm/thread_info.h   |    2 
 arch/c6x/include/asm/thread_info.h        |    3 
 arch/cris/include/asm/processor.h         |    2 
 arch/cris/include/asm/thread_info.h       |    2 
 arch/frv/include/asm/thread_info.h        |    3 
 arch/h8300/include/asm/thread_info.h      |    3 
 arch/hexagon/include/asm/thread_info.h    |    3 
 arch/ia64/Kconfig                         |    2 
 arch/ia64/Makefile                        |    2 
 arch/ia64/include/asm/thread_info.h       |    4 
 arch/ia64/kernel/Makefile                 |    2 
 arch/ia64/kernel/init_task.c              |   44 -----
 arch/ia64/kernel/vmlinux.lds.S            |    1 
 arch/m32r/include/asm/thread_info.h       |    3 
 arch/m68k/include/asm/thread_info.h       |    4 
 arch/metag/include/asm/thread_info.h      |    3 
 arch/microblaze/include/asm/thread_info.h |    3 
 arch/mips/include/asm/thread_info.h       |    3 
 arch/mn10300/include/asm/thread_info.h    |    2 
 arch/nios2/include/asm/thread_info.h      |    3 
 arch/openrisc/include/asm/processor.h     |    2 
 arch/openrisc/include/asm/thread_info.h   |    2 
 arch/parisc/include/asm/thread_info.h     |    3 
 arch/powerpc/include/asm/thread_info.h    |    3 
 arch/s390/include/asm/thread_info.h       |    2 
 arch/score/include/asm/thread_info.h      |    3 
 arch/sh/include/asm/thread_info.h         |    3 
 arch/sparc/include/asm/thread_info_32.h   |    3 
 arch/sparc/include/asm/thread_info_64.h   |    3 
 arch/tile/include/asm/thread_info.h       |    3 
 arch/um/include/asm/processor-generic.h   |    5 -
 arch/um/include/asm/thread_info.h         |    9 -
 arch/um/include/asm/vmlinux.lds.h         |    2 
 arch/um/kernel/dyn.lds.S                  |    3 
 arch/um/kernel/um_arch.c                  |    2 
 arch/um/kernel/uml.lds.S                  |    2 
 arch/unicore32/include/asm/thread_info.h  |    3 
 arch/x86/include/asm/thread_info.h        |    2 
 arch/xtensa/include/asm/thread_info.h     |    3 
 include/asm-generic/vmlinux.lds.h         |    4 
 include/linux/ftrace.h                    |   12 -
 include/linux/init_task.h                 |  258 +----------------------------
 include/linux/irqflags.h                  |    2 
 include/linux/lockdep.h                   |    3 
 include/linux/sched.h                     |    9 +
 init/Makefile                             |    2 
 init/init_task.c                          |  170 ++++++++++++++++++-
 kernel/pid.c                              |   14 +-
 53 files changed, 219 insertions(+), 422 deletions(-)
 delete mode 100644 arch/ia64/kernel/init_task.c
 create mode 100644 arch/um/include/asm/vmlinux.lds.h

^ permalink raw reply	[flat|nested] 24+ messages in thread
* [PATCH 0/5] Consolidate init_task handling
@ 2017-07-20 12:50 David Howells
  2017-07-20 12:50 ` [PATCH 1/5] Construct init thread stack in the linker script rather than by union David Howells
  0 siblings, 1 reply; 24+ messages in thread
From: David Howells @ 2017-07-20 12:50 UTC (permalink / raw)
  To: mingo; +Cc: linux-arch, dhowells, linux-ia64, linux-kernel


Hi Ingo,

Is this something that could be taken into the tip tree?  It's a series of
patches that consolidate init_task handling:

 (1) Alter the INIT_TASK_DATA linker script macro to set init_thread_union
     and init_stack rather than defining these in C.

     Insert init_task and init_thread_into into the init_stack area in the
     linker script as appropriate to the configuration, with different
     section markers so that they end up correctly ordered.

     We can then get merge ia64's init_task.c into the main one.

We then have a bunch of single-use INIT_*() macros that seem only to be
macros because they used to be used per-arch.  We can then unroll these in
place of the user and get rid of a few lines and a lot of backslashes.

 (2) Unroll INIT_TASK().

 (3) Unroll various small INIT_*() macros that are defined conditionally.
     Unroll them and surround them by #if[n]def/#endif in the .c file as it
     takes fewer lines.

 (4) Unroll INIT_SIGNALS() and INIT_SIGHAND().

 (5) Unroll INIT_STRUCT_PID.

The patches can be found here also:

	http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=init_task

David
---
David Howells (5):
      Construct init thread stack in the linker script rather than by union
      Unroll INIT_TASK() in init/init_task.c
      Unroll various INIT_* macros
      Unroll the INIT_SIGNALS and INIT_SIGHAND macros
      Unroll INIT_STRUCT_PID


 arch/Kconfig                              |    4 
 arch/alpha/include/asm/thread_info.h      |    3 
 arch/arc/include/asm/thread_info.h        |    3 
 arch/arm/include/asm/thread_info.h        |    3 
 arch/arm64/include/asm/thread_info.h      |    2 
 arch/blackfin/include/asm/thread_info.h   |    2 
 arch/c6x/include/asm/thread_info.h        |    3 
 arch/cris/include/asm/processor.h         |    2 
 arch/cris/include/asm/thread_info.h       |    2 
 arch/frv/include/asm/thread_info.h        |    3 
 arch/h8300/include/asm/thread_info.h      |    3 
 arch/hexagon/include/asm/thread_info.h    |    3 
 arch/ia64/Kconfig                         |    2 
 arch/ia64/Makefile                        |    2 
 arch/ia64/include/asm/thread_info.h       |    4 
 arch/ia64/kernel/Makefile                 |    2 
 arch/ia64/kernel/init_task.c              |   43 -----
 arch/ia64/kernel/vmlinux.lds.S            |    1 
 arch/m32r/include/asm/thread_info.h       |    3 
 arch/m68k/include/asm/thread_info.h       |    4 
 arch/metag/include/asm/thread_info.h      |    3 
 arch/microblaze/include/asm/thread_info.h |    3 
 arch/mips/include/asm/thread_info.h       |    3 
 arch/mn10300/include/asm/thread_info.h    |    2 
 arch/nios2/include/asm/thread_info.h      |    3 
 arch/openrisc/include/asm/processor.h     |    2 
 arch/openrisc/include/asm/thread_info.h   |    2 
 arch/parisc/include/asm/thread_info.h     |    3 
 arch/powerpc/include/asm/thread_info.h    |    3 
 arch/s390/include/asm/thread_info.h       |    2 
 arch/score/include/asm/thread_info.h      |    3 
 arch/sh/include/asm/thread_info.h         |    3 
 arch/sparc/include/asm/thread_info_32.h   |    3 
 arch/sparc/include/asm/thread_info_64.h   |    3 
 arch/tile/include/asm/thread_info.h       |    3 
 arch/um/include/asm/processor-generic.h   |    2 
 arch/um/include/asm/thread_info.h         |    9 -
 arch/um/include/asm/vmlinux.lds.h         |    2 
 arch/um/kernel/dyn.lds.S                  |    2 
 arch/um/kernel/um_arch.c                  |    2 
 arch/um/kernel/uml.lds.S                  |    2 
 arch/unicore32/include/asm/thread_info.h  |    3 
 arch/x86/include/asm/thread_info.h        |    2 
 arch/xtensa/include/asm/thread_info.h     |    3 
 include/asm-generic/vmlinux.lds.h         |    4 
 include/linux/ftrace.h                    |   12 -
 include/linux/init_task.h                 |  264 +----------------------------
 include/linux/irqflags.h                  |    2 
 include/linux/lockdep.h                   |    3 
 include/linux/sched.h                     |    9 +
 init/Makefile                             |    2 
 init/init_task.c                          |  173 ++++++++++++++++++-
 kernel/pid.c                              |   15 ++
 53 files changed, 219 insertions(+), 427 deletions(-)
 delete mode 100644 arch/ia64/kernel/init_task.c
 create mode 100644 arch/um/include/asm/vmlinux.lds.h

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-01-17 11:14 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 15:51 [PATCH 0/5] Consolidate init_task handling and expand macros David Howells
2017-12-08 15:51 ` [PATCH 1/5] Construct init thread stack in the linker script rather than by union David Howells
2017-12-08 15:51 ` [PATCH 2/5] Expand INIT_TASK() in init/init_task.c and remove David Howells
2017-12-08 15:51 ` [PATCH 3/5] Expand various INIT_* macros " David Howells
2017-12-08 15:51 ` [PATCH 4/5] Expand the INIT_SIGNALS and INIT_SIGHAND " David Howells
2017-12-28 15:04   ` Thomas Gleixner
2018-01-02 14:33   ` David Howells
2018-01-17 11:14     ` Thomas Gleixner
2017-12-08 15:51 ` [PATCH 5/5] Expand INIT_STRUCT_PID " David Howells
2017-12-08 15:54 ` Does this break IA64 Linux? David Howells
2017-12-08 18:30   ` Luck, Tony
2017-12-08 19:04   ` David Howells
2017-12-08 22:14     ` Luck, Tony
2017-12-08 22:24     ` David Howells
2017-12-08 22:33       ` Luck, Tony
2017-12-08 15:56 ` Adding init_task consolidation patches to linux-next David Howells
2017-12-10 20:08   ` Stephen Rothwell
2017-12-14 18:21   ` David Howells
2017-12-14 18:32     ` Palmer Dabbelt
2017-12-15  8:36       ` David Howells
2017-12-15 18:52         ` Palmer Dabbelt
2017-12-15  2:49   ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2017-11-24 15:31 [PATCH 0/5] Consolidate init_task handling David Howells
2017-11-24 15:31 ` [PATCH 1/5] Construct init thread stack in the linker script rather than by union David Howells
2017-07-20 12:50 [PATCH 0/5] Consolidate init_task handling David Howells
2017-07-20 12:50 ` [PATCH 1/5] Construct init thread stack in the linker script rather than by union David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).