Re: [RFC PATCH v1 30/30] fs: convert i_version counter over to an atomic64_t

2017-03-03 Thread NeilBrown
On Wed, Dec 21 2016, Jeff Layton wrote: > > +/* > + * We borrow the top bit in the i_version to use as a flag to tell us whether > + * it has been queried since we last bumped it. If it has, then we must bump > + * it and set the flag. Note that this means that we have to handle wrapping > + * m

Re: [RFC PATCH v1 30/30] fs: convert i_version counter over to an atomic64_t

2016-12-22 Thread Jeff Layton
On Thu, 2016-12-22 at 10:38 +0200, Amir Goldstein wrote: > On Wed, Dec 21, 2016 at 7:03 PM, Jeff Layton wrote: > > > > The spinlock is only used to serialize callers that want to increment > > the counter. We can achieve the same thing with an atomic64_t and > > get the i_lock out of this codepat

Re: [RFC PATCH v1 30/30] fs: convert i_version counter over to an atomic64_t

2016-12-22 Thread Amir Goldstein
On Wed, Dec 21, 2016 at 7:03 PM, Jeff Layton wrote: > The spinlock is only used to serialize callers that want to increment > the counter. We can achieve the same thing with an atomic64_t and > get the i_lock out of this codepath. > Cool work! See some nits and suggestions below. > +/* > + * We

[RFC PATCH v1 30/30] fs: convert i_version counter over to an atomic64_t

2016-12-21 Thread Jeff Layton
The spinlock is only used to serialize callers that want to increment the counter. We can achieve the same thing with an atomic64_t and get the i_lock out of this codepath. Drop the I_VERS_BUMP flag, and instead, borrow the most significant bit in the counter to use as the flag. With this change,