[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ba966a4-abf9-1363-3e82-41fe73bc0919@suse.cz>
Date: Thu, 27 Sep 2018 15:21:09 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: "Kirill A. Shutemov" <kirill@...temov.name>,
Yang Shi <yang.shi@...ux.alibaba.com>
Cc: mhocko@...nel.org, willy@...radead.org, ldufour@...ux.vnet.ibm.com,
akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [v2 PATCH 2/2 -mm] mm: brk: dwongrade mmap_sem to read when
shrinking
On 9/27/18 2:50 PM, Kirill A. Shutemov wrote:
>> diff --git a/mm/mmap.c b/mm/mmap.c
>> index 017bcfa..0d2fae1 100644
>> --- a/mm/mmap.c
>> +++ b/mm/mmap.c
>> @@ -193,9 +193,11 @@ static int do_brk_flags(unsigned long addr, unsigned long request, unsigned long
>> unsigned long retval;
>> unsigned long newbrk, oldbrk;
>> struct mm_struct *mm = current->mm;
>> + unsigned long origbrk = mm->brk;
>
> Is it safe to read mm->brk outside the lock?
Good catch! I guess not, parallel brk()'s could then race.
Powered by blists - more mailing lists