From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758471AbcIMOfy (ORCPT ); Tue, 13 Sep 2016 10:35:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52468 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756954AbcIMOfw (ORCPT ); Tue, 13 Sep 2016 10:35:52 -0400 Date: Tue, 13 Sep 2016 16:35:48 +0200 From: Andrea Arcangeli To: "Huang, Ying" Cc: Minchan Kim , Andrew Morton , tim.c.chen@intel.com, dave.hansen@intel.com, andi.kleen@intel.com, aaron.lu@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hugh Dickins , Shaohua Li , Rik van Riel , "Kirill A . Shutemov" , Vladimir Davydov , Johannes Weiner , Michal Hocko Subject: Re: [PATCH -v3 00/10] THP swap: Delay splitting THP during swapping out Message-ID: <20160913143548.GP19048@redhat.com> References: <1473266769-2155-1-git-send-email-ying.huang@intel.com> <20160909054336.GA2114@bbox> <87sht824n3.fsf@yhuang-mobile.sh.intel.com> <20160913061349.GA4445@bbox> <87y42wgv5r.fsf@yhuang-dev.intel.com> <20160913070524.GA4973@bbox> <87vay0ji3m.fsf@yhuang-mobile.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87vay0ji3m.fsf@yhuang-mobile.sh.intel.com> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 13 Sep 2016 14:35:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, Sep 13, 2016 at 04:53:49PM +0800, Huang, Ying wrote: > I am glad to discuss my final goal, that is, swapping out/in the full > THP without splitting. Why I want to do that is copied as below, I think that is a fine objective. It wasn't implemented initially just to keep things simple. Doing it will reduce swap fragmentation (provided we can find a physically contiguous piece of to swapout the THP in the first place) and it will make all other heuristics that tries to keep the swap space contiguous less relevant and it should increase the swap bandwidth significantly at least on spindle disks. I personally see it as a positive that we relay less on those and the readhaead swapin. > >> >> The disadvantage are: > >> >> > >> >> - Increase the memory pressure when swap in THP. That is always true with THP enabled to always. It is the tradeoff. It still cannot use more RAM than userland ever allocated in the vma as virtual memory. If userland don't ever need such memory it can free it by zapping the vma and the THP will be splitted. If the vma is zapped while the THP is natively swapped out, the zapped portion of swap space shall be released as well. So ultimately userland always controls the cap on the max virtual memory (ram+swap) the kernel decides to use with THP enabled to always. > I think it is important to use 2M pages as much as possible to deal with > the big memory problem. Do you agree? I agree. Thanks, Andrea