public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Suleiman Souhlal <ssouhlal@freebsd.org>
Cc: Linux Kernel ML <linux-kernel@vger.kernel.org>,
	vojtech@suse.cz, Jiri Bohac <jbohac@suse.cz>
Subject: Re: [PATCH 1/2] Make the TSC safe to be used by gettimeofday().
Date: Tue, 14 Nov 2006 12:12:40 +0100	[thread overview]
Message-ID: <200611141212.40978.ak@suse.de> (raw)
In-Reply-To: <45593DD8.80301@FreeBSD.org>


> I initially had it after the HLT in the idle loop, but realized there 
> would be a small race: We could get switched away from the idle thread 
> after the HLT but before doing the resynch.

idle threads are pinned to CPUs of course.

> It seems like idle notifiers would do the trick, except that they don't 
> appear to include the id of the CPU that went/exited from idle.

Just use smp_processor_id() 
 
> Does the LSL from the magic GDT entry return the APIC ID or the 
> smp_processor_id?

smp_processor_id

> Another way I could fix this would be to just touch the seqlock, in 
> switch_to(), if we happen to be in vgettimeofday. Would this be acceptable?

Hmm, i'm not sure that would cover all cases with multiple cpu switches.
You would need to do it for all CPUs, which might get tricky.
I would also prefer to not do anything complicated in switch_to

-Andi

  reply	other threads:[~2006-11-14 11:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14  1:06 [PATCH 0/2] Make the TSC safe to be used by gettimeofday() Suleiman Souhlal
2006-11-14  1:08 ` [PATCH 1/2] " Suleiman Souhlal
2006-11-14  2:05   ` Andi Kleen
2006-11-14  2:25     ` Suleiman Souhlal
2006-11-14  2:44       ` Andi Kleen
2006-11-14  3:35         ` dean gaudet
2006-11-14  4:22           ` dean gaudet
2006-11-14  3:54         ` Suleiman Souhlal
2006-11-14 11:12           ` Andi Kleen [this message]
2006-11-14  1:09 ` [PATCH 2/2] Introduce a vmonotonic_clock() vsyscall Suleiman Souhlal
2006-11-14  1:50 ` [PATCH 0/2] Make the TSC safe to be used by gettimeofday() Andi Kleen
2006-11-14  2:06   ` Suleiman Souhlal
2006-11-14 11:10     ` [PATCH 0/2] Make the TSC safe to be used by gettimeofday() II Andi Kleen
2006-11-14 12:30     ` [PATCH 0/2] Make the TSC safe to be used by gettimeofday() Shem Multinymous
2006-11-14 17:06       ` Suleiman Souhlal
2006-11-14 18:30         ` Andi Kleen
2006-11-14 21:28     ` Christoph Lameter
2006-11-14  7:42   ` Arjan van de Ven

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=200611141212.40978.ak@suse.de \
    --to=ak@suse.de \
    --cc=jbohac@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ssouhlal@freebsd.org \
    --cc=vojtech@suse.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox