fs: inode rcu freeing and hash walking V2

From: Dave Chinner
Date: Mon Nov 08 2010 - 02:30:55 EST


Hi Al,

The following four patches implement the extra functionality you
wanted on top of the inode lock breakup. They lift the i_lock up out
of writeback_single_inode(), implements RCU freeing of inodes via
SLAB_DESTROY_BY_RCU, converts inode hash lookup operations to use
RCU list walks. Comments are welcome.

I'm undecided whether passing the bucket identifier along with the
hash head is the best way to handle the hash-chain-being-jumped
detection. It might be cleaner to just push the hash chain
calculation all the way in.

Most of the changes in this version are as a result of Eric
Dumazet's initial review.

Version 2:
- split the inode slabcache config changes into a separate patch.
- convert inode hash lists to use hlist_nulls variant to enable
simple checking of whether RCU hash list traversals jumped chains.
- recheck i_ino and i_sb after gaining i_lock during RCU lookups to
ensure we've got a hold of the correct inode.
- clear i_ino when destroying an inode to allow hash lookups to
discover freed inodes without needing to lock the inode.
- moved inode->i_lock initialisation to slab constructor so that it
can be safely used during RCU traversals
- introduced hlist_nulls_add_fake() and converted filesystems to use
that
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/