Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1742858
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively |
| Date | 2017-10-01 20:50 +0200 |
| Message-ID | <uvRtn-5BE-1@gated-at.bofh.it> (permalink) |
| References | (6 earlier) <uuSKR-8ao-1@gated-at.bofh.it> <uuU9Y-NR-15@gated-at.bofh.it> <uvBoB-3Mo-1@gated-at.bofh.it> <uvLei-1Zz-17@gated-at.bofh.it> <uvLei-1Zz-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sun, Oct 1, 2017 at 5:08 AM, Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
>
> Right, re-introducing the iint->mutex and a new i_generation field in
> the iint struct with a separate set of locks should work. It will be
> reset if the file metadata changes (eg. setxattr, chown, chmod).
Note that the "inner lock" could possibly be omitted if the
invalidation can be just a single atomic instruction.
So particularly if invalidation could be just an atomic_inc() on the
generation count, there might not need to be any inner lock at all.
You'd have to serialize the actual measurement with the "read
generation count", but that should be as simple as just doing a
smp_rmb() between the "read generation count" and "do measurement on
file contents".
Of course, if you do something more complex in invalidation, you may
end up needing a real lock.
Linus
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH 0/3] define new read_iter file operation rwf flag Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-28 14:50 +0200
[RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-28 14:50 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Dave Chinner <david@fromorbit.com> - 2017-09-29 00:10 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-29 01:40 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-29 02:20 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-29 02:40 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-29 04:00 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-29 05:30 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively ebiederm@xmission.com (Eric W. Biederman) - 2017-10-01 03:40 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-01 14:10 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-10-01 20:50 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Dave Chinner <david@fromorbit.com> - 2017-10-02 00:40 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-10-02 01:20 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Dave Chinner <david@fromorbit.com> - 2017-10-02 06:00 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-02 01:50 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively ebiederm@xmission.com (Eric W. Biederman) - 2017-10-02 05:30 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-02 14:30 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Dave Chinner <david@fromorbit.com> - 2017-10-02 06:40 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-02 14:20 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Jeff Layton <jlayton@redhat.com> - 2017-10-02 14:50 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively ebiederm@xmission.com (Eric W. Biederman) - 2017-10-02 00:10 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Linus Torvalds <torvalds@linux-foundation.org> - 2017-10-02 00:30 +0200
Re: [RFC PATCH 3/3] fs: detect that the i_rwsem has already been taken exclusively Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-10-02 02:00 +0200
[RFC PATCH 1/3] fs: define new read_iter rwf flag Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-28 14:50 +0200
Re: [RFC PATCH 1/3] fs: define new read_iter rwf flag Matthew Wilcox <willy@infradead.org> - 2017-09-28 16:00 +0200
Re: [RFC PATCH 1/3] fs: define new read_iter rwf flag Mimi Zohar <zohar@linux.vnet.ibm.com> - 2017-09-28 16:40 +0200
Re: [RFC PATCH 1/3] fs: define new read_iter rwf flag Linus Torvalds <torvalds@linux-foundation.org> - 2017-09-28 18:00 +0200
csiph-web