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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED 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 8497EC00319 for ; Thu, 21 Feb 2019 14:46:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 558B020700 for ; Thu, 21 Feb 2019 14:46:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729224AbfBUOq0 (ORCPT ); Thu, 21 Feb 2019 09:46:26 -0500 Received: from foss.arm.com ([217.140.101.70]:45674 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbfBUOqY (ORCPT ); Thu, 21 Feb 2019 09:46:24 -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 A52F3A78; Thu, 21 Feb 2019 06:46:23 -0800 (PST) Received: from [10.1.196.69] (e112269-lin.cambridge.arm.com [10.1.196.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 305673F690; Thu, 21 Feb 2019 06:46:20 -0800 (PST) Subject: Re: [PATCH v2 03/13] mm: Add generic p?d_large() macros To: "Kirill A. Shutemov" Cc: Mark Rutland , x86@kernel.org, Arnd Bergmann , Ard Biesheuvel , Peter Zijlstra , Catalin Marinas , Dave Hansen , Will Deacon , linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , James Morse , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, "Liang, Kan" References: <20190221113502.54153-1-steven.price@arm.com> <20190221113502.54153-4-steven.price@arm.com> <20190221142812.oa53lfnnfmsuh6ys@kshutemo-mobl1> From: Steven Price Message-ID: Date: Thu, 21 Feb 2019 14:46:18 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190221142812.oa53lfnnfmsuh6ys@kshutemo-mobl1> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/02/2019 14:28, Kirill A. Shutemov wrote: > On Thu, Feb 21, 2019 at 11:34:52AM +0000, Steven Price wrote: >> From: James Morse >> >> Exposing the pud/pgd levels of the page tables to walk_page_range() means >> we may come across the exotic large mappings that come with large areas >> of contiguous memory (such as the kernel's linear map). >> >> For architectures that don't provide p?d_large() macros, provided a >> does nothing default. > > Nak, sorry. > > Power will get broken by the patch. It has pmd_large() inline function, > that will be overwritten by the define from this patch. > > I believe it requires more ground work on arch side in general. > All architectures that has huge page support has to provide these helpers > (and matching defines) before you can use it in a generic code. Sorry about that, I had compile tested on power, but obviously not the right config to actually see the breakage. I'll do some grepping - hopefully this is just a case of exposing the functions/defines that already exist for those architectures. Note that in terms of the new page walking code, these new defines are only used when walking a page table without a VMA (which isn't currently done), so architectures which don't use p?d_large currently will work fine with the generic versions. They only need to provide meaningful definitions when switching to use the walk-without-a-VMA functionality. Thanks for reporting the breakage. Steve