From: Christoph Lameter <clameter@sgi.com>
To: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] back out CPU clock additions to posix-timers
Date: Sun, 19 Dec 2004 19:44:46 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.58.0412191940310.1708@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <200412182202.iBIM2RaZ030987@magilla.sf.frob.com>
Here is a patch that simply removes support for negative clockids from
2.6.10-rc. The support for positive clock_id should stay the same in
future kernels and follow straighforwardly the posix API without special
encodigns for CLOCK_*_CPUTIME_ID. Roland's patches would implement
negative clockid's to access process clocks but keep the existing
interface for positive clock_ids.
Index: linux-2.6.9/kernel/posix-timers.c
===================================================================
--- linux-2.6.9.orig/kernel/posix-timers.c 2004-12-17 14:40:16.000000000 -0800
+++ linux-2.6.9/kernel/posix-timers.c 2004-12-19 19:35:43.000000000 -0800
@@ -1307,28 +1307,8 @@
static int do_clock_gettime(clockid_t which_clock, struct timespec *tp)
{
- /* Process process specific clocks */
- if (which_clock < 0) {
- task_t *t;
- int pid = -which_clock;
-
- if (pid < PID_MAX_LIMIT) {
- if ((t = find_task_by_pid(pid))) {
- jiffies_to_timespec(process_ticks(t), tp);
- return 0;
- }
- return -EINVAL;
- }
- if (pid < 2*PID_MAX_LIMIT) {
- if ((t = find_task_by_pid(pid - PID_MAX_LIMIT))) {
- jiffies_to_timespec(thread_ticks(t), tp);
- return 0;
- }
- return -EINVAL;
- }
- /* More process specific clocks could follow here */
+ if (which_clock < 0)
return -EINVAL;
- }
if ((unsigned) which_clock >= MAX_CLOCKS ||
!posix_clocks[which_clock].res)
@@ -1356,8 +1336,8 @@
{
struct timespec rtn_tp;
- /* All process clocks have the resolution of CLOCK_PROCESS_CPUTIME_ID */
- if (which_clock < 0 ) which_clock = CLOCK_PROCESS_CPUTIME_ID;
+ if (which_clock < 0 )
+ return -EINVAL;
if ((unsigned) which_clock >= MAX_CLOCKS ||
!posix_clocks[which_clock].res)
next prev parent reply other threads:[~2004-12-20 3:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20041216143312.6910521d.akpm@osdl.org>
2004-12-18 22:02 ` Roland McGrath
2004-12-20 3:30 ` Christoph Lameter
2004-12-20 3:45 ` Roland McGrath
2004-12-20 3:44 ` Christoph Lameter [this message]
2004-12-20 3:47 ` Roland McGrath
2004-12-20 17:00 ` Christoph Lameter
2004-12-20 19:37 ` Roland McGrath
2004-12-20 20:15 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0412191940310.1708@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.com \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®