Skip to contentSkip to conversation

New: THREAD_SIZE on x86_64 is 4*PAGE_SIZE, not 2*PAGE_SIZE

Bug 214661 [email protected] 1 participant 3 messages Oct 9, 2021 – Oct 10, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=214661

Bug ID: 214661
Summary: THREAD_SIZE on x86_64 is 4*PAGE_SIZE, not 2*PAGE_SIZE
Product: Documentation
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: man-pages
Assignee: [email protected]
Reporter: [email protected]
Regression: No

According to '/root/linux/arch/x86/include/asm/page_64_types.h', THREAD_SIZE on x86_64 now is 4*PAGE_SIZE:

#ifdef CONFIG_KASAN
#define KASAN_STACK_ORDER 1
#else
#define KASAN_STACK_ORDER 0
#endif

#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER)
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)

However, the Documentation/x86/kernel-stacks.rst shows that THREAD_SIZE on x86_64 is 2*PAGE_SIZE:

Like all other architectures, x86_64 has a kernel stack for every active thread. These thread stacks are THREAD_SIZE (2*PAGE_SIZE) big.

I am not quite sure which is correct, Maybe the document needs an upgrade? Thanks a lot for any reply.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#1 lore raw

[Bug 214661] THREAD_SIZE on x86_64 is 4*PAGE_SIZE, not 2*PAGE_SIZE

https://bugzilla.kernel.org/show_bug.cgi?id=214661

--- Comment #1 from Alejandro Colomar (man-pages) ([email protected]) --- CC += LKML

Hello,

Quoted 12 lines · On 10/9/21 7:19 AM, [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=214661

Bug ID: 214661
Summary: THREAD_SIZE on x86_64 is 4*PAGE_SIZE, not 2*PAGE_SIZE
Product: Documentation
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: man-pages

This is incorrect.

The internal kernel documentation is not part of the man-pages. I checked to see if the manual pages need an update, but I couldn't find anything about THREAD_SIZE:

alx@sqli:~/src/linux/man-pages$ grep -rn THREAD_SIZE
alx@sqli:~/src/linux/man-pages$

I can't edit the component, so maybe you need to close the bug and open a new one in a different component.

Anyway, thanks for the report!

Alex

Quoted 26 lines

Assignee: [email protected]
Reporter: [email protected]
Regression: No

According to '/root/linux/arch/x86/include/asm/page_64_types.h', THREAD_SIZE on
x86_64 now is 4*PAGE_SIZE:

#ifdef CONFIG_KASAN
#define KASAN_STACK_ORDER 1
#else
#define KASAN_STACK_ORDER 0
#endif

#define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER)
#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER)

However, the Documentation/x86/kernel-stacks.rst shows that THREAD_SIZE on x86_64 is 2*PAGE_SIZE:

Like all other architectures, x86_64 has a kernel stack for every active thread. These thread stacks are THREAD_SIZE (2*PAGE_SIZE) big.

I am not quite sure which is correct, Maybe the document needs an upgrade? Thanks a lot for any reply.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#2 lore raw

[Bug 214661] THREAD_SIZE on x86_64 is 4*PAGE_SIZE, not 2*PAGE_SIZE

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=214661

silenceshell ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |WILL_FIX_LATER

--- Comment #2 from silenceshell ([email protected]) --- Thanks for your reply!

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.