Received: by 10.223.176.5 with SMTP id f5csp2548595wra; Thu, 1 Feb 2018 02:11:02 -0800 (PST) X-Google-Smtp-Source: AH8x224hOgBzGP0j/SyB8yafHejebGpz+bbiTrze3iZ8HAXsq+tckDnaO+6x39Coa/elRCU9DDKf X-Received: by 2002:a17:902:6e8c:: with SMTP id v12-v6mr32081755plk.14.1517479862495; Thu, 01 Feb 2018 02:11:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517479862; cv=none; d=google.com; s=arc-20160816; b=G0V07KKiPfg7qC+miCmu4XyumaEe7kDJn+Kc2r9RBdpULra9TO60G8HqdhclARVQ7E p6X0vllPB4+n94AbCrIBBR3phDP0JB4vGq8RMdOdKbLIrwlF5utwyjWf2J1cPv7Vs5yv uCiD/LslnP2w1bq5HOwdGYnMQB3JUNA5xZzrSuJ7LS6NjQwZgVp9uhQd3rP232uUz/Ql /wfv4tyue/P2RItuMX0hvU+z477/3eZHcQST53fLOZ7rsvSbcnUnNdUtddZsSo+iZE0w dc6QMv/jmlDbqWWMyBq/EaddH/g4tBuKZvfSjxKrrdNmA7hfwt5Ynsnm7M24woizPQyW OCTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=9F4CF8rbtX5nXxfNEkp6sIRJtiKKPNeHaXcqgexPI9s=; b=l4BPvJP2SQ5X+OFVlf3TZi0JLt05jwCkKfDrGb7fDJ993Dmv53m8KcAoFtrpcvWw9B HAOw4rSMZCi6hQ3/LUmkqthOOCva+zHiayNZA3OrSog9Mh17vDrMrw7aKh7BLFE/naMG acjpDzVys6uZD3v7g/jSk8Mr4utcRAD6K2Bdiq5LQ9beyZ9tK2DkcqoTk+tW1rdCcruc nbHVSi+ETg7XSSpeYPRLtLsy5amcpaGpyL1NkT3dikALpqUC9OR0S50kNz7hBGl/jZgV yML6vcRpzZ+t1gj/6E8mk5i0CINWrArTUz7wVrMbZVan+F572xmFyfhr0dfixX7m9qUx kmqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m21si2895920pgn.40.2018.02.01.02.10.47; Thu, 01 Feb 2018 02:11:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752062AbeBAKJu (ORCPT + 99 others); Thu, 1 Feb 2018 05:09:50 -0500 Received: from mx2.suse.de ([195.135.220.15]:45460 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751849AbeBAKJr (ORCPT ); Thu, 1 Feb 2018 05:09:47 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 83268AAF1; Thu, 1 Feb 2018 10:09:45 +0000 (UTC) Date: Thu, 1 Feb 2018 10:09:40 +0000 From: Mel Gorman To: Nitin Gupta Cc: Zi Yan , Michal Hocko , Nitin Gupta , steven.sistare@oracle.com, Andrew Morton , Ingo Molnar , Nadav Amit , Minchan Kim , "Kirill A. Shutemov" , Peter Zijlstra , Vegard Nossum , "Levin, Alexander" , Mike Rapoport , Hillf Danton , Shaohua Li , Anshuman Khandual , Andrea Arcangeli , David Rientjes , Rik van Riel , Jan Kara , Dave Jiang , J?r?me Glisse , Matthew Wilcox , Ross Zwisler , Hugh Dickins , Tobin C Harding , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm: Reduce memory bloat with THP Message-ID: <20180201100940.mry3x7lbkcdnid56@suse.de> References: <1516318444-30868-1-git-send-email-nitingupta910@gmail.com> <20180119124957.GA6584@dhcp22.suse.cz> <59F98618-C49F-48A8-BCA1-A8F717888BAA@cs.rutgers.edu> <4d7ce874-9771-ad5f-c064-52a46fc37689@oracle.com> <20180125211303.rbfeg7ultwr6hpd3@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 31, 2018 at 05:09:48PM -0800, Nitin Gupta wrote: > > > > It's non-trivial to do this because at minimum a page fault has to check > > if there is a potential promotion candidate by checking the PTEs around > > the faulting address searching for a correctly-aligned base page that is > > already inserted. If there is, then check if the correctly aligned base > > page for the current faulting address is free and if so use it. It'll > > also then need to check the remaining PTEs to see if both the promotion > > threshold has been reached and if so, promote it to a THP (or else teach > > khugepaged to do an in-place promotion if possible). In other words, > > implementing the promotion threshold is both hard and it's not free. > > > > However, if it did exist then the only tunable would be the "promotion > > threshold" and applications would not need any special awareness of their > > address space. > > > > I went through both references you mentioned and I really like the > idea of reservation-based hugepage allocation. Navarro also extends > the idea to allow multiple hugepage sizes to be used (as support by > underlying hardware) which was next in order of what I wanted to do in > THP. > Don't sweat too much about the multiple page size part. At the time Navarro was writing, it was expected that hardware would support multiple page sizes with fine granularity (e.g. what Itanium did). Just covering the PMD huge page size would go a long way towards balancing memory consumption and huge page usage. > So, please ignore this patch and I would work towards implementing > ideas in these papers. > > Thanks for the feedback. > My pleasure. -- Mel Gorman SUSE Labs