public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* gettimeofday with interrupts disabled
       [not found] <2107e7ae0605071820v5e1c0819n6d59746963fa0114@mail.gmail.com>
@ 2006-05-08  1:24 ` Aziz Eker
  2006-05-08  2:24   ` Roland McGrath
  0 siblings, 1 reply; 5+ messages in thread
From: Aziz Eker @ 2006-05-08  1:24 UTC (permalink / raw)
  To: systemtap

Hi,

I want to get some measurements about the time scheduler_tick()
function takes. To do that, I am finding time difference between the
start and end of the function using 'gettimeofday_us'. However, the
scheduler_tick() function is called with interrupts disabled. Does
'gettimeofday' continue to run even when interrupts are disabled? If
not, is there anyway to count the RTC in systemtap?

 Thanks,

Aziz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gettimeofday with interrupts disabled
  2006-05-08  1:24 ` gettimeofday with interrupts disabled Aziz Eker
@ 2006-05-08  2:24   ` Roland McGrath
  0 siblings, 0 replies; 5+ messages in thread
From: Roland McGrath @ 2006-05-08  2:24 UTC (permalink / raw)
  To: azizeker; +Cc: systemtap

There are other parts of the kernel that call do_gettimeofday with
interrupts disabled and locks held, for whatever that's worth.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: gettimeofday with interrupts disabled
@ 2006-05-08 22:29 Stone, Joshua I
  0 siblings, 0 replies; 5+ messages in thread
From: Stone, Joshua I @ 2006-05-08 22:29 UTC (permalink / raw)
  To: James Dickens; +Cc: azizeker, systemtap

On Monday, May 08, 2006 3:12 PM, James Dickens wrote:
> On 5/8/06, Stone, Joshua I <joshua.i.stone@intel.com> wrote:
>> On Sunday, May 07, 2006 6:24 PM, Aziz Eker wrote:
>>> I want to get some measurements about the time scheduler_tick()
>>> function takes. To do that, I am finding time difference between the
>>> start and end of the function using 'gettimeofday_us'. However, the
>>> scheduler_tick() function is called with interrupts disabled. Does
>>> 'gettimeofday' continue to run even when interrupts are disabled? If
>>> not, is there anyway to count the RTC in systemtap?
>> 
>> Calling gettimeofday is only a problem for probes in code sections
>> that hold a write lock on xtime_lock.  See bug #2525 for more
>> details: http://sources.redhat.com/bugzilla/show_bug.cgi?id=2525
>> 
> what if its an smp machine, and and someone else is calling
> gettimeofday?  seems like a race to me..

A race for what?  'do_gettimeofday' only takes a read lock on
xtime_lock, and multiple read locks are perfectly fine.

Even if the read locks were exclusive, it still would not be a deadlock.
One thread would be left waiting for the other to release, but since
your scenario is running on independent CPUs, the lock will eventually
be released.


Josh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gettimeofday with interrupts disabled
  2006-05-08 17:28 Stone, Joshua I
@ 2006-05-08 22:12 ` James Dickens
  0 siblings, 0 replies; 5+ messages in thread
From: James Dickens @ 2006-05-08 22:12 UTC (permalink / raw)
  To: Stone, Joshua I; +Cc: azizeker, systemtap

On 5/8/06, Stone, Joshua I <joshua.i.stone@intel.com> wrote:
> On Sunday, May 07, 2006 6:24 PM, Aziz Eker wrote:
> > I want to get some measurements about the time scheduler_tick()
> > function takes. To do that, I am finding time difference between the
> > start and end of the function using 'gettimeofday_us'. However, the
> > scheduler_tick() function is called with interrupts disabled. Does
> > 'gettimeofday' continue to run even when interrupts are disabled? If
> > not, is there anyway to count the RTC in systemtap?
>
> Calling gettimeofday is only a problem for probes in code sections that
> hold a write lock on xtime_lock.  See bug #2525 for more details:
> http://sources.redhat.com/bugzilla/show_bug.cgi?id=2525
>
what if its an smp machine, and and someone else is calling
gettimeofday?  seems like a race to me..

James Dickens
uadmin.blogspot.com

>
> Josh
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: gettimeofday with interrupts disabled
@ 2006-05-08 17:28 Stone, Joshua I
  2006-05-08 22:12 ` James Dickens
  0 siblings, 1 reply; 5+ messages in thread
From: Stone, Joshua I @ 2006-05-08 17:28 UTC (permalink / raw)
  To: azizeker; +Cc: systemtap

On Sunday, May 07, 2006 6:24 PM, Aziz Eker wrote:
> I want to get some measurements about the time scheduler_tick()
> function takes. To do that, I am finding time difference between the
> start and end of the function using 'gettimeofday_us'. However, the
> scheduler_tick() function is called with interrupts disabled. Does
> 'gettimeofday' continue to run even when interrupts are disabled? If
> not, is there anyway to count the RTC in systemtap?

Calling gettimeofday is only a problem for probes in code sections that
hold a write lock on xtime_lock.  See bug #2525 for more details:
http://sources.redhat.com/bugzilla/show_bug.cgi?id=2525


Josh

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-05-08 22:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <2107e7ae0605071820v5e1c0819n6d59746963fa0114@mail.gmail.com>
2006-05-08  1:24 ` gettimeofday with interrupts disabled Aziz Eker
2006-05-08  2:24   ` Roland McGrath
2006-05-08 17:28 Stone, Joshua I
2006-05-08 22:12 ` James Dickens
2006-05-08 22:29 Stone, Joshua I

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).