From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f198.google.com (mail-wr0-f198.google.com [209.85.128.198]) by kanga.kvack.org (Postfix) with ESMTP id 61E4F6B000A for ; Tue, 17 Apr 2018 17:12:44 -0400 (EDT) Received: by mail-wr0-f198.google.com with SMTP id k27so16954089wre.23 for ; Tue, 17 Apr 2018 14:12:44 -0700 (PDT) Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id o15si11787653wrh.126.2018.04.17.14.12.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Apr 2018 14:12:43 -0700 (PDT) Subject: Re: [PATCH -mm 06/21] mm, THP, swap: Support PMD swap mapping when splitting huge PMD References: <20180417020230.26412-1-ying.huang@intel.com> <20180417020230.26412-7-ying.huang@intel.com> From: Randy Dunlap Message-ID: <7ae64b5e-79ee-5768-34a3-75e33ea45246@infradead.org> Date: Tue, 17 Apr 2018 14:12:05 -0700 MIME-Version: 1.0 In-Reply-To: <20180417020230.26412-7-ying.huang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: "Huang, Ying" , Andrew Morton Cc: Tim Chen , Andi Kleen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , Andrea Arcangeli , Michal Hocko , Johannes Weiner , Shaohua Li , Hugh Dickins , Minchan Kim , Rik van Riel , Dave Hansen , Naoya Horiguchi , Zi Yan On 04/16/18 19:02, Huang, Ying wrote: > From: Huang Ying > > A huge PMD need to be split when zap a part of the PMD mapping etc. > If the PMD mapping is a swap mapping, we need to split it too. This > patch implemented the support for this. This is similar as splitting > the PMD page mapping, except we need to decrease the PMD swap mapping > count for the huge swap cluster too. If the PMD swap mapping count > becomes 0, the huge swap cluster will be split. > > Notice: is_huge_zero_pmd() and pmd_page() doesn't work well with swap > PMD, so pmd_present() check is called before them. FWIW, I would prefer to see that comment in the source code, not just in the commit description. > > Signed-off-by: "Huang, Ying" > Cc: "Kirill A. Shutemov" > Cc: Andrea Arcangeli > Cc: Michal Hocko > Cc: Johannes Weiner > Cc: Shaohua Li > Cc: Hugh Dickins > Cc: Minchan Kim > Cc: Rik van Riel > Cc: Dave Hansen > Cc: Naoya Horiguchi > Cc: Zi Yan > --- > include/linux/swap.h | 6 +++++ > mm/huge_memory.c | 54 ++++++++++++++++++++++++++++++++++++++++---- > mm/swapfile.c | 28 +++++++++++++++++++++++ > 3 files changed, 83 insertions(+), 5 deletions(-) -- ~Randy