From: George Anzinger <george@mvista.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Ulrich Drepper <drepper@redhat.com>,
johnstul@us.ibm.com, Ulrich.Windl@rz.uni-regensburg.de,
jbarnes@sgi.com, linux-kernel@vger.kernel.org,
libc-alpha@sources.redhat.com
Subject: Re: Posix compliant CLOCK_PROCESS/THREAD_CPUTIME_ID V4
Date: Wed, 29 Sep 2004 12:27:26 -0700 [thread overview]
Message-ID: <415B0C9E.5060000@mvista.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0409291054230.25276@schroedinger.engr.sgi.com>
Christoph Lameter wrote:
> On Wed, 29 Sep 2004, George Anzinger wrote:
>
>
>>Christoph Lameter wrote:
>>
>>>George asked for a test program so I wrote one and debugged the patch.
>>>The test program uses syscall to bypass glibc processing. I have been
>>>working on a patch for glibc but that gets a bit complicated
>>>because backwards compatibility has to be kept. Maybe tomorrow.
>>>Found also that glibc allows the setting of these clocks so I also
>>>implemented that and used it in the test program. Setting these
>>>clocks modifies stime and utime directly, which may not be such a good
>>>idea. Do we really need to be able to set these clocks?
>>
>>Another way of doing this is to save these values in the task structure. If
>>null, use the direct value of stime, utime, if not, adjust by the saved value
>>(i.e. saved value would represent time zero).
>
>
> But this would require two additional int field in task_t just for that
> rarely used functionality.
Exactly. What does the community want? An alternative is to allocate a small
block of memory for this and managed it from the posix-timers.c code. It would
only be referenced by get_clock and set_clock. And be released by the
exit_itimers() code.
>
>
>>Please, when sending patches, attach them. This avoids problems with mailers,
>>on both ends, messing with white space. They still appear in line, at least in
>>some mailers (mozilla in my case).
>
>
> The custom on lkml, for Linus and Andrew is to send them inline. I also
> prefer them inline. Will try to remember sending attachments when sending a
> patch to you.
I think they WILL be inline as well as attached if you attach them. The
difference is that in both presentations neither mailer will mess with white
space. This means that long lines will not be wrapped and tabs vs space will
not be changed.
Try sending yourself one and see it this is not true for your mailer.
>
>>As to the test program, what happens when you attempt to set up a timer on these
>>clocks? (No, I don't think it should work, but we DO want to properly error
>>out. And the test should verify that this happens.) By the way, if you use the
>>support package from sourceforge, you will find a lot of test harness stuff.
>
>
> That is an interesting issue. If that would work correctly one could
> trigger an signal if more than a certain amount of cputime is used.
> It looks though that it will create an interrupt based on real time.
>
> SuS says:
>
> Each implementation defines a set of clocks that can be used as timing
> bases for per-process timers. All implementations support a clock_id of
> CLOCK_REALTIME.
>
> So restrict timer_create to CLOCK_REALTIME and CLOCK_MONOTONIC? Is it
> necessary to be able to derive a timer from a timer derives from those
> two?
>
> something like the following (just inlined for the discussion ...)?
NO. This is handled through the dispatch table (as set up when you register the
clock). You just supply a timer_create() function that returns the right error.
Likewise, attempts to use clock_nanosleep(). The issue with clock_nanosleep,
however, is that it, at this time, is not sent through the dispatch table. This
should be changed to, again call the same error function.
>
> --- linux-2.6.9-rc2.orig/kernel/posix-timers.c 2004-09-28 20:29:28.000000000 -0700
> +++ linux-2.6.9-rc2/kernel/posix-timers.c 2004-09-29 11:12:37.814713085 -0700
> @@ -585,8 +585,8 @@
> sigevent_t event;
> int it_id_set = IT_ID_NOT_SET;
>
> - if ((unsigned) which_clock >= MAX_CLOCKS ||
> - !posix_clocks[which_clock].res)
> + if ((unsigned) which_clock != CLOCK_REALTIME &&
> + (unsigned) which_clock != CLOCK_MONOTONIC)
> return -EINVAL;
>
> new_timer = alloc_posix_timer();
>
--
George Anzinger george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml
next prev parent reply other threads:[~2004-09-29 19:28 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <B6E8046E1E28D34EB815A11AC8CA312902CD3264@mtv-atc-605e--n.corp.sgi.com>
2004-09-24 12:16 ` [time] add support for CLOCK_THREAD_CPUTIME_ID and CLOCK_PROCESS_CPUTIME_ID Christoph Lameter
2004-09-25 4:25 ` Ulrich Drepper
2004-09-25 5:25 ` Christoph Lameter
2004-09-25 5:54 ` Christoph Lameter
2004-09-25 6:08 ` Ulrich Drepper
2004-09-25 14:51 ` Christoph Lameter
2004-09-25 15:19 ` Ulrich Drepper
2004-09-27 15:03 ` Christoph Lameter
2004-09-27 15:34 ` Christoph Lameter
[not found] ` <B6E8046E1E28D34EB815A11AC8CA312902CD327E@mtv-atc-605e--n.corp.sgi.com>
2004-09-27 20:58 ` [RFC] Posix compliant behavior of CLOCK_PROCESS/THREAD_CPUTIME_ID Christoph Lameter
2004-09-27 22:54 ` George Anzinger
2004-09-28 19:18 ` Ulrich Drepper
2004-09-28 19:25 ` Christoph Lameter
2004-09-29 3:25 ` Posix compliant CLOCK_PROCESS/THREAD_CPUTIME_ID V4 Christoph Lameter
2004-09-29 17:45 ` George Anzinger
2004-09-29 18:14 ` Christoph Lameter
2004-09-29 19:27 ` George Anzinger [this message]
2004-09-29 19:34 ` Christoph Lameter
2004-09-29 19:52 ` Jesper Juhl
2004-09-30 0:14 ` patches inline in mail George Anzinger
2004-09-30 3:24 ` Paul Jackson
2004-10-01 5:29 ` Andrew Morton
2004-10-01 12:28 ` Alan Cox
2004-10-01 13:42 ` Paul Fulghum
2004-10-01 19:53 ` Lee Revell
2004-10-01 21:58 ` George Anzinger
2004-10-02 15:52 ` Olaf Dietsche
2004-10-02 15:20 ` Alan Cox
2004-10-03 21:01 ` [OT] " Guennadi Liakhovetski
2004-10-03 23:18 ` Jesper Juhl
2004-10-04 6:20 ` Paul Jackson
2004-10-04 19:11 ` Guennadi Liakhovetski
2004-10-04 7:26 ` Ulrich Windl
2004-10-03 21:35 ` George Anzinger
2004-10-04 3:00 ` Jim Nelson
2004-10-01 9:04 ` Jesper Juhl
2004-09-29 19:32 ` Posix compliant CLOCK_PROCESS/THREAD_CPUTIME_ID V5 Christoph Lameter
2004-10-01 19:57 ` Posix compliant cpu clocks V6 [0/3]: Rationale and test program Christoph Lameter
[not found] ` <B6E8046E1E28D34EB815A11AC8CA31290322B307@mtv-atc-605e--n.corp.sgi.com>
2004-10-01 19:59 ` Posix compliant cpu clocks V6 [1/3]: Generic Kernel patch Christoph Lameter
2004-10-01 21:03 ` Andrew Morton
2004-10-01 20:01 ` Posix compliant cpu clocks V6 [2/3]: Glibc patch Christoph Lameter
2004-10-02 5:32 ` Ulrich Drepper
2004-10-04 15:04 ` Christoph Lameter
2004-10-04 16:27 ` Christoph Lameter
2004-10-06 13:53 ` Martijn Sipkema
2004-10-01 20:02 ` Posix compliant cpu clocks V6 [3/3]: mmtimer provides CLOCK_SGI_CYCLE Christoph Lameter
2004-10-07 4:56 ` Posix compliant cpu clocks V7 [0/2]: Rationale and test program Christoph Lameter
2004-10-12 20:19 ` Periodic posix timer support broke between 2.6.9-rc1 and 2.6.9-rc1-bk17 Christoph Lameter
2004-10-12 22:24 ` George Anzinger
2004-10-13 18:08 ` Alexander Nyberg
2004-10-13 18:11 ` Christoph Lameter
[not found] ` <B6E8046E1E28D34EB815A11AC8CA31290322B331@mtv-atc-605e--n.corp.sgi.com>
2004-10-07 4:57 ` Posix compliant cpu clocks V7 [1/2]: Kernel Patch Christoph Lameter
2004-10-07 4:59 ` Posix compliant cpu clocks V7 [2/2]: Glibc patch Christoph Lameter
2004-10-21 19:32 ` Posix compliant process clock patch for the linux arch in glibc Christoph Lameter
2004-10-01 21:57 ` [RFC] Posix compliant behavior of CLOCK_PROCESS/THREAD_CPUTIME_ID Roland McGrath
2004-10-01 23:30 ` Christoph Lameter
2004-10-04 18:48 ` RFC: Posix compliant clock_getclockcpuid(pid) to access other processes clocks 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=415B0C9E.5060000@mvista.com \
--to=george@mvista.com \
--cc=Ulrich.Windl@rz.uni-regensburg.de \
--cc=clameter@sgi.com \
--cc=drepper@redhat.com \
--cc=jbarnes@sgi.com \
--cc=johnstul@us.ibm.com \
--cc=libc-alpha@sources.redhat.com \
--cc=linux-kernel@vger.kernel.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 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.