RFC File descriptor hot-unplug support
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest9 patches 21 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | mm: Introduce remap_file_mappings.include/ mm/ | +88 | 0 replies | |
| 2/9 | mm: Implement generic support for revoking a mapping.include/ mm/ | +11 | 0 replies | |
| 3/9 | sysfs: Use remap_file_mappings.fs/ | +2 | 0 replies | |
| 4/9 | vfs: Generalize the file_listdrivers/ drivers/ fs/ +4 more | +55 | 0 replies | |
| 5/9 | vfs: Introduce basic infrastructure for revoking a fileDocumentation/ fs/ fs/ +1 more | +181 | 2 replies | |
| 6/9 | vfs: Utilize fops_read_lock where appropriatefs/ fs/ fs/ +5 more | +276 | 0 replies | |
| 7/9 | vfs: Optimize fops_read_lockfs/ | +14 | 0 replies | |
| 8/9 | vfs: Implement generic revoked file operationsfs/ fs/ include/ | +184 | 7 replies | |
| 9/9 | proc: Use the generic vfs revoke facility that now exists.fs/ fs/ fs/ +2 more | +36 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC][PATCH 0/9] File descriptor hot-unplug support
A couple of weeks ago I found myself looking at the uio, seeing that it does not support pci hot-unplug, and thinking "Great yet another implementation of hotunplug logic that needs to be added".
I decided to see what it would take to add a generic implementation of the code we have for supporting hot unplugging devices in sysfs, proc, sysctl, tty_io, and now almost in the tun driver.
Not long after I touched the tun driver and made it safe to delete the network device while still holding it's file descriptor open I someone else touch the code adding a different feature and my careful work went up in flames. Which brought home another point at the best of it this is ultimately complex tricky code that subsystems should not need to worry about.
What makes this even more interesting is that in the presence of pci hot-unplug it looks like most subsystems and most devices will have to deal with the issue one way or another.
This infrastructure could also be used to implement sys_revoke and when I could not think of a better name I have drawn on that.
The following changes draw on and generalize the work in tty_io sysfs, proc, and sysctl and move it into the vfs level. Where the basic primitives are running faster, and the solution more general.
The work is not complete. I have only fully converted proc. And there are more places in the vfs that need to be touched. But it is close enough the code works in practice and all of the core challenges should have been solved, and the design should be clear.
Documentation/filesystems/vfs.txt | 4 + drivers/char/pty.c | 2 +- drivers/char/tty_io.c | 2 +- fs/Makefile | 2 +- fs/compat.c | 31 +++- fs/fcntl.c | 32 +++-- fs/file_table.c | 189 ++++++++++++++++++--- fs/inode.c | 1 + fs/ioctl.c | 39 +++-- fs/locks.c | 81 +++++++-- fs/open.c | 32 +++- fs/proc/generic.c | 100 ++++-------- fs/proc/inode.c | 339 +------------------------------------ fs/proc/internal.h | 2 + fs/proc/root.c | 2 +- fs/read_write.c | 143 ++++++++++++---- fs/readdir.c | 14 ++- fs/revoked_file.c | 181 ++++++++++++++++++++ fs/select.c | 17 ++- fs/super.c | 49 +++--- fs/sysfs/bin.c | 193 +--------------------- include/linux/fs.h | 31 +++- include/linux/mm.h | 3 + include/linux/proc_fs.h | 4 - mm/memory.c | 96 +++++++++++ 25 files changed, 841 insertions(+), 748 deletions(-)
Eric