2008/11/13 Ingo Molnar <mingo@elte.hu>:Ok, I understand better. But consider the following: u64 global_time() { u64 now, delta, now_global; prev_global = prev_global_time; while (atomic64_cmpxchg(&prev_global_time, prev_global, now_global) != prev_global) { now = sched_clock(); delta = now - per_cpu(prev_local_time, this_cpu); per_cpu(prev_local_time, this_cpu) = now; now_global = prev_global + delta; prev_global = now_global; } return now_global; } Sarting with prev_global_time = 0 If we have two cpu and the above function is executed 5 times on the first cpu. We couldl have per_cpu(prev_local_time) = 50 for example. And so prev_global_time will be equal to 50. Just after that, almost at the same time, cpu2 calls global_time() delta will be equal to 50 (sched_clock() - per_cpu(prev_local_time) which is 0) and prev_global_time will be 50 + 50 = 100. This is not consistent. I don't know where but I'm pretty sure I missed something.... --
| Greg Kroah-Hartman | [PATCH 012/196] nozomi driver |
| Ingo Molnar | Re: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3 |
| Rafael J. Wysocki | [PATCH -mm 5/6] Freezer: Remove PF_NOFREEZE from bluetooth threads |
| Ingo Molnar | Re: [PATCH 00/23] per device dirty throttling -v8 |
git: | |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Natalie Protasevich | [BUG] New Kernel Bugs |
