This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mach".

The branch, master has been updated
       via  1269629d90b28a23ef9742645cfaf657ea3165bb (commit)
       via  c33f27196d9cb072d48bf5389bb64ad99a0d735a (commit)
      from  8d456cd9e417e9787481df15736b5f1c55cbc870 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1269629d90b28a23ef9742645cfaf657ea3165bb
Author: Samuel Thibault <[email protected]>
Date:   Sun Sep 21 18:58:16 2025 +0200

    clock: Note that the hpc support is not smp safe yet

commit c33f27196d9cb072d48bf5389bb64ad99a0d735a
Author: Damien Zammit <[email protected]>
Date:   Sun Sep 21 09:14:04 2025 +0000

    mach_clock: Fix monotonic clock sometimes going backwards
    
    Between reading mtime and reading hpclock_read_counter,
    there may be an interrupt that updates mtime, therefore
    we need a check to perform the clock read process again
    in this case.
    
    TESTED: on UP using:
    
    ```
    \#include <stdio.h>
    \#include <time.h>
    
    int main()
    {
      struct timespec ts, now;
      int i;
      int cnt = 0;
    
      clock_gettime(CLOCK_MONOTONIC, &ts);
    
      for (i = 0; i < 10000000; i++) {
        clock_gettime(CLOCK_MONOTONIC, &now);
        if ((now.tv_nsec < ts.tv_nsec) && (now.tv_sec <= ts.tv_sec)) {
          printf("BACKWARDS\n");
          cnt++;
          printf("  %u %09lu\n  %u %09lu\n\n",
            ts.tv_sec, ts.tv_nsec,
            now.tv_sec, now.tv_nsec
          );
        }
        ts = now;
      }
      printf("went backwards %d out of %d times\n", cnt, i);
      return 0;
    }
    ```
    
    Before the change, some backward transitions were detected.
    After this change, none were detected.
    Message-ID: <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 kern/mach_clock.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU Mach

Reply via email to