linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation: x86: fix thread_info's position
@ 2020-11-10 14:21 Yang Mingzhe
  2020-11-10 15:03 ` David Laight
  0 siblings, 1 reply; 3+ messages in thread
From: Yang Mingzhe @ 2020-11-10 14:21 UTC (permalink / raw)
  To: tglx, mingo, bp, hpa, corbet; +Cc: x86, linux-kernel, linux-doc, Yang Mingzhe

The bottom of the stack is where the first item was added to the stack,
usually at the zero offset. Actually, the thread_info structure at the
end of the stack.

Please see attached picture:
https://github.com/Mutated1994/kernel-beginner/blob/master/kernel-stack.md

See commits c65eacb ("sched/core: Allow putting thread_info into
task_struct"), 15f4eae ("x86: Move thread_info into task_struct")
and 883d50f ("scripts/gdb: fix get_thread_info").

Signed-off-by: Yang Mingzhe <cainiao666999@gmail.com>
---
 Documentation/x86/kernel-stacks.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/x86/kernel-stacks.rst b/Documentation/x86/kernel-stacks.rst
index 6b0bcf0..b88b9e12 100644
--- a/Documentation/x86/kernel-stacks.rst
+++ b/Documentation/x86/kernel-stacks.rst
@@ -15,7 +15,9 @@ Like all other architectures, x86_64 has a kernel stack for every
 active thread.  These thread stacks are THREAD_SIZE (2*PAGE_SIZE) big.
 These stacks contain useful data as long as a thread is alive or a
 zombie. While the thread is in user space the kernel stack is empty
-except for the thread_info structure at the bottom.
+except for the thread_info structure at the end (since kernel 4.9, the
+thread_info has been moved into task_struct, no longer locates at the
+end of kernel stack).
 
 In addition to the per thread stacks, there are specialized stacks
 associated with each CPU.  These stacks are only used while the kernel
-- 
1.8.3.1


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

end of thread, other threads:[~2020-11-11  0:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10 14:21 [PATCH] Documentation: x86: fix thread_info's position Yang Mingzhe
2020-11-10 15:03 ` David Laight
2020-11-11  0:13   ` Yang Mingzhe

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).