From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755761Ab3LRTHs (ORCPT ); Wed, 18 Dec 2013 14:07:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24436 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755627Ab3LRTHq (ORCPT ); Wed, 18 Dec 2013 14:07:46 -0500 Message-ID: <52B1D814.5000607@redhat.com> Date: Wed, 18 Dec 2013 12:15:00 -0500 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Andrea Arcangeli , Alex Thorlton CC: Andrew Morton , linux-mm@kvack.org, "Kirill A. Shutemov" , Benjamin Herrenschmidt , Wanpeng Li , Mel Gorman , Michel Lespinasse , Benjamin LaHaise , Oleg Nesterov , "Eric W. Biederman" , Andy Lutomirski , Al Viro , David Rientjes , Zhang Yanfei , Peter Zijlstra , Johannes Weiner , Michal Hocko , Jiang Liu , Cody P Schafer , Glauber Costa , Kamezawa Hiroyuki , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/3] Change how we determine when to hand out THPs References: <20131212180037.GA134240@sgi.com> <20131213214437.6fdbf7f2.akpm@linux-foundation.org> <20131216171214.GA15663@sgi.com> <20131216175111.GD21218@redhat.com> <20131217162006.GH18680@sgi.com> <20131217175500.GB5441@redhat.com> In-Reply-To: <20131217175500.GB5441@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/17/2013 12:55 PM, Andrea Arcangeli wrote: > About creating heuristics to automatically detect the ideal value of > the big-hammer per-app on/off switch (or even harder the ideal value > of the per-app threshold), I think it's not going to happen because > there are too few corner cases and it wouldn't be worth the cost of it > (the cost would be significant no matter how implemented). > > Every time we try to make THP smarter at auto-disabling itself for the > corner cases, we're slowing it down for everyone that gets a benefit > from it, and there's no way around it. This is why I think the > big-hammer prctl for the few corner cases is the best way to go. There is one thing we could do in a slow path, that would result in automatic disabling of THP under the corner case of there not being enough memory in the system. We can teach the swapout code to discard zero-filled pages, instead of swapping them out to disk. That way we will "deflate" some of the excess memory consumed by THP, and reduce the extra swap IO that could be caused by THP using more memory. Not sure who is interested in this particular corner case, but it may be an interesting one to solve :)