lkml.org 
[lkml]   [2019]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 4/5] proc: use down_read_killable for /proc/pid/clear_refs
    From
    Date
    Replace the only unkillable mmap_sem lock in clear_refs_write.

    Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
    ---
    fs/proc/task_mmu.c | 5 ++++-
    1 file changed, 4 insertions(+), 1 deletion(-)

    diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
    index 78bed6adc62d..7f84d1477b5b 100644
    --- a/fs/proc/task_mmu.c
    +++ b/fs/proc/task_mmu.c
    @@ -1140,7 +1140,10 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf,
    goto out_mm;
    }

    - down_read(&mm->mmap_sem);
    + if (down_read_killable(&mm->mmap_sem)) {
    + count = -EINTR;
    + goto out_mm;
    + }
    tlb_gather_mmu(&tlb, mm, 0, -1);
    if (type == CLEAR_REFS_SOFT_DIRTY) {
    for (vma = mm->mmap; vma; vma = vma->vm_next) {
    \
     
     \ /
      Last update: 2019-05-15 10:42    [W:2.484 / U:0.004 seconds]
    ©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site