From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933662AbbFVNTD (ORCPT ); Mon, 22 Jun 2015 09:19:03 -0400 Received: from mta-out1.inet.fi ([62.71.2.230]:43347 "EHLO johanna4.rokki.sonera.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933612AbbFVNS7 (ORCPT ); Mon, 22 Jun 2015 09:18:59 -0400 RazorGate-KAS: Rate: 5 RazorGate-KAS: {RECEIVED: dynamic ip detected} RazorGate-KAS: Envelope from: RazorGate-KAS: Version: 5.5.3 RazorGate-KAS: LuaCore: 215 2015-05-29_17-31-22 60ae4a1b4d01d14f868b20a55aced8d7df7b2e28 RazorGate-KAS: Method: none RazorGate-KAS: Lua profiles 78662 [Jun 02 2015] RazorGate-KAS: Status: not_detected Date: Mon, 22 Jun 2015 16:18:27 +0300 From: "Kirill A. Shutemov" To: Vlastimil Babka Cc: "Kirill A. Shutemov" , Andrew Morton , Andrea Arcangeli , Hugh Dickins , Dave Hansen , Mel Gorman , Rik van Riel , Christoph Lameter , Naoya Horiguchi , Steve Capper , "Aneesh Kumar K.V" , Johannes Weiner , Michal Hocko , Jerome Marchand , Sasha Levin , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHv6 36/36] thp: update documentation Message-ID: <20150622131827.GF7934@node.dhcp.inet.fi> References: <1433351167-125878-1-git-send-email-kirill.shutemov@linux.intel.com> <1433351167-125878-37-git-send-email-kirill.shutemov@linux.intel.com> <55797F57.8040001@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55797F57.8040001@suse.cz> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 11, 2015 at 02:30:15PM +0200, Vlastimil Babka wrote: > On 06/03/2015 07:06 PM, Kirill A. Shutemov wrote: > >The patch updates Documentation/vm/transhuge.txt to reflect changes in > >THP design. > > One thing I'm missing is info about the deferred splitting. Okay, I'll add this. > >Signed-off-by: Kirill A. Shutemov > >--- > > Documentation/vm/transhuge.txt | 124 +++++++++++++++++++++++------------------ > > 1 file changed, 69 insertions(+), 55 deletions(-) > > > >diff --git a/Documentation/vm/transhuge.txt b/Documentation/vm/transhuge.txt > >index 6b31cfbe2a9a..2352b12cae93 100644 > >--- a/Documentation/vm/transhuge.txt > >+++ b/Documentation/vm/transhuge.txt > >@@ -35,10 +35,10 @@ miss is going to run faster. > > > > == Design == > > > >-- "graceful fallback": mm components which don't have transparent > >- hugepage knowledge fall back to breaking a transparent hugepage and > >- working on the regular pages and their respective regular pmd/pte > >- mappings > >+- "graceful fallback": mm components which don't have transparent hugepage > >+ knowledge fall back to breaking huge pmd mapping into table of ptes and, > >+ if nesessary, split a transparent hugepage. Therefore these components > > necessary > >+ > >+split_huge_page uses migration entries to stabilize page->_count and > >+page->_mapcount. > > Hm, what if there's some physical memory scanner taking page->_count pins? I > think compaction shouldn't be an issue, but maybe some others? The only legitimate way scanner can get reference to a page is get_page_unless_zero(), right? All tail pages has zero ->_count until atomic_add() in __split_huge_page_tail() -- get_page_unless_zero() will fail. After the atomic_add() we don't care about ->_count value. We already known how many references with should uncharge from head page. For head page get_page_unless_zero() will succeed and we don't mind. It's clear where reference should go after split: it will stay on head page. -- Kirill A. Shutemov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/