Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1577395
| From | Al Viro <viro@ZenIV.linux.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] proc/sysctl: drop unregistered stale dentries as soon as possible |
| Date | 2017-02-09 10:10 +0100 |
| Message-ID | <t8STM-4gx-23@gated-at.bofh.it> (permalink) |
| References | <t8y8G-7Ir-17@gated-at.bofh.it> <t8IhH-5DS-1@gated-at.bofh.it> <t8O3M-Pu-7@gated-at.bofh.it> <t8RuG-3aL-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Feb 09, 2017 at 10:36:15AM +0300, Konstantin Khlebnikov wrote: > Ok, Thank you. I've expected that this fix isn't sane, > > Maybe we could minimize changes for now. For example: keep these > stale dentries in memory but silently unhash them in ->d_compare(). > Memory processure and reclaimer will kill them later. ->d_compare() is called by the code walking the hash chains. What's worse, in the most common case all we have is rcu_read_lock(). Modifying the chain in rcu reader is no-go. Turning __d_lookup_rcu() into a writer on the off-chance that we'll walk onto a visibly stale sysctl dentry - even more so. If you want to deal with that, do it right, please. Have sysctl inodes on a list of some kind anchored in struct ctl_table_header; insert them there in proc_sys_make_inode(), remove - in proc_evict_inode() (or have it pass the inode to sysctl_head_put() and do the removal there). Use sysctl_lock for serialization. In start_unregistering(), just before the erase_header() call, check if the list is non-empty and if it is - grab sysctl_lock last = NULL walk the list igrab(inode we are looking at) if succeeded drop sysctl_lock iput(last) last = that inode d_prune_aliases(last) retake sysctl_lock // inode is still not evicted, so it's still on the list drop sysctl_lock iput(last) list would pass through struct proc_inode, and I would probably use hlist rather than the normal one; might be more convenient to initialize that way. Getting from containing struct proc_inode to inode - &ei->vfs_inode. It's not that much work; if you have time - go for it, or remind me after -rc1...
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] proc/sysctl: drop unregistered stale dentries as soon as possible Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2017-02-08 12:00 +0100
Re: [PATCH] proc/sysctl: drop unregistered stale dentries as soon as possible Andrew Morton <akpm@linux-foundation.org> - 2017-02-08 22:50 +0100
Re: [PATCH] proc/sysctl: drop unregistered stale dentries as soon as possible Al Viro <viro@ZenIV.linux.org.uk> - 2017-02-09 05:00 +0100
Re: [PATCH] proc/sysctl: drop unregistered stale dentries as soon as possible Konstantin Khlebnikov <koct9i@gmail.com> - 2017-02-09 08:40 +0100
Re: [PATCH] proc/sysctl: drop unregistered stale dentries as soon as possible Al Viro <viro@ZenIV.linux.org.uk> - 2017-02-09 10:10 +0100
[PATCH] proc/sysctl: prune stale dentries during unregistering Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2017-02-10 08:40 +0100
Re: [PATCH] proc/sysctl: prune stale dentries during unregistering Al Viro <viro@ZenIV.linux.org.uk> - 2017-02-10 08:50 +0100
Re: [PATCH] proc/sysctl: prune stale dentries during unregistering Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2017-02-10 09:00 +0100
Re: [PATCH] proc/sysctl: prune stale dentries during unregistering ebiederm@xmission.com (Eric W. Biederman) - 2017-02-13 11:00 +0100
csiph-web