Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp911356yba; Wed, 3 Apr 2019 23:52:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7bzN412O4gf5c+zyNl0Pa0vMikvmsLMwZDNZFDfJYk2SV1gj415OGry4JJ55mZubmYSGX X-Received: by 2002:a17:902:547:: with SMTP id 65mr4684480plf.242.1554360749404; Wed, 03 Apr 2019 23:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554360749; cv=none; d=google.com; s=arc-20160816; b=WB+voeTHGdUNckixkQlfLDPlT9MNCMNbADDQ13sRNjRhLagsFX+5OXOOENsxSRKIfX a7codK/mipLWgEUqQb0vwK6w4umJ8pKcaXD1VoeHEbETFzJa3RotfubgMD4+C82Cuay5 SeWLQo1YTZdigdYW2D1ZJUUTNESmmyNCFtDmpAHuL6cJWk2PAPbHLmdxd+uqGH6uiVxT ELUJz0HVcLCEWV0sRpnZ8Mdl+r599jf024mypdxCOBUqB3O9OI+fxswvxwT2fpdtNEzX p4pH5wP47nGN1TcaZW3iBFBGB/NYTHbE+ZWm903ZeBOxuEsA964M546imXvQzVpQ9LLU fHAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=cxIwiceVjfR/9bUFid3FlngaTvdWiCleRmGC0rzqHZk=; b=vtZ06CNzuRk2CeWLy9gB4w8E82VlpRiaSK1xOI+q3bfx91KQGnXkRkyf+/Eyk1PtNF GRIJWtHxhlRxz28sybRVjhGKXM/7Bif1X6ntgVNN72g6tQYwhICuI//dHDl6KQ/WY5Af XhnsrF40BQt0FNTfqlx/pQnBn32CecO1ZLflOcGUaa7GMcqI73TCUC2EpOUAsSbjNO9J FN2QWOTrizQNrGBeAlfUdY+aPl1XSZ+j/Z+zrAI1uc/NF52NqNuWZsx6W7YCv7wqLmeg /rd5daOEvv6DoWifKtDfnxKNfkETCbOsvSpRAufxwupcDxEXJ32HDtJeB0AJ9+eYV4IH DHUQ== 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 207si621253pgc.266.2019.04.03.23.52.10; Wed, 03 Apr 2019 23:52:29 -0700 (PDT) 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 S1726974AbfDDGve (ORCPT + 99 others); Thu, 4 Apr 2019 02:51:34 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52574 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725914AbfDDGvd (ORCPT ); Thu, 4 Apr 2019 02:51:33 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7094380D; Wed, 3 Apr 2019 23:51:32 -0700 (PDT) Received: from [10.162.40.100] (p8cg001049571a15.blr.arm.com [10.162.40.100]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AB6EF3F68F; Wed, 3 Apr 2019 23:51:26 -0700 (PDT) Subject: Re: [PATCH 2/6] arm64/mm: Enable memory hot remove To: Steven Price , Robin Murphy , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, akpm@linux-foundation.org, will.deacon@arm.com, catalin.marinas@arm.com Cc: mark.rutland@arm.com, mhocko@suse.com, david@redhat.com, logang@deltatee.com, cai@lca.pw, pasha.tatashin@oracle.com, james.morse@arm.com, cpandya@codeaurora.org, arunks@codeaurora.org, dan.j.williams@intel.com, mgorman@techsingularity.net, osalvador@suse.de References: <1554265806-11501-1-git-send-email-anshuman.khandual@arm.com> <1554265806-11501-3-git-send-email-anshuman.khandual@arm.com> From: Anshuman Khandual Message-ID: Date: Thu, 4 Apr 2019 12:21:28 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/03/2019 06:45 PM, Steven Price wrote: > On 03/04/2019 13:37, Robin Murphy wrote: >> [ +Steve ] >> >> Hi Anshuman, Hi Steve, >> >> On 03/04/2019 05:30, Anshuman Khandual wrote: > > > >>> diff --git a/arch/arm64/include/asm/pgtable.h >>> b/arch/arm64/include/asm/pgtable.h >>> index de70c1e..858098e 100644 >>> --- a/arch/arm64/include/asm/pgtable.h >>> +++ b/arch/arm64/include/asm/pgtable.h >>> @@ -355,6 +355,18 @@ static inline int pmd_protnone(pmd_t pmd) >>>   } >>>   #endif >>>   +#if (CONFIG_PGTABLE_LEVELS > 2) >>> +#define pmd_large(pmd)    (pmd_val(pmd) && !(pmd_val(pmd) & >>> PMD_TABLE_BIT)) >>> +#else >>> +#define pmd_large(pmd) 0 >>> +#endif >>> + >>> +#if (CONFIG_PGTABLE_LEVELS > 3) >>> +#define pud_large(pud)    (pud_val(pud) && !(pud_val(pud) & >>> PUD_TABLE_BIT)) >>> +#else >>> +#define pud_large(pmd) 0 >>> +#endif >> >> These seem rather different from the versions that Steve is proposing in >> the generic pagewalk series - can you reach an agreement on which >> implementation is preferred? > > Indeed this doesn't match the version in my series although is quite > similar. > > My desire is that p?d_large represents the hardware architectural > definition of large page/huge page/section (pick your naming). Although > now I look more closely this is actually broken in my series (I'll fix > that up and send a new version shortly) - p?d_sect() is similarly > conditional. > > Is there a good reason not to use the existing p?d_sect() macros > available on arm64? Nothing specific. Now I just tried using pud|pmd_sect() which looks good on multiple configs for 4K/16K/64K. Will migrate pmd|pud_large() to more arch specific pmd|pud_sect() which would also help in staying clear from your series. > > I'm also surprised by the CONFIG_PGTABLE_LEVEL conditions as they don't > match the existing conditions for p?d_sect(). Might be worth double > checking it actually does what you expect. Right they are bit different. Surely will check. But if pmd|pud_sect() works out okay will probably go with it as its been there for sometime.