linux/arch/arc/kernel
Vineet Gupta fd476197c6 ARC: __switch_to: move ksp to thread_info from thread_struct
task's arch specific bits are carried in 2 places
 - embedded thread_struct in task_struct
 - associated thread_info (hoisted in task's stack page) and
   syntactically: (thread_info *)(task_struct->stack)

ksp (dynamic kernel stack top) currently lives in thread_struct but
given its deep location in task struct likely to cache miss when
accessed from  __switch_to(). Moving it to thread_info would be more
efficient given proximity to frequently accessed items such as
preempt_count thus very likely to be in cache, specially in schedular
code.

Note however that currently tsk.thread.ksp takes 1 memory access (off
of tsk pointer) while new code tsk->stack.ksp would take 2, but likely
to be in cache. Moreover if task is current the 2nd reference can be
elided and instead derived from SP as (SP & ~(THREAD_SIZE - 1))

All of this also makes __switch_to() code simpler and we can see the 2
ways of retirving ksp (descrobed above) in new code.

Signed-off-by: Vineet Gupta <vgupta@kernel.org>
2023-08-17 20:31:59 -07:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
arc_hostlink.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
arcksyms.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
asm-offsets.c ARC: __switch_to: move ksp to thread_info from thread_struct 2023-08-17 20:31:59 -07:00
ctx_sw_asm.S ARC: __switch_to: move ksp to thread_info from thread_struct 2023-08-17 20:31:59 -07:00
devtree.c ARC: -Wmissing-prototype warning fixes 2023-08-13 16:53:02 -07:00
disasm.c ARC: disasm: handle ARCv2 case in kprobe get/set functions 2022-04-26 09:34:42 -07:00
entry-arcv2.S ARC: mm: move MMU specific bits out of entry code ... 2021-08-24 14:25:48 -07:00
entry-compact.S ARC: entry: EV_Trap expects r10 (vs. r9) to have exception cause 2019-07-08 09:24:44 +01:00
entry.S ARC: entry: use gp to cache task pointer (vs. r25) 2023-08-17 20:31:59 -07:00
fpu.c ARC: fp: set FPU_STATUS.FWE to enable FPU_STATUS update on context switch 2021-08-03 18:58:33 -07:00
head.S ARC: [plat-hsdk] Remap CCMs super early in asm boot trampoline 2020-11-02 11:45:09 -08:00
intc-arcv2.c ARC: -Wmissing-prototype warning fixes 2023-08-13 16:53:02 -07:00
intc-compact.c arch/arc/kernel/: fix misspellings using codespell tool 2021-08-24 14:25:46 -07:00
irq.c irq: arc: avoid CONFIG_HANDLE_DOMAIN_IRQ 2021-10-25 10:05:28 +01:00
jump_label.c jump_label: make initial NOP patching the special case 2022-06-24 09:48:55 +02:00
kgdb.c ARC: kgdb: add 'fallthrough' to prevent a warning 2021-05-10 12:38:59 -07:00
kprobes.c kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
Makefile ARC: __switch_to: asm with dwarf ops (vs. inline asm) 2023-08-17 20:31:59 -07:00
mcip.c ARC: boot log: eliminate struct cpuinfo_arc #3: don't export 2023-08-17 20:31:59 -07:00
module.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
perf_event.c arc: perf: Move static structs to where they're really used 2021-12-28 19:48:49 -08:00
process.c ARC: __switch_to: move ksp to thread_info from thread_struct 2023-08-17 20:31:59 -07:00
ptrace.c ARC: entry: use gp to cache task pointer (vs. r25) 2023-08-17 20:31:59 -07:00
reset.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
setup.c ARC: boot log: eliminate struct cpuinfo_arc #4: boot log per ISA 2023-08-17 20:31:59 -07:00
signal.c ARC: -Wmissing-prototype warning fixes 2023-08-13 16:53:02 -07:00
smp.c ARC: -Wmissing-prototype warning fixes 2023-08-13 16:53:02 -07:00
stacktrace.c ARC: -Wmissing-prototype warning fixes 2023-08-13 16:53:02 -07:00
sys.c ARC: wireup clone3 syscall 2020-01-15 16:08:12 -08:00
traps.c ARC: -Wmissing-prototype warning fixes 2023-08-13 16:53:02 -07:00
troubleshoot.c arch/arc/kernel/troubleshoot: use vma_lookup() instead of find_vma() 2021-06-29 10:53:51 -07:00
unaligned.c ARC: fix typos in comments 2022-04-18 12:20:23 -07:00
unwind.c module: replace module_layout with module_memory 2023-03-09 12:55:15 -08:00
vmlinux.lds.S objtool/idle: Validate __cpuidle code as noinstr 2023-01-13 11:48:15 +01:00