Re: [PATCH] keys: Discard key spinlock and use RCU for key payload

From: Linus Torvalds (torvalds_at_osdl.org)
Date: 03/09/05

  • Next message: Jay Lan: "Re: I/O and Memory accounting..."
    Date:	Wed, 9 Mar 2005 10:24:04 -0800 (PST)
    To: David Howells <dhowells@redhat.com>
    
    

    On Wed, 9 Mar 2005, David Howells wrote:
    >
    > The attached patch changes the key implementation in a number of ways:
    >
    > (1) It removes the spinlock from the key structure.
    >
    > (2) The key flags are now accessed using atomic bitops instead of
    > write-locking the key spinlock and using C bitwise operators.

    I'd suggest against using __set_bit() for the initialization. Either use
    the proper set_bit() (which is slow, but at least consistent), or just
    initialize it with (1ul << KEY_FLAG_IN_QUOTA). __set_bit is generally
    slower than setting a value (it's pretty guaranteed not to be faster, and
    at least on x86 is clearly slower), so using it as an "optimization" is
    misguided.

    RCU seems to fit the key model pretty well, but I still wonder whether the
    conceptual complexity is worth it. Was this done on a whim, or was there
    some real reason for it? I'd love for that to be documented while you're
    at it..

                            Linus
    -
    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: Jay Lan: "Re: I/O and Memory accounting..."

    Relevant Pages

    • Re: 2.6.4-rc1-mm1: queue-congestion-dm-implementation patch
      ... it must wait on an internal semaphore ... > problem is that the higher-level caller is holding a spinlock at the same ... reproduce it I can try a few things.. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH]: Clean up of __alloc_pages
      ... Not to mention that a spinlock is an atomic op (though that is getting ... cheaper these days) + 2 memory barriers. ... Send instant messages to your online friends http://au.messenger.yahoo.com ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: serial driver / tty issues
      ... we should drop the spinlock and re-acquire it afterwards. ... and eventually cancel the work queue. ... > won't call the ldisc functions after we've closed them down. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Help tracking down problem --- endless loop in __find_get_block_slow
      ... That it's not stuck on a ... to reproduce using subfs on kernels ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 1/2] pci: Block config access during BIST (resend)
      ... > the lock and thus force exclusive access to the cacheline. ... I reverted the patch to use a spinlock and added a comment. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)