From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id 21C576B0033 for ; Sat, 16 Dec 2017 02:27:28 -0500 (EST) Received: by mail-qk0-f197.google.com with SMTP id z136so7293340qka.13 for ; Fri, 15 Dec 2017 23:27:28 -0800 (PST) Received: from userp2120.oracle.com (userp2120.oracle.com. [156.151.31.85]) by mx.google.com with ESMTPS id w22si8615450qtb.404.2017.12.15.23.27.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Dec 2017 23:27:27 -0800 (PST) Subject: Re: [PATCH] mm: Reduce memory bloat with THP References: <1513301359-117568-1-git-send-email-nitin.m.gupta@oracle.com> <20171215100151.b7j66q7sg2wsrex3@node.shutemov.name> From: Nitin Gupta Message-ID: Date: Fri, 15 Dec 2017 23:21:46 -0800 MIME-Version: 1.0 In-Reply-To: <20171215100151.b7j66q7sg2wsrex3@node.shutemov.name> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" Cc: linux-mm@kvack.org, steven.sistare@oracle.com, Andrew Morton , Ingo Molnar , Mel Gorman , Nadav Amit , Minchan Kim , "Kirill A. Shutemov" , Peter Zijlstra , Vegard Nossum , "Levin, Alexander (Sasha Levin)" , Michal Hocko , David Rientjes , Vlastimil Babka , SeongJae Park , Shaohua Li , "Aneesh Kumar K.V" , Andrea Arcangeli , Mike Rapoport , Anshuman Khandual , Rik van Riel , Ross Zwisler , Jan Kara , Dave Jiang , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Matthew Wilcox , Hugh Dickins , Tobin C Harding , open list 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 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org