lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAEffOLK9Vs36chTs9mjzYTdVJuCJOB+Uc4u6-4Ux8oTLTNGB8Q@mail.gmail.com>
Date:	Sat, 21 Apr 2012 14:52:16 +0800
From:	Yongle Zhang <linux.kevinzyl@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: A question from a beginner: why not record TIF_NEED_RESCHED flag for
 each CPU rather than for each thread?

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ