Commit a439a1a3 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: 331535903
Signed-off-by: default avatarLokesh Gidra <lokeshgidra@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:4a4450b4a7205367d1e8ed43a8792cbaf2cfb1e9)
Merged-In: I2d196fd317e054af03dbd35ac1b0c7634cb370dc
Change-Id: I2d196fd317e054af03dbd35ac1b0c7634cb370dc
parent 0b0ea758
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment