All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Campos <rodrigo-aOqSs0FX/Gu4Tu3zPC53fQ@public.gmane.org>
To: "Michael Kerrisk (man-pages)"
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-man <linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Peter Zijlstra
	<a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org>
Subject: Re: [PATCH] clock_getres.2: Remove obsolete note on SMP systems
Date: Wed, 4 Sep 2013 14:32:17 +0100	[thread overview]
Message-ID: <20130904133217.GC12620@sdfg.com.ar> (raw)
In-Reply-To: <CAKgNAkj_SumnwDQ=rxSBubybzOSTS9u0RjDBSR-1=KrTK7=L_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Wed, Sep 04, 2013 at 02:32:49PM +0200, Michael Kerrisk (man-pages) wrote:
> Hi Rodrigo,
> 
> On Tue, Sep 3, 2013 at 12:05 PM, Rodrigo Campos <rodrigo-aOqSs0FX/Gu4Tu3zPC53fQ@public.gmane.org> wrote:
> > As confirmed by peterz on IRC, this note is obsolete:
> >
> >         <peterz> rata: that section is obsolete; CLOCK_THREAD_CPUTIME_ID is good
> >         <peterz> rata: CLOCK_PROCESS_CPUTIME_ID is also correct
> >
> > So this patch just removes it.
> 
> Clearly, the page needs amending. However, ideal would be to describe
> *when* the section became obsolete (which kernel version). Do you or
> Peter know, or have an idea how we can determine that information?

I don't know. But looking at the git repo, it seems in the first git commit
(1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) it was already safe, because
in kernel/posix-cpu-timers.c cpu_clock_sample() uses the scheduler to get the
value. And the basic pattern:

	posix_cpu_clock_get() --> posix_cpu_clock_get() --> cpu_clock_sample()

(for the case of CLOCK_THREAD_CPUTIME_ID) seems unchanged. So, if I guess it was
safe on those days too.

And for CLOCK_PROCESS_CPUTIME_ID, something similar happens if I follow the code
correctly. The call chain I see is:

	process_cpu_clock_get() --> posix_cpu_clock_get() -->
	cpu_clock_sample_group() --> cpu_clock_sample_group_locked()

And if I follow the clock macros correctly, ends up calling
cpu_clock_sample_group_locked() with CPUCLOCK_SCHED, which calls the scheduler
and I *expect* that to be safe too.

But I would **really** like if Peter can confirm this, as I really don't know :-)



Btw, if in the first git commit it was safe, should I try to look to the history
before it ?




Thanks a lot,
Rodrigo
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-09-04 13:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 10:05 clock_getres.2: Remove obsolete note on SMP systems Rodrigo Campos
     [not found] ` <1378202731-29738-1-git-send-email-rodrigo-aOqSs0FX/Gu4Tu3zPC53fQ@public.gmane.org>
2013-09-03 10:05   ` [PATCH] " Rodrigo Campos
     [not found]     ` <1378202731-29738-2-git-send-email-rodrigo-aOqSs0FX/Gu4Tu3zPC53fQ@public.gmane.org>
2013-09-04 12:32       ` Michael Kerrisk (man-pages)
     [not found]         ` <CAKgNAkj_SumnwDQ=rxSBubybzOSTS9u0RjDBSR-1=KrTK7=L_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-04 13:32           ` Rodrigo Campos [this message]
     [not found]             ` <20130904133217.GC12620-aOqSs0FX/Gu4Tu3zPC53fQ@public.gmane.org>
2013-09-04 15:01               ` Michael Kerrisk (man-pages)
     [not found]                 ` <CAKgNAkjwVc3HLOL0n5upE5rOgqCN3TYGacrWMOzJ=uyv1mbHUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-04 15:11                   ` Rodrigo Campos
2013-09-04 16:01                   ` Christoph Lameter
     [not found]                     ` <00000140e9b4ede6-8b9dfd6f-7ca2-4d35-9454-389f6453031a-000000-p/GC64/jrecnJqMo6gzdpkEOCMrvLtNR@public.gmane.org>
2013-09-04 16:08                       ` Rodrigo Campos
     [not found]                         ` <20130904160815.GA15601-aOqSs0FX/Gu4Tu3zPC53fQ@public.gmane.org>
2013-09-04 16:47                           ` Christoph Lameter
     [not found]                             ` <00000140e9df10cd-71ca0078-fe11-4a8d-b588-93c2dfff098f-000000-p/GC64/jrecnJqMo6gzdpkEOCMrvLtNR@public.gmane.org>
2013-09-05  8:10                               ` Rodrigo Campos
     [not found]                                 ` <20130905081018.GA25617-aOqSs0FX/Gu4Tu3zPC53fQ@public.gmane.org>
2013-09-05 11:03                                   ` Michael Kerrisk (man-pages)
     [not found]                                     ` <CAKgNAki9BLKHmwJfJ6mhLtNjHf7cVEdE3bhpWXEKnhTCRt+FpA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-05 11:41                                       ` Rodrigo Campos
     [not found]                                         ` <20130905114136.GB27528-aOqSs0FX/Gu4Tu3zPC53fQ@public.gmane.org>
2013-09-06  4:11                                           ` Michael Kerrisk (man-pages)
     [not found]                                             ` <CAKgNAkiVoZXntTnmPXhEywLvAo08cZJNVWdvBSpCjEFN2tbWSw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-06  7:55                                               ` Rodrigo Campos
2013-09-05 14:22                                   ` Christoph Lameter
     [not found]                                     ` <00000140ee806e2a-6ac74d68-f5d8-4330-ab1c-fd8dd3a8ada3-000000-p/GC64/jrecnJqMo6gzdpkEOCMrvLtNR@public.gmane.org>
2013-09-06  7:47                                       ` Rodrigo Campos
2013-09-05 10:51                       ` Michael Kerrisk (man-pages)
2013-09-09 11:07           ` Peter Zijlstra

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=20130904133217.GC12620@sdfg.com.ar \
    --to=rodrigo-aoqss0fx/gu4tu3zpc53fq@public.gmane.org \
    --cc=a.p.zijlstra-/NLkJaSkS4VmR6Xm/wNWPw@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.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.