All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: piotr@hosowicz.com, linux-kernel@vger.kernel.org,
	Jens Axboe <jens.axboe@oracle.com>,
	Divyesh Shah <dpshah@google.com>
Subject: Re: BUG: using smp_processor_id() in preemptible [00000000] code: icedove-bin/5449
Date: Wed, 26 May 2010 23:51:07 -0700	[thread overview]
Message-ID: <20100526235107.77e66ce0.akpm@linux-foundation.org> (raw)
In-Reply-To: <1274942798.27810.3584.camel@twins>

On Thu, 27 May 2010 08:46:38 +0200 Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, 2010-05-26 at 16:02 -0700, Andrew Morton wrote:
> 
> > How is anyone supposed to use this?  What are the semantics of this
> > thing?  What are the units of its return value?  What is the base value
> > of its return value?  Does it return different times on different CPUs?
> > I assume so, otherwise why does sched_clock_cpu() exist?  <looks at
> > the sched_clock_cpu() documentation, collapses in giggles>
> 
> The point of the whole sched_clock_cpu() thing is to provide a fairly
> high resolution clock with bounded drift between cpus.
> 
> It also promises to be monotonic per cpu argument, that is,
> sched_clock_cpu(j) will, for a constant j always return a monotonic
> increasing timestamp.
> 
> It doesn't make much promises about its base (although people tend to
> want it to start at 0 on boot, but the users really shouldn't care).
> 
> sched_clock() doesn't promise either bounded drift between cpus nor
> monotonicity.
> 

OK, well please document these subtleties things in a very obvious place.

Right now the code is a landmine.  Some poor innocent drivers/foo/
developer can use them and add fantastically subtle
once-per-million-machine-year lockup-causing bugs which he'll never be
able to diagnose.


  reply	other threads:[~2010-05-27  6:51 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-24  3:03 BUG: using smp_processor_id() in preemptible [00000000] code: icedove-bin/5449 Piotr Hosowicz
2010-05-24 17:22 ` Piotr Hosowicz
2010-05-25  8:50 ` Peter Zijlstra
2010-05-25  9:42   ` Piotr Hosowicz
2010-05-25  9:45     ` Peter Zijlstra
2010-05-25  9:43   ` Ingo Molnar
2010-05-25  9:47     ` Peter Zijlstra
2010-05-25  9:51       ` Peter Zijlstra
2010-05-25  9:57     ` Piotr Hosowicz
2010-05-25 10:00       ` Peter Zijlstra
2010-05-25 10:05         ` Piotr Hosowicz
2010-05-25 10:29           ` Piotr Hosowicz
2010-05-25 14:13             ` Piotr Hosowicz
2010-05-25 14:34               ` Piotr Hosowicz
2010-05-25 14:36                 ` Peter Zijlstra
2010-05-25 14:48                   ` Piotr Hosowicz
2010-05-25 16:15                     ` Peter Zijlstra
2010-05-25 16:47                       ` Piotr Hosowicz
2010-05-26  2:06                         ` Piotr Hosowicz
2010-05-26  2:51                           ` Piotr Hosowicz
2010-05-25 18:07   ` Divyesh Shah
2010-05-25 18:15     ` Piotr Hosowicz
2010-05-25 21:35     ` Peter Zijlstra
2010-05-26 23:02   ` Andrew Morton
2010-05-27  6:46     ` Peter Zijlstra
2010-05-27  6:51       ` Andrew Morton [this message]
     [not found]         ` <1274945751.27810.3765.camel@twins>
     [not found]           ` <20100527113340.d4afb8fc.akpm@linux-foundation.org>
2010-05-28 13:13             ` [PATCH] sched_clock: Provide local_clock() and improve documentation Peter Zijlstra
2010-05-28 13:42               ` Johannes Stezenbach
2010-05-28 15:08                 ` Peter Zijlstra
2010-05-28 14:15               ` Piotr Hosowicz
2010-05-28 14:22                 ` Piotr Hosowicz
2010-05-28 18:11               ` Chad Talbott
2010-05-28 18:22                 ` Peter Zijlstra
2010-06-09 10:13               ` [tip:sched/core] sched_clock: Add local_clock() API " tip-bot for Peter Zijlstra
2010-06-01  6:41   ` BUG: using smp_processor_id() in preemptible [00000000] code: icedove-bin/5449 Ingo Molnar
2010-06-01  6:47     ` Jens Axboe
2010-06-01  6:55       ` Ingo Molnar
2010-06-01  7:53         ` Jens Axboe
2010-06-12  1:54           ` Divyesh Shah
2010-06-12  9:42             ` Peter Zijlstra
2010-06-02 11:16         ` blkiocg_update_io_add_stats(): INFO: trying to register non-static key Ingo Molnar
2010-06-02 13:04           ` Jens Axboe
2010-06-11  1:33             ` Divyesh Shah
2010-06-11  7:15             ` Peter Zijlstra
2010-06-11  8:34               ` Jens Axboe

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=20100526235107.77e66ce0.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dpshah@google.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=piotr@hosowicz.com \
    /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.