From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A8ADC43381 for ; Mon, 18 Feb 2019 17:05:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5925F20C01 for ; Mon, 18 Feb 2019 17:05:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388000AbfBRRFI (ORCPT ); Mon, 18 Feb 2019 12:05:08 -0500 Received: from foss.arm.com ([217.140.101.70]:34422 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731720AbfBRRFI (ORCPT ); Mon, 18 Feb 2019 12:05:08 -0500 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 28F431BB0; Mon, 18 Feb 2019 09:05:02 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2FE863F675; Mon, 18 Feb 2019 09:04:54 -0800 (PST) Date: Mon, 18 Feb 2019 17:04:51 +0000 From: Mark Rutland To: Steven Price Cc: Peter Zijlstra , Dave Hansen , Arnd Bergmann , Ard Biesheuvel , Catalin Marinas , x86@kernel.org, Will Deacon , linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?utf-8?B?SsOpcsO0bWU=?= Glisse , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , James Morse , Thomas Gleixner , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 01/13] arm64: mm: Add p?d_large() definitions Message-ID: <20190218170451.GB10145@lakrids.cambridge.arm.com> References: <20190215170235.23360-1-steven.price@arm.com> <20190215170235.23360-2-steven.price@arm.com> <20190218112922.GT32477@hirez.programming.kicks-ass.net> <20190218142951.GA10145@lakrids.cambridge.arm.com> <20190218150657.GU32494@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 18, 2019 at 03:30:38PM +0000, Steven Price wrote: > On 18/02/2019 15:06, Peter Zijlstra wrote: > > On Mon, Feb 18, 2019 at 02:29:52PM +0000, Mark Rutland wrote: > >> I think that Peter means p?d_huge(x) should imply p?d_large(x), e.g. > >> > >> #define pmd_large(x) \ > >> (pmd_sect(x) || pmd_huge(x) || pmd_trans_huge(x)) > >> > >> ... which should work regardless of CONFIG_HUGETLB_PAGE. > > > > Yep, that. > > I'm not aware of a situation where pmd_huge(x) is true but pmd_sect(x) > isn't. Equally for pmd_huge(x) and pmd_trans_huge(x). > > What am I missing? Having dug for a bit, I think you're right in asserting that pmd_sect() should cover those. I had worried that wouldn't cater for contiguous pmd entries, but those have to be contiguous section entries, so they get picked up. That said, do we have any special handling for contiguous PTEs? We use those in kernel mappings regardless of hugetlb support, and I didn't spot a pte_large() helper. Thanks, Mark.