m68k: Calculate THREAD_SIZE from THREAD_SIZE_ORDER
PATCH 1/1 m68k: Calculate THREAD_SIZE from THREAD_SIZE_ORDER
Current THREAD_SIZE_OERDER implementatin is not generic for common case.
Improve it by:
- Define THREAD_SIZE_ORDER by specific platform configs.
- Calculate THREAD_SIZE by THREAD_SIZE_ORDER.
---
V1 -> V2:
- Remove ilog2().
- Calculate THREAD_SIZE by THREAD_SIZE_ORDER.
V1:
https://lore.kernel.org/lkml/[email protected]/
arch/m68k/include/asm/thread_info.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/m68k/include/asm/thread_info.h +5 -4
@@ -12,14 +12,15 @@*/ #if PAGE_SHIFT <13 #ifdef CONFIG_4KSTACKS -#define THREAD_SIZE 4096 +#define THREAD_SIZE_ORDER 0#else -#define THREAD_SIZE 8192 +#define THREAD_SIZE_ORDER 1#endif #else -#define THREAD_SIZE PAGE_SIZE +#define THREAD_SIZE_ORDER 0#endif -#define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1) + +#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)#ifndef __ASSEMBLY__
Signature · 1 line
2.27.0
Hi Geert,
Quoted 34 lines · Dawei Li
Current
THREAD_SIZE_OERDERimplementatin is not generic for common case.Improve it by:
- DefineTHREAD_SIZE_ORDERby specific platform configs.
- CalculateTHREAD_SIZEbyTHREAD_SIZE_ORDER.Suggested-by Geert Uytterhoeven <[email protected]>Signed-off-by Dawei Li <[email protected]>---
V1 -> V2:
- Removeilog2().
- CalculateTHREAD_SIZEbyTHREAD_SIZE_ORDER.V1:
https://lore.kernel.org/lkml/[email protected]/arch/m68k/include/asm/thread_info.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)arch/m68k/include/asm/thread_info.h +2
-2@@ -12,14 +12,15 @@*/ #if PAGE_SHIFT <13 #ifdef CONFIG_4KSTACKS -#define THREAD_SIZE 4096 +#define THREAD_SIZE_ORDER 0#else -#define THREAD_SIZE 8192 +#define THREAD_SIZE_ORDER 1#endif
arch/m68k/include/asm/thread_info.h line 26
Quoted 10 lines
arch/m68k/include/asm/thread_info.h +3
-2#else -#define THREAD_SIZE PAGE_SIZE +#define THREAD_SIZE_ORDER 0#endif -#define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1) + +#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)#ifndef __ASSEMBLY__
Sorry to bother, but any comments on this version?
I know it's awkward cuz it's in middle of merge window, sorry for that.
Thanks,
Dawei
Quoted 3 lines
Signature · 1 line
2.27.0
Quoted 6 lines · Dawei Li
Current
THREAD_SIZE_OERDERimplementatin is not generic for common case.Improve it by:
- DefineTHREAD_SIZE_ORDERby specific platform configs.
- CalculateTHREAD_SIZEbyTHREAD_SIZE_ORDER.
Quoted 7 lines
Suggested-by Geert Uytterhoeven <[email protected]>Signed-off-by Dawei Li <[email protected]>---
V1 -> V2:
- Removeilog2().
- CalculateTHREAD_SIZEbyTHREAD_SIZE_ORDER.
i.e. will queue in the m68k tree for v6.10.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
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