All of lore.kernel.org
 help / color / mirror / Atom feed
* A question from a beginner: why not record TIF_NEED_RESCHED flag for each CPU rather than for each thread?
@ 2012-04-21  6:52 Yongle Zhang
  0 siblings, 0 replies; only message in thread
From: Yongle Zhang @ 2012-04-21  6:52 UTC (permalink / raw)
  To: linux-kernel

Hi everyone~,

I'm a student, and a beginner learning linux. And when I'm reading the
kernel source code I got a question.
I discussed it with some friends and posed it on the internet, but
didn't get a clear answer. And they recommended me to ask for help
directly from the developers~
Wish this won't bother you!

The question is as below:

In linux kernel 2.6.11, the TIF_NEED_RESCHED flag is recorded in
thread_info struct for each task.

I searched the kernel and found that, it can only be set by the
current thread on the CPU for itself. So why not put the
TIF_NEED_RESCHED in some per CPU structure instead of in each
thread_info?

If this flag is only used to show that current thread on this cpu
needs schedule(), then I think perhaps it is OK to record it for each
CPU rather than for each thread?

If both of the methods are logically OK, then why is the flag recorded
in thread_info? Is it because of some performance issue, or some
historical reason?

Thanks for your attention and time~!
Best regards,

Kevin Zhang

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-21  6:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-21  6:52 A question from a beginner: why not record TIF_NEED_RESCHED flag for each CPU rather than for each thread? Yongle Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.