Re: RT and XFS

From: Daniel Walker (dwalker_at_mvista.com)
Date: 07/13/05

  • Next message: Andrew Morton: "Re: 2.6.13-rc2-mm2"
    To: Nathan Scott <nathans@sgi.com>
    Date:	Tue, 12 Jul 2005 17:41:43 -0700
    
    

    On Wed, 2005-07-13 at 10:25 +1000, Nathan Scott wrote:
    > On Tue, Jul 12, 2005 at 04:01:32PM -0700, Daniel Walker wrote:
    > >
    > > Is there something so odd about the XFS locking, that it can't use the
    > > rt_lock ?
    >
    > Not that I know of - XFS does use the downgrade_write interface,
    > whose use isn't overly common in the rest of the kernel... maybe
    > that has caused some confusion, dunno.

    Current RT doesn't implement downgrade_write() , but it's trivial to add
    it.

    > > --- linux.orig/fs/xfs/linux-2.6/mrlock.h
    > > +++ linux/fs/xfs/linux-2.6/mrlock.h
    > > @@ -37,12 +37,12 @@
    > > enum { MR_NONE, MR_ACCESS, MR_UPDATE };
    > >
    > > typedef struct {
    > > - struct rw_semaphore mr_lock;
    > > - int mr_writer;
    > > + struct compat_rw_semaphore mr_lock;
    > > + int mr_writer;
    > > } mrlock_t;
    >
    > The XFS code is also written such that it just releases a mrlock
    > without tracking whether it had it for access/update in the end
    > (end lock state is not necessarily how it started out, since it
    > may have downgraded the lock at some point, or it may not have).
    > Its a non-trivial change to track that state within XFS itself,
    > so the above mr_writer field in XFS's mrlock wrapper tracks that
    > state alongside the rw_semaphore. It would prefer to be getting
    > that out of the rw_semaphore itself, alot, but there's not any
    > mechanism for doing so (its not a particularly nice API change
    > either, really, for the generic locking code). I guess that may
    > have been another reason for the above change in the RT patch, I
    > don't know all the details there.

    So it calls up_read if it has a read lock ? Or up_write if it has a
    write lock? I suppose it would be broken if it didn't though.

    Daniel

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Andrew Morton: "Re: 2.6.13-rc2-mm2"

    Relevant Pages

    • Re: RT and XFS
      ... > Is there something so odd about the XFS locking, ... Not that I know of - XFS does use the downgrade_write interface, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [2.6.26-rc7] shrink_icache from pagefault locking (nee: nfsd hangs for a few sec)...
      ... Is NFS involved or is this XFS only? ... this sort of thing can easily be exposed with the latencytop tool... ... I reproduced this without NFS mounted, ... AutopanoPro/5480 is trying to acquire lock: ...
      (Linux-Kernel)
    • Re: BUG: held lock freed!
      ... Perhaps this is a curse that falls on those who desert XFS;) ... xauth/6510 is trying to acquire lock: ... So I formated the data partition as ext3, ...
      (Linux-Kernel)
    • Re: How to send a break? - dump from frozen 64bit linux
      ... Added all those listed in the MAINTAINERS file for XFS. ... Seems that the kswapd0 has the lock in questing and has put itself to ... And decyphering all the macro crap it seems that the function that wakes ...
      (Linux-Kernel)
    • Re: xfs [_fsr] probs in 2.6.24.0
      ... xfs file systems had "gone off line" due to some unknown error (upon reboot, ... I'd suggest putting lots of I/O load on your disk subsystem ... xfs_fsr/2119 is trying to acquire lock: ... We're holding the xfs inode iolock at this point to protect ...
      (Linux-Kernel)