Re: [PATCH] mm: Reduce memory bloat with THP

From: Nitin Gupta
Date: Sat Dec 16 2017 - 02:33:42 EST


On 12/15/17 2:01 AM, Kirill A. Shutemov wrote:
> On Thu, Dec 14, 2017 at 05:28:52PM -0800, Nitin Gupta wrote:
>> diff --git a/mm/madvise.c b/mm/madvise.c
>> index 751e97a..b2ec07b 100644
>> --- a/mm/madvise.c
>> +++ b/mm/madvise.c
>> @@ -508,6 +508,7 @@ static long madvise_dontneed_single_vma(struct vm_area_struct *vma,
>> unsigned long start, unsigned long end)
>> {
>> zap_page_range(vma, start, end - start);
>> + vma->space_efficient = true;
>> return 0;
>> }
>>
>
> And this modifies vma without down_write(mmap_sem).
>

I thought this function was always called with mmmap_sem write locked.
I will check again.

- Nitin