lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Aug 2020 10:13:28 +0800
From:   Chinwen Chang <>
To:     Matthias Brugger <>,
        Michel Lespinasse <>,
        Andrew Morton <>,
        Vlastimil Babka <>,
        Daniel Jordan <>,
        Davidlohr Bueso <>,
        Chinwen Chang <>,
        Alexey Dobriyan <>,
        "Matthew Wilcox (Oracle)" <>,
        Jason Gunthorpe <>,
        Steven Price <>,
        Song Liu <>,
        Jimmy Assarsson <>,
        Huang Ying <>
CC:     <>,
        <>, <>
Subject: [PATCH v2 0/2] Try to release mmap_lock temporarily in smaps_rollup

Recently, we have observed some janky issues caused by unpleasantly long
contention on mmap_lock which is held by smaps_rollup when probing large
processes. To address the problem, we let smaps_rollup detect if anyone
wants to acquire mmap_lock for write attempts. If yes, just release the
lock temporarily to ease the contention.

smaps_rollup is a procfs interface which allows users to summarize the
process's memory usage without the overhead of seq_* calls. Android uses it
to sample the memory usage of various processes to balance its memory pool
sizes. If no one wants to take the lock for write requests, smaps_rollup
with this patch will behave like the original one.

Although there are on-going mmap_lock optimizations like range-based locks,
the lock applied to smaps_rollup would be the coarse one, which is hard to
avoid the occurrence of aforementioned issues. So the detection and
temporary release for write attempts on mmap_lock in smaps_rollup is still

Change since v1:
- If current VMA is freed after dropping the lock, it will return
- incomplete result. To fix this issue, refine the code flow as
- suggested by Steve. [1]


Chinwen Chang (2):
  mmap locking API: add mmap_lock_is_contended()
  mm: proc: smaps_rollup: do not stall write attempts on mmap_lock

 fs/proc/task_mmu.c        | 57 ++++++++++++++++++++++++++++++++++++++-
 include/linux/mmap_lock.h |  5 ++++
 2 files changed, 61 insertions(+), 1 deletion(-)

Powered by blists - more mailing lists