Skip to content

idle: Consolidate idle implementations

Thomas Gleixner kernel-janitors linux-arch lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest34 patches 52 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/34arch: Cleanup enable/disable_hltarch/arm/kernel/process.c arch/cris/arch-v32/kernel/process.c arch/cris/include/asm/processor.h +4 more+3 -600 replies
2/34arch: Consolidate tsk_is_polling()arch/alpha/include/asm/thread_info.h arch/ia64/include/asm/thread_info.h arch/metag/include/asm/thread_info.h +12 more+20 -343 replies
3/34idle: Implement set/clr functions for need_resched pollinclude/linux/sched.h+22 -11 reply
4/34idle: Provide a generic entry point for the idle codeinclude/linux/cpu.h init/main.c kernel/Makefile +2 more+21 -11 reply
5/34idle: Implement generic idle functionarch/Kconfig include/linux/cpu.h kernel/cpu/idle.c+116 -09 replies
6/34arc: Use generic idle looparch/arc/Kconfig arch/arc/kernel/process.c arch/arc/kernel/smp.c+3 -271 reply
7/34alpha: Use generic idle looparch/alpha/Kconfig arch/alpha/kernel/process.c arch/alpha/kernel/smp.c+2 -212 replies
8/34arm: Use generic idle looparch/arm/Kconfig arch/arm/include/asm/system_misc.h arch/arm/kernel/process.c +12 more+47 -9212 replies
9/34arm64: Use generic idle looparch/arm64/Kconfig arch/arm64/kernel/process.c arch/arm64/kernel/smp.c+7 -391 reply
10/34avr32: Use generic idle looparch/avr32/Kconfig arch/avr32/kernel/process.c arch/avr32/kernel/time.c +2 more+9 -441 reply
11/34bfin: Use generic idle looparch/blackfin/Kconfig arch/blackfin/kernel/process.c arch/blackfin/mach-common/smp.c+4 -290 replies
12/34c6x: Use generic idle looparch/c6x/Kconfig arch/c6x/kernel/process.c+2 -270 replies
13/34cris: Use generic idle looparch/cris/Kconfig arch/cris/arch-v10/kernel/process.c arch/cris/arch-v32/kernel/process.c +2 more+10 -322 replies
14/34frv: Use generic idle looparch/frv/Kconfig arch/frv/kernel/process.c+6 -220 replies
15/34h8300: Use generic idle looparch/h8300/Kconfig arch/h8300/kernel/process.c+5 -310 replies
16/34hexagon: Use generic idle looparch/hexagon/Kconfig arch/hexagon/kernel/process.c arch/hexagon/kernel/smp.c+5 -210 replies
17/34ia64: Use generic idle looparch/ia64/Kconfig arch/ia64/kernel/perfmon.c arch/ia64/kernel/process.c +1 more+23 -761 reply
18/34m32r: Use generic idle looparch/m32r/Kconfig arch/m32r/kernel/process.c arch/m32r/kernel/smpboot.c+2 -190 replies
19/34m68k: Use generic idle looparch/m68k/Kconfig arch/m68k/kernel/process.c+5 -280 replies
20/34metag: Use generic idle looparch/metag/Kconfig arch/metag/kernel/process.c arch/metag/kernel/smp.c+5 -302 replies
21/34microblaze: Use generic idle looparch/microblaze/Kconfig arch/microblaze/include/asm/processor.h arch/microblaze/kernel/process.c+2 -560 replies
22/34mips: Use generic idle looparch/mips/Kconfig arch/mips/kernel/process.c arch/mips/kernel/smp.c+15 -341 reply
23/34mn10300: Use generic idle looparch/mn10300/Kconfig arch/mn10300/kernel/process.c arch/mn10300/kernel/smp.c+8 -650 replies
24/34openrisc: Use generic idle looparch/openrisc/Kconfig arch/openrisc/kernel/idle.c+1 -730 replies
25/34parisc: Use generic idle looparch/parisc/Kconfig arch/parisc/kernel/process.c arch/parisc/kernel/smp.c+2 -230 replies
26/34powerpc: Use generic idle looparch/powerpc/Kconfig arch/powerpc/kernel/idle.c arch/powerpc/kernel/smp.c+24 -572 replies
27/34s390: Use generic idle looparch/s390/kernel/process.c arch/s390/kernel/smp.c+8 -202 replies
28/34score: Use generic idle looparch/score/Kconfig arch/score/kernel/process.c+1 -180 replies
29/34sh: Use generic idle looparch/sh/Kconfig arch/sh/kernel/idle.c arch/sh/kernel/smp.c+12 -941 reply
30/34tile: Enter idle with preemption disabledarch/tile/kernel/smpboot.c+0 -23 replies
31/34tile: Use generic idle looparch/tile/kernel/process.c arch/tile/kernel/smpboot.c+7 -562 replies
32/34unicore: Use generic idle looparch/unicore32/Kconfig arch/unicore32/kernel/process.c+4 -180 replies
33/34x86: Use generic idle looparch/x86/Kconfig arch/x86/kernel/process.c arch/x86/kernel/smpboot.c +1 more+32 -791 reply
34/34xtensa: Use generic idle looparch/xtensa/Kconfig arch/xtensa/kernel/process.c+3 -121 reply

Reviews trailers per patch

5 of 34 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChris MetcalfKevin HilmanCatalin MarinasJesper NilssonDavid S. MillerDeepthi DharwarSrivatsa S. BhatHans-Christian EgtvedtPaul E. McKenney
SeriesA-b A-b R-b R-b
1/34
2/34
3/34
4/34
5/34
6/34
7/34
8/34T-b R-b A-b A-b
9/34A-b
10/34A-b
11/34
12/34
13/34A-b
14/34
15/34
16/34
17/34
18/34
19/34
20/34
21/34
22/34
23/34
24/34
25/34
26/34T-b
27/34
28/34
29/34
30/34A-b
31/34
32/34
33/34
34/34

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 9 reviewers.

Read the v1 thread

Cover letter [patch 00/34] idle: Consolidate idle implementations

Each architecture implements its own cpu_idle() code, which is more or less the same on all architectures (plus/minus a few bugs and a few missing extra functionalities, instrumentation ...). That also forces everyone who is interested in idle related features to add new functionality to every architecture. What a waste.

Aside of that pointless code duplicaiton the ongoing quest to consolidate the cpu hotplug code needs a common entry point for the non boot cpus.

The following series implements a generic idle function and converts most architectures over. I left out SPARC (it involves sparc asm) and UM (it made me barf). If we can move those architectures as well, we can get rid of the extra config switch and have everything consolidated.

I spent a lot of time to make sure that the conversion preserved the non obvious differences of the architecture implementations, but I really need help from the affected maintainers to prove the correctness.

Thanks,

tglx

---
 arch/openrisc/kernel/idle.c                         |   73 ------------
 linux-2.6/arch/Kconfig                              |    3 
 linux-2.6/arch/alpha/Kconfig                        |    1 
 linux-2.6/arch/alpha/include/asm/thread_info.h      |    2 
 linux-2.6/arch/alpha/kernel/process.c               |   19 ---
 linux-2.6/arch/alpha/kernel/smp.c                   |    3 
 linux-2.6/arch/arc/Kconfig                          |    1 
 linux-2.6/arch/arc/kernel/process.c                 |   27 ----
 linux-2.6/arch/arc/kernel/smp.c                     |    2 
 linux-2.6/arch/arm/Kconfig                          |    2 
 linux-2.6/arch/arm/include/asm/system_misc.h        |    3 
 linux-2.6/arch/arm/kernel/process.c                 |  100 ++++-------------
 linux-2.6/arch/arm/kernel/smp.c                     |    2 
 linux-2.6/arch/arm/mach-gemini/idle.c               |    4 
 linux-2.6/arch/arm/mach-gemini/irq.c                |    2 
 linux-2.6/arch/arm/mach-ixp4xx/common.c             |    2 
 linux-2.6/arch/arm/mach-omap1/pm.c                  |    5 
 linux-2.6/arch/arm/mach-omap2/omap_hwmod.c          |    6 -
 linux-2.6/arch/arm/mach-omap2/pm.c                  |    5 
 linux-2.6/arch/arm/mach-orion5x/board-dt.c          |    2 
 linux-2.6/arch/arm/mach-orion5x/common.c            |    2 
 linux-2.6/arch/arm/mach-shark/core.c                |    2 
 linux-2.6/arch/arm/mach-shmobile/suspend.c          |    4 
 linux-2.6/arch/arm/mach-w90x900/dev.c               |    2 
 linux-2.6/arch/arm64/Kconfig                        |    1 
 linux-2.6/arch/arm64/kernel/process.c               |   43 -------
 linux-2.6/arch/arm64/kernel/smp.c                   |    2 
 linux-2.6/arch/avr32/Kconfig                        |    1 
 linux-2.6/arch/avr32/kernel/process.c               |   13 --
 linux-2.6/arch/avr32/kernel/time.c                  |    8 +
 linux-2.6/arch/avr32/mach-at32ap/include/mach/pm.h  |   24 ----
 linux-2.6/arch/avr32/mach-at32ap/pm-at32ap700x.S    |    7 -
 linux-2.6/arch/blackfin/Kconfig                     |    1 
 linux-2.6/arch/blackfin/kernel/process.c            |   30 -----
 linux-2.6/arch/blackfin/mach-common/smp.c           |    2 
 linux-2.6/arch/c6x/Kconfig                          |    1 
 linux-2.6/arch/c6x/kernel/process.c                 |   28 ----
 linux-2.6/arch/cris/Kconfig                         |    1 
 linux-2.6/arch/cris/arch-v10/kernel/process.c       |    3 
 linux-2.6/arch/cris/arch-v32/kernel/process.c       |   12 --
 linux-2.6/arch/cris/arch-v32/kernel/smp.c           |    4 
 linux-2.6/arch/cris/include/asm/processor.h         |    7 -
 linux-2.6/arch/cris/kernel/process.c                |   49 --------
 linux-2.6/arch/frv/Kconfig                          |    1 
 linux-2.6/arch/frv/kernel/process.c                 |   27 ----
 linux-2.6/arch/h8300/Kconfig                        |    1 
 linux-2.6/arch/h8300/kernel/process.c               |   35 ------
 linux-2.6/arch/hexagon/Kconfig                      |    1 
 linux-2.6/arch/hexagon/kernel/process.c             |   23 ----
 linux-2.6/arch/hexagon/kernel/smp.c                 |    2 
 linux-2.6/arch/ia64/Kconfig                         |    1 
 linux-2.6/arch/ia64/include/asm/thread_info.h       |    2 
 linux-2.6/arch/ia64/kernel/perfmon.c                |   13 --
 linux-2.6/arch/ia64/kernel/process.c                |   83 ++------------
 linux-2.6/arch/ia64/kernel/smpboot.c                |    2 
 linux-2.6/arch/m32r/Kconfig                         |    1 
 linux-2.6/arch/m32r/kernel/process.c                |   18 ---
 linux-2.6/arch/m32r/kernel/smpboot.c                |    2 
 linux-2.6/arch/m68k/Kconfig                         |    1 
 linux-2.6/arch/m68k/kernel/process.c                |   32 -----
 linux-2.6/arch/metag/Kconfig                        |    1 
 linux-2.6/arch/metag/include/asm/thread_info.h      |    2 
 linux-2.6/arch/metag/kernel/process.c               |   32 -----
 linux-2.6/arch/metag/kernel/smp.c                   |    2 
 linux-2.6/arch/microblaze/Kconfig                   |    2 
 linux-2.6/arch/microblaze/include/asm/processor.h   |    5 
 linux-2.6/arch/microblaze/include/asm/thread_info.h |    1 
 linux-2.6/arch/microblaze/kernel/process.c          |   65 -----------
 linux-2.6/arch/mips/Kconfig                         |    1 
 linux-2.6/arch/mips/kernel/process.c                |   46 ++------
 linux-2.6/arch/mips/kernel/smp.c                    |    2 
 linux-2.6/arch/mn10300/Kconfig                      |    1 
 linux-2.6/arch/mn10300/include/asm/thread_info.h    |    2 
 linux-2.6/arch/mn10300/kernel/process.c             |   70 +-----------
 linux-2.6/arch/mn10300/kernel/smp.c                 |    7 -
 linux-2.6/arch/openrisc/Kconfig                     |    1 
 linux-2.6/arch/openrisc/include/asm/thread_info.h   |    2 
 linux-2.6/arch/parisc/Kconfig                       |    1 
 linux-2.6/arch/parisc/include/asm/thread_info.h     |    2 
 linux-2.6/arch/parisc/kernel/process.c              |   22 ---
 linux-2.6/arch/parisc/kernel/smp.c                  |    2 
 linux-2.6/arch/powerpc/Kconfig                      |    1 
 linux-2.6/arch/powerpc/include/asm/thread_info.h    |    4 
 linux-2.6/arch/powerpc/kernel/idle.c                |   78 +++----------
 linux-2.6/arch/powerpc/kernel/smp.c                 |    2 
 linux-2.6/arch/s390/kernel/process.c                |   25 +---
 linux-2.6/arch/s390/kernel/smp.c                    |    3 
 linux-2.6/arch/score/Kconfig                        |    1 
 linux-2.6/arch/score/kernel/process.c               |   18 ---
 linux-2.6/arch/sh/Kconfig                           |    2 
 linux-2.6/arch/sh/include/asm/thread_info.h         |    4 
 linux-2.6/arch/sh/kernel/idle.c                     |  102 +----------------
 linux-2.6/arch/sh/kernel/smp.c                      |    2 
 linux-2.6/arch/sparc/include/asm/thread_info_32.h   |    2 
 linux-2.6/arch/sparc/include/asm/thread_info_64.h   |    2 
 linux-2.6/arch/tile/include/asm/thread_info.h       |    2 
 linux-2.6/arch/tile/kernel/process.c                |   61 +---------
 linux-2.6/arch/tile/kernel/smpboot.c                |    4 
 linux-2.6/arch/unicore32/Kconfig                    |    1 
 linux-2.6/arch/unicore32/kernel/process.c           |   21 ---
 linux-2.6/arch/x86/Kconfig                          |    1 
 linux-2.6/arch/x86/include/asm/thread_info.h        |    2 
 linux-2.6/arch/x86/kernel/process.c                 |  106 +++++-------------
 linux-2.6/arch/x86/kernel/smpboot.c                 |    2 
 linux-2.6/arch/x86/xen/smp.c                        |    2 
 linux-2.6/arch/xtensa/Kconfig                       |    1 
 linux-2.6/arch/xtensa/kernel/process.c              |   14 --
 linux-2.6/include/linux/cpu.h                       |   16 ++
 linux-2.6/include/linux/sched.h                     |   41 +++++++
 linux-2.6/init/main.c                               |    2 
 linux-2.6/kernel/Makefile                           |    1 
 linux-2.6/kernel/cpu/Makefile                       |    1 
 linux-2.6/kernel/cpu/idle.c                         |  115 ++++++++++++++++++++
 linux-2.6/kernel/sched/core.c                       |    5 
 114 files changed, 432 insertions(+), 1237 deletions(-)