Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758547AbbBFSko (ORCPT ); Fri, 6 Feb 2015 13:40:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42916 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755438AbbBFSkm (ORCPT ); Fri, 6 Feb 2015 13:40:42 -0500 Message-ID: <54D50A87.8000902@redhat.com> Date: Fri, 06 Feb 2015 13:40:07 -0500 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Shaohua Li , Michal Hocko CC: Minchan Kim , "Michael Kerrisk (man-pages)" , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Hugh Dickins , Johannes Weiner , KOSAKI Motohiro , Mel Gorman , Jason Evans , zhangyanfei@cn.fujitsu.com, "Kirill A. Shutemov" , "Kirill A. Shutemov" Subject: Re: [PATCH v17 1/7] mm: support madvise(MADV_FREE) References: <20141130235652.GA10333@bbox> <20141202100125.GD27014@dhcp22.suse.cz> <20141203000026.GA30217@bbox> <20141203101329.GB23236@dhcp22.suse.cz> <20141205070816.GB3358@bbox> <20141205083249.GA2321@dhcp22.suse.cz> <54D0F9BC.4060306@gmail.com> <20150203234722.GB3583@blaptop> <20150206003311.GA2347@kernel.org> <20150206125825.GA4498@dhcp22.suse.cz> <20150206183242.GB2290@kernel.org> In-Reply-To: <20150206183242.GB2290@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1770 Lines: 43 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/06/2015 01:32 PM, Shaohua Li wrote: > On Fri, Feb 06, 2015 at 01:58:25PM +0100, Michal Hocko wrote: >> On Thu 05-02-15 16:33:11, Shaohua Li wrote: [...] >>> Did you think about move the MADV_FREE pages to the head of >>> inactive LRU, so they can be reclaimed easily? >> >> Yes this makes sense for pages living on the active LRU list. I >> would preserve LRU ordering on the inactive list because there is >> no good reason to make the operation more costly for inactive >> pages. On the other hand having tons of to-be-freed pages on the >> active list clearly sucks. Care to send a patch? > > Considering anon pages are in active LRU first, it's likely > MADV_FREE pages are in active list. I'm curious why preserves the > order of inactive list. Only before the first time MADV_FREE is called on those pages. If a program repeatedly allocates and frees the same memory region, not moving the MADV_FREE pages around in the LRU several times can save some overhead. - -- All rights reversed -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU1QqHAAoJEM553pKExN6DTXoH/3bS+VhdIm1EpOc8OOFtBHvd T63DHObtOY1FOog48CtgvUCfo7Q+g1aG/9hz7lJNP1G26B3+LNszM9OtE/9QrYUH uzmuWvFL7l0W0qen/WsyO0RcyqN+0mEXvNVqynTmJJu8qAG0p5WsjA6L5Penzj// tnBmn5xb1h3COjDZkHsxBfkpfCpNq5dm88K6B3nApHz4QhfcviKefczsrWdZ/bBc 2uMnlIebKY1Oq9MDHsg8p/b3lIHzwAf0xGSvGLN0YfzDPzlqBMbxSbVubYEA9EaU OiS1XqRp8okeGgrxsRAb/F8wPgClpce+h0E5xpyUuew2rlD1OmciX6iIDcE5Zrk= =KUng -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/