Commit 3c895b48 authored by Lokesh Gidra's avatar Lokesh Gidra Committed by Jhih-Chen Huang
Browse files

ANDROID: userfaultfd: add MMAP_TRYLOCK mode for COPY/ZEROPAGE



In case mmap_lock is contended, it is possible that userspace can spend
time performing other tasks rather than waiting in uninterruptible-sleep
state for the lock to become available. Even if no other task is
available, it is better to yield or sleep rather than adding contention
to already contended lock.

We introduce MMAP_TRYLOCK mode so that when possible, userspace can
request to use mmap_read_trylock(), returning -EAGAIN if and when it
fails.

Bug: 320478828
Bug: 331530152
Signed-off-by: default avatarLokesh Gidra <lokeshgidra@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:3673533a09b6998bd0e3eafd14c1d6457bc23529)
Merged-In: I2d196fd317e054af03dbd35ac1b0c7634cb370dc
Change-Id: I2d196fd317e054af03dbd35ac1b0c7634cb370dc
parent 19706cdc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment