diff options
author | Eric W. Biederman <[email protected]> | 2020-11-20 17:14:32 -0600 |
---|---|---|
committer | Eric W. Biederman <[email protected]> | 2020-12-10 12:42:58 -0600 |
commit | 5b17b61870e2f4b0a4fdc5c6039fbdb4ffb796df (patch) | |
tree | 100057dc856347fe9536e0fd94c83838c5e29c39 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | e9a53aeb5e0a838f10fcea74235664e7ad5e6e1a (diff) |
proc/fd: In proc_readfd_common use task_lookup_next_fd_rcu
When discussing[1] exec and posix file locks it was realized that none
of the callers of get_files_struct fundamentally needed to call
get_files_struct, and that by switching them to helper functions
instead it will both simplify their code and remove unnecessary
increments of files_struct.count. Those unnecessary increments can
result in exec unnecessarily unsharing files_struct which breaking
posix locks, and it can result in fget_light having to fallback to
fget reducing system performance.
Using task_lookup_next_fd_rcu simplifies proc_readfd_common, by moving
the checking for the maximum file descritor into the generic code, and
by remvoing the need for capturing and releasing a reference on
files_struct.
As task_lookup_fd_rcu may update the fd ctx->pos has been changed
to be the fd +2 after task_lookup_fd_rcu returns.
[1] https://lkml.kernel.org/r/[email protected]
Suggested-by: Oleg Nesterov <[email protected]>
Tested-by: Andy Lavr <[email protected]>
v1: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Eric W. Biederman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions