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=-9.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B298EC433E2 for ; Tue, 8 Sep 2020 17:20:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 225A6206B5 for ; Tue, 8 Sep 2020 17:20:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 225A6206B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 398626B0037; Tue, 8 Sep 2020 13:20:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 349198E0001; Tue, 8 Sep 2020 13:20:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2110A6B005A; Tue, 8 Sep 2020 13:20:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id 08F366B0037 for ; Tue, 8 Sep 2020 13:20:35 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B1E67181AEF00 for ; Tue, 8 Sep 2020 17:20:34 +0000 (UTC) X-FDA: 77240558388.29.fly17_2403f1b270d6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id C1D4D180868E6 for ; Tue, 8 Sep 2020 17:20:33 +0000 (UTC) X-HE-Tag: fly17_2403f1b270d6 X-Filterd-Recvd-Size: 4967 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Tue, 8 Sep 2020 17:20:32 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4BmBk46RHRz9txPY; Tue, 8 Sep 2020 19:20:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id YAOBL0_HRwVU; Tue, 8 Sep 2020 19:20:28 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4BmBk45P4rz9txPb; Tue, 8 Sep 2020 19:20:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 83AF88B7BE; Tue, 8 Sep 2020 19:20:30 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id rrT5wpXHgDDS; Tue, 8 Sep 2020 19:20:30 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D57098B7C7; Tue, 8 Sep 2020 19:20:28 +0200 (CEST) Subject: Re: [RFC PATCH v2 3/3] mm: make generic pXd_addr_end() macros inline functions To: Alexander Gordeev Cc: Gerald Schaefer , Jason Gunthorpe , John Hubbard , Peter Zijlstra , Dave Hansen , linux-mm , Paul Mackerras , linux-sparc , Claudio Imbrenda , Will Deacon , linux-arch , linux-s390 , Vasily Gorbik , Richard Weinberger , linux-x86 , Russell King , Christian Borntraeger , Ingo Molnar , Catalin Marinas , Andrey Ryabinin , Heiko Carstens , Arnd Bergmann , Jeff Dike , linux-um , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , linux-arm , linux-power , LKML , Andrew Morton , Linus Torvalds , Mike Rapoport References: <20200907180058.64880-1-gerald.schaefer@linux.ibm.com> <20200907180058.64880-4-gerald.schaefer@linux.ibm.com> <4c101685-5b29-dace-9dd2-b6f0ae193a9c@csgroup.eu> <20200908154859.GA11583@oc3871087118.ibm.com> From: Christophe Leroy Message-ID: Date: Tue, 8 Sep 2020 19:20:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200908154859.GA11583@oc3871087118.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr X-Rspamd-Queue-Id: C1D4D180868E6 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Le 08/09/2020 =C3=A0 17:48, Alexander Gordeev a =C3=A9crit=C2=A0: > On Tue, Sep 08, 2020 at 07:19:38AM +0200, Christophe Leroy wrote: >=20 > [...] >=20 >>> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h >>> index 67ebc22cf83d..d9e7d16c2263 100644 >>> --- a/include/linux/pgtable.h >>> +++ b/include/linux/pgtable.h >>> @@ -656,31 +656,35 @@ static inline int arch_unmap_one(struct mm_stru= ct *mm, >>> */ >>> #ifndef pgd_addr_end >>> -#define pgd_addr_end(pgd, addr, end) \ >>> -({ unsigned long __boundary =3D ((addr) + PGDIR_SIZE) & PGDIR_MASK; = \ >>> - (__boundary - 1 < (end) - 1)? __boundary: (end); \ >>> -}) >>> +#define pgd_addr_end pgd_addr_end >> >> I think that #define is pointless, usually there is no such #define >> for the default case. >=20 > Default pgd_addr_end() gets overriden on s390 (arch/s390/include/asm/pg= table.h): >=20 > #define pgd_addr_end pgd_addr_end > static inline unsigned long pgd_addr_end(pgd_t pgd, unsigned long addr,= unsigned long end) > { > return rste_addr_end_folded(pgd_val(pgd), addr, end); > } Yes, there in s390 the #define is needed to hit the #ifndef pgd_addr_end=20 that's in include/linux/pgtable.h But in include/linux/pgtable.h, there is no need of an #define=20 pgd_addr_end pgd_addr_end I think >=20 >>> +static inline unsigned long pgd_addr_end(pgd_t pgd, unsigned long ad= dr, unsigned long end) >>> +{ unsigned long __boundary =3D (addr + PGDIR_SIZE) & PGDIR_MASK; >>> + return (__boundary - 1 < end - 1) ? __boundary : end; >>> +} Christophe