[M3devel] gettimeofday called from CheckLoadTracedRef?

Tony Hosking hosking at cs.purdue.edu
Mon Nov 30 22:10:41 CET 2009


Huh?  I just received this e-mail sent on 24 May!


On 24 May 2009, at 18:02, Jay wrote:

> 
> Can you try like this? I haven't even compiled it.
> 
> 
> --- RTCollector.m3 2009-05-24 14:56:43.510632700 -0700
> +++ RTCollector.m3.mine1 2009-05-24 15:00:25.323132700 -0700
> @@ -687,12 +687,11 @@
>     IF impureCopy.page # NIL THEN
> 
>     END;
> -  END CollectorOn;
> +  END CollectorOnWithoutTimeKeeping;
> 
> PROCEDURE CollectorOn (VAR timeOnEntry: Time.T) =
>   (* LL>= RTOS.LockHeap *)
>   BEGIN
> -    
>     CollectorOnWithoutTimeKeeping();
>     timeOnEntry := Time.Now();
>   END CollectorOn;
> @@ -713,16 +712,14 @@
>       signalWeak := FALSE;
>       RTOS.BroadcastHeap();
>     END;
> -  END CollectorOff;
> +  END CollectorOffWithoutTimeKeeping;
> 
> PROCEDURE CollectorOff (VAR timeOnEntry: Time.T; allocator := FALSE) =
>   (* LL>= RTOS.LockHeap *)
>   VAR timeOnExit := Time.Now();
>   BEGIN
> 
> -
>     CollectorOffWithoutTimeKeeping();
> -
>     cycleCost := cycleCost + (timeOnExit - timeOnEntry);
>     IF allocator AND tsIndex>= 0 THEN
>       tStamps[tsIndex] := timeOnEntry; INC(tsIndex);
> @@ -2259,7 +2256,6 @@
>      to heap state. *)
>   VAR
>     p := Word.RightShift (LOOPHOLE(ref, Word.T), LogBytesPerPage);
> -    t0: Time.T;
>     thread := ThreadF.MyHeapState();
>   BEGIN
>     INC(checkLoadTracedRef);   (* race, so only approximate *)
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ----------------------------------------
>> From: jay.krell at cornell.edu
>> To: mika at async.caltech.edu
>> CC: m3devel at elegosoft.com
>> Subject: RE: [M3devel] gettimeofday called from CheckLoadTracedRef?
>> Date: Sun, 24 May 2009 18:20:50 +0000
>> 
>> 
>> I can send you a diff to try later but I won't likely have confidence in it. Tony will have to judge.
>> 
>> 
>> - Jay
>> 
>> 
>> ----------------------------------------
>>> To: jay.krell at cornell.edu
>>> Date: Sun, 24 May 2009 11:15:51 -0700
>>> From: mika at async.caltech.edu
>>> CC: m3devel at elegosoft.com
>>> Subject: Re: [M3devel] gettimeofday called from CheckLoadTracedRef?
>>> 
>>> It makes a syscall. A slow one!
>>> 
>>> Mika
>>> 
>>> Jay writes:
>>>> 
>>>> It does appear to be making policy decisions based on elapsed time, not just collecting times to report.
>>>> 
>>>> Does gettimeofday on your system make a syscall or read a global?
>>>> 
>>>> - Jay
>>>> 
>>>> Maybe since the intent is just to process one object/page, the CollectorOn/Off calls can be replaced by just
>>>> collectorOn := TRUE or FALSE
>>>> 
>>>> ? For CollectorOff that isn't clear since it does more, but CollectorOn is just that plus time recording plus an assertion. Still, given that the intent is some limited processing, I think the time collection could be avoided and might not even be a good thing?
>>>> 
>>>> 
>>>> - Jay
>>>> 
>>>> 
>>>> ----------------------------------------
>>>>> To: m3devel at elegosoft.com
>>>>> Date: Sat, 23 May 2009 13:34:16 -0700
>>>>> From: mika at async.caltech.edu
>>>>> CC: mika at camembert.async.caltech.edu
>>>>> Subject: [M3devel] gettimeofday called from CheckLoadTracedRef?
>>>>> 
>>>>> 
>>>>> Hi Modula-3ers, especially Tony,
>>>>> 
>>>>> I'm seeing the following behavior a lot in a program I'm running:
>>>>> 
>>>>> #0 0x68ecbba7 in gettimeofday () from /lib/libc.so.5
>>>>> #1 0x68611cb9 in Now () at ../src/time/POSIX/TimePosix.m3:16
>>>>> #2 0x685ecf06 in CollectorOn (timeOnEntry=Invalid C/C++ type code 30 in symbol table.
>>>>> ) at ../src/runtime/common/RTCollector.m3:674
>>>>> #3 0x685f2476 in CheckLoadTracedRef (ref=Invalid C/C++ type code 46 in symbol table.
>>>>> ) at ../src/runtime/common/RTCollector.m3:2271
>>>>> #4 0x68139379 in Get (tbl=Invalid C/C++ type code 26 in symbol table

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091130/5b49b056/attachment-0001.html>


More information about the M3devel mailing list