public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <dgc@sgi.com>
To: Nathan Scott <nathans@sgi.com>
Cc: Daniel Walker <dwalker@mvista.com>, Ingo Molnar <mingo@elte.hu>,
	Steve Lord <lord@xfs.org>,
	linux-kernel@vger.kernel.org, linux-xfs@oss.sgi.com
Subject: Re: RT and XFS
Date: Thu, 14 Jul 2005 13:50:23 +1000	[thread overview]
Message-ID: <20050714135023.E241419@melbourne.sgi.com> (raw)
In-Reply-To: <20050714002246.GA937@frodo>; from nathans@sgi.com on Thu, Jul 14, 2005 at 10:22:46AM +1000

On Thu, Jul 14, 2005 at 10:22:46AM +1000, Nathan Scott wrote:
> Hi there,
> 
> On Wed, Jul 13, 2005 at 09:45:58AM -0700, Daniel Walker wrote:
> > On Wed, 2005-07-13 at 08:47 +0200, Ingo Molnar wrote:
> > > 
> > > downgrade_write() wasnt the main problem - the main problem was that for 
> > > PREEMPT_RT i implemented 'strict' semaphores, which are not identical to 
> > > vanilla kernel semaphores. The thing that seemed to impact XFS the most 
> > > is the 'acquirer thread has to release the lock' rule of strict 
> > > semaphores. Both the XFS logging code and the XFS IO completion code 
> > > seems to release locks in a different context from where the acquire 
> > > happened. It's of course valid upstream behavior, but without these 
> > > extra rules it's hard to do sane priority inheritance. (who do you boost 
> > > if you dont really know who 'owns' the lock?) It might make sense to 
> > > introduce some sort of sem_pass_to(new_owner) interface? For now i 
> > > introduced a compat type, which lets those semaphores fall back to the 
> > > vanilla implementation.
> 
> Hmm, I'm not aware of anywhere in XFS where we do that.  From talking
> to some colleagues here, they're claiming that we can't be doing that
> since it'd trip an assert in the IRIX mrlock code.

Now that I've read the thread, I see it's not mrlocks that is the
issue with unlocking in a different context - it's semaphores.

All the pagebuf synchronisation is done with a semaphore because
it's held across the I/O and it's _most definitely_ released in a
different context when doing async I/O. Just about all metadata I/O
is async because once the transaction has been logged to disk we
don't need to write these buffers out synchronously. Not to mention
the log I/O completion unlocks the buffers in a transaction in a
different context as well.

The whole point of using a semaphore in the pagebuf is because there
is no tracking of who "owns" the lock so we can actually release it
in a different context. Semaphores were invented for this purpose,
and we use them in the way they were intended. ;)

Realistically, I seriously doubt the need for any sort of rt changes
to these semaphores. They can be held for indeterminant periods of
time potentially across multiple disk I/Os (e.g. when held locked in
a transaction that requires more metadata to be read in from disk to
make progress).  Hence there is no really no point in making them RT
aware because if you end up waiting on one of them you can forget
about pretty much any RT guarantee that you've ever given....

Cheers,

Dave.
-- 
Dave Chinner
R&D Software Engineer
SGI Australian Software Group

  reply	other threads:[~2005-07-14  3:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-12 23:01 RT and XFS Daniel Walker
2005-07-12 23:39 ` William Weston
2005-07-13  0:25 ` Nathan Scott
2005-07-13  0:41   ` Daniel Walker
2005-07-13  0:37     ` Nathan Scott
2005-07-13  6:47   ` Ingo Molnar
2005-07-13 16:45     ` Daniel Walker
2005-07-14  0:22       ` Nathan Scott
2005-07-14  3:50         ` Dave Chinner [this message]
2005-07-14  4:10           ` Daniel Walker
     [not found]             ` <20050714052347.GA18813@elte.hu>
2005-07-14 15:56               ` Daniel Walker
2005-07-14 16:08                 ` Christoph Hellwig
2005-07-18 12:10                   ` Esben Nielsen
2005-07-19  3:26                     ` Bill Huey
2005-07-19 12:34                       ` Ingo Molnar
2005-07-19 13:27                         ` Christoph Hellwig
2005-07-19 13:50                           ` Ingo Molnar
2005-07-14 16:08                 ` Christoph Hellwig
2005-07-15 10:23             ` Ingo Molnar
2005-07-15 16:16               ` Daniel Walker
2005-07-18 11:33                 ` Esben Nielsen
2005-07-19  3:31                 ` Bill Huey

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=20050714135023.E241419@melbourne.sgi.com \
    --to=dgc@sgi.com \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@oss.sgi.com \
    --cc=lord@xfs.org \
    --cc=mingo@elte.hu \
    --cc=nathans@sgi.com \
    /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