From: Thomas Gleixner <tglx@linutronix.de>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@osdl.org>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Nick Piggin <npiggin@kernel.dk>
Subject: Re: [patch 0/5] seqlock consolidation
Date: Thu, 15 Mar 2012 13:28:03 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.02.1203151322020.2466@ionos> (raw)
In-Reply-To: <20120315122112.GB8943@ZenIV.linux.org.uk>
On Thu, 15 Mar 2012, Al Viro wrote:
> On Thu, Mar 15, 2012 at 11:44:22AM -0000, Thomas Gleixner wrote:
>
> > Aside of that replacing open coded constructs with proper functions is
> > a worthwhile cleanup by itself.
>
> Provided that those are proper primitives to start with... I don't like
> it - most of ->d_lock uses are _not_ related to ->d_seq, to start with
> and then we get an interesting mix of functions that do and do not assume
> the lock already taken, etc.
>
> Could you describe RT patch problems in more details? I really don't like
> this solution - interface is overcomplicated and doesn't fit well...
On RT the spinlock sections (except the raw_spinlock) ones are
becoming preemtible as we replace the spinlocks by "sleeping
spinlock", a PI aware rtmutex.
So now assume the following:
spin_lock(d->d_lock);
....
d->d_seq++;
-> Preemption
read_seqcount_begin()
repeat:
ret = ACCESS_ONCE(sl->sequence);
if (unlikely(ret & 1)) {
cpu_relax();
goto repeat;
}
smp_rmb();
Now when the preempting task has higher prioriy, the thing loops
forever. Fail ....
The only way out is to lock d->d_lock which is contended, so the
reader side boosts the writer and waits for the lock to be
released. Though with the open coded seqlock we have no idea which
lock we need to take.
Any better ideas ?
Thanks,
tglx
next prev parent reply other threads:[~2012-03-15 12:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-15 11:44 Thomas Gleixner
2012-03-15 11:44 ` [patch 1/5] seqlock: Remove unused functions Thomas Gleixner
2012-03-15 16:29 ` Linus Torvalds
2012-03-15 17:39 ` Al Viro
2012-03-15 17:53 ` Thomas Gleixner
2012-03-15 11:44 ` [patch 2/5] seqlock: Use seqcount for seqlock Thomas Gleixner
2012-03-15 11:44 ` [patch 3/5] seqlock: Provide seq_spin_* functions Thomas Gleixner
2012-03-15 11:44 ` [patch 4/5] fs: fs_struct use seqlock Thomas Gleixner
2012-03-15 11:44 ` [patch 5/5] fs: Use seqlock in struct dentry Thomas Gleixner
2012-03-15 12:21 ` [patch 0/5] seqlock consolidation Al Viro
2012-03-15 12:28 ` Thomas Gleixner [this message]
2012-03-15 17:43 ` Al Viro
2012-03-15 17:55 ` Thomas Gleixner
2012-03-15 18:39 ` Al Viro
2012-03-15 19:17 ` Thomas Gleixner
2012-03-15 20:42 ` Al Viro
2012-03-15 22:08 ` Thomas Gleixner
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=alpine.LFD.2.02.1203151322020.2466@ionos \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=npiggin@kernel.dk \
--cc=peterz@infradead.org \
--cc=torvalds@osdl.org \
--cc=viro@ZenIV.linux.org.uk \
/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
all inboxes | Powered by JetHome®