public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gregory Haskins <ghaskins@novell.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Gregory Haskins <gregory.haskins@gmail.com>,
	mingo@elte.hu, rostedt@goodmis.org, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org
Subject: Re: [PATCH] seqlock: serialize against writers
Date: Fri, 29 Aug 2008 12:41:33 -0400	[thread overview]
Message-ID: <48B826BD.9000308@novell.com> (raw)
In-Reply-To: <20080829163749.GX26610@one.firstfloor.org>

[-- Attachment #1: Type: text/plain, Size: 1842 bytes --]

Andi Kleen wrote:
> On Fri, Aug 29, 2008 at 12:29:42PM -0400, Gregory Haskins wrote:
>   
>> Andi Kleen wrote:
>>     
>>>> Im running it on a x86_64 box as we speak.  How can I tell if there is a
>>>> certain mode that is permitting this?
>>>>     
>>>>         
>>> If the boot up says you're running with PMtimer then it uses the fallback
>>> (usually happens on pre Fam10h AMD boxes). A typical Intel box
>>> would use the faster ring 3 only TSC path and then explode with your
>>> change I bet. 
>>>   
>>>       
>> Thinking about this some more, perhaps the issue is I am not hitting the
>> contended path in vsyscall?
>>     
>
> Yes it will be only contended when gettimeofday() races with the timer 
> interrupt.  You could try to run gettimeofday() in a loop and see how
> long it holds up.
>
> But anyways from the theory you should crash when it happens. 
> Writes to kernel data are not allowed in vsyscalls and your read_lock clearly 
> does a write.
>   

Oh I don't deny that it does.  The compiler neatly reminded me that it
could no longer be "const".  I just was ignorant of the userspace
requirement ;)

But we *do* have a serious problem here.  A non-preemptible seqlock_t
will do bad things if it preempts the writer, so we need some kind of
solution here, one way or the other.  So suggestions welcome :)  I
realize this is only an issue currently in PREEMPT_RT so perhaps most
will not care... but I do need to solve this at least for this branch.

I currently do not see a way to solve this problem that doesn't involve
some heavier involvement in the read path (read: const seqlock_t need
not apply).  Given that, we either need to address the const requirement
for userspace, alter userspace's usage, or find another way to address
the deadlock.  Any ideas?

-Greg



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2008-08-29 16:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-29 15:44 [PATCH] seqlock: serialize against writers Gregory Haskins
2008-08-29 16:09 ` Andi Kleen
2008-08-29 16:10   ` Gregory Haskins
2008-08-29 16:22     ` Andi Kleen
2008-08-29 16:26       ` Gregory Haskins
2008-08-29 16:34         ` Steven Rostedt
2008-08-29 16:35           ` Gregory Haskins
2008-08-29 16:45             ` Andi Kleen
2008-08-29 16:53               ` Steven Rostedt
2008-08-29 17:00                 ` Gregory Haskins
2008-08-29 17:00               ` Gregory Haskins
2008-08-29 16:58             ` Steven Rostedt
2008-08-29 16:29       ` Gregory Haskins
2008-08-29 16:37         ` Andi Kleen
2008-08-29 16:41           ` Gregory Haskins [this message]
2008-08-29 17:08             ` Andi Kleen
2008-08-29 16:57 ` Stephen Hemminger
2008-08-29 17:02   ` [ RT PATCH] " Steven Rostedt
2008-08-29 18:03 ` [RT PATCH v2] " Gregory Haskins
2008-08-29 18:12   ` Gregory Haskins
2008-08-30 11:17   ` Peter Zijlstra
2008-08-30 12:32     ` Gregory Haskins
2008-08-30 12:38       ` Peter Zijlstra
2008-08-30 13:05         ` Gregory Haskins
2008-08-30 11:08 ` [PATCH] " Peter Zijlstra
2008-09-02 12:45 ` [RT PATCH v3] " Gregory Haskins
2008-09-02 13:01   ` Gregory Haskins
2008-09-02 13:29 ` [RT PATCH v4] " Gregory Haskins

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=48B826BD.9000308@novell.com \
    --to=ghaskins@novell.com \
    --cc=andi@firstfloor.org \
    --cc=gregory.haskins@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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