aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf
diff options
context:
space:
mode:
authorDavid Herrmann <[email protected]>2014-08-08 14:25:36 -0700
committerLinus Torvalds <[email protected]>2014-08-08 15:57:31 -0700
commit05f65b5c70909ef686f865f0a85406d74d75f70f (patch)
tree4d412f64bb993713d8896fc334db87f1d026d86c /tools/perf/scripts/python/Perf-Trace-Util/lib/Perf
parent87b2d44026e0e315a7401551e95b189ac4b28217 (diff)
shm: wait for pins to be released when sealing
If we set SEAL_WRITE on a file, we must make sure there cannot be any ongoing write-operations on the file. For write() calls, we simply lock the inode mutex, for mmap() we simply verify there're no writable mappings. However, there might be pages pinned by AIO, Direct-IO and similar operations via GUP. We must make sure those do not write to the memfd file after we set SEAL_WRITE. As there is no way to notify GUP users to drop pages or to wait for them to be done, we implement the wait ourself: When setting SEAL_WRITE, we check all pages for their ref-count. If it's bigger than 1, we know there's some user of the page. We then mark the page and wait for up to 150ms for those ref-counts to be dropped. If the ref-counts are not dropped in time, we refuse the seal operation. Signed-off-by: David Herrmann <[email protected]> Acked-by: Hugh Dickins <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Ryan Lortie <[email protected]> Cc: Lennart Poettering <[email protected]> Cc: Daniel Mack <[email protected]> Cc: Andy Lutomirski <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib/Perf')
0 files changed, 0 insertions, 0 deletions