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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F8DBC433EF for ; Sun, 6 Feb 2022 22:05:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D26B36B0072; Sun, 6 Feb 2022 17:05:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CD5256B0073; Sun, 6 Feb 2022 17:05:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B9C3A6B0074; Sun, 6 Feb 2022 17:05:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id AB3F46B0072 for ; Sun, 6 Feb 2022 17:05:38 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6572C95CA2 for ; Sun, 6 Feb 2022 22:05:38 +0000 (UTC) X-FDA: 79113737556.30.962491C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf28.hostedemail.com (Postfix) with ESMTP id ADEDDC0005 for ; Sun, 6 Feb 2022 22:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=iUG/BeH1eoOJbWKGISx6FgIeT1FgLx8h+BHS51Koo9w=; b=TXmG0YQ/hITDxJ4ZRMAGSIFoH5 tUa31/EGrTBx3DYdFFJ6W3RcDlMtXeAKGJ/C+lQstIeqgDOTCQpO4GOcAyRLt2/MrUQPDutK8KUSq OGuQyRO4YDA0tCBZn2AtcrKVPoXopc8zlpAT31tUNghY2ZL+7yMfPbSjQxEpET4jRxPusOjxNjQ5p t4GdpBpmVWIKr7SZHeVSkJGFwAV5Dxw6h6n7WXCOnvHWLiU2hA+/oIAROdYfuTzuoKzrtpsl1+2Zv XIaWc3jnzKXQQZhjptdCGTOn6/HsSmqY5PA41REv0BPHEpLw/9RXfaTCiUP2+nmPIs9u12byCIulE q6Se2ppw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nGpf5-00Fm8w-9s; Sun, 06 Feb 2022 22:05:35 +0000 Date: Sun, 6 Feb 2022 22:05:35 +0000 From: Matthew Wilcox To: Mike Rapoport Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 41/75] hexagon: Add pmd_pfn() Message-ID: References: <20220204195852.1751729-1-willy@infradead.org> <20220204195852.1751729-42-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: ADEDDC0005 X-Stat-Signature: ti3ft4gc5odkgrwtymn4wbp3w5xi8qdt Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="TXmG0YQ/"; dmarc=none; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspam-User: nil X-HE-Tag: 1644185137-348979 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: On Sun, Feb 06, 2022 at 11:33:40PM +0200, Mike Rapoport wrote: > On Sun, Feb 06, 2022 at 08:46:45PM +0000, Matthew Wilcox wrote: > > On Sun, Feb 06, 2022 at 08:13:11PM +0200, Mike Rapoport wrote: > > > On Fri, Feb 04, 2022 at 07:58:18PM +0000, Matthew Wilcox (Oracle) wrote: > > > > I need to use this function in common code, so define it for hexagon. > > > > > > > > Signed-off-by: Matthew Wilcox (Oracle) > > > > --- > > > > arch/hexagon/include/asm/pgtable.h | 3 ++- > > > > > > Why hexagon out of all architectures? > > > What about m68k, nios2, nds32 etc? > > > Presumably they don't support CONFIG_TRANSPARENT_HUGEPAGE. > > This code isn't compiled when THP are disabled; at least I haven't > > had a buildbot complaint for any other architectures. > > m68k defconfig fails: > > CC mm/page_vma_mapped.o > mm/page_vma_mapped.c: In function 'page_vma_mapped_walk': > mm/page_vma_mapped.c:219:20: error: implicit declaration of function 'pmd_pfn'; did you mean 'pmd_off'? [-Werror=implicit-function-declaration] > 219 | if (!check_pmd(pmd_pfn(pmde), pvmw)) > | ^~~~~~~ > | pmd_off Ok, so this whole thing is protected by "if (pmd_trans_huge(pmd))" which is defined to be 0 if !THP. But obviously, gcc is trying to parse it. So I think we need something like: #ifndef CONFIG_TRANSPARENT_HUGEPAGE static inline unsigned long pmd_pfn(pmd_t pmd) { BUG(); return 0UL; } #endif but that can have its own problem if architectures define pmd_pfn() when they don't have CONFIG_TRANSPARENT_HUGEPAGE. Which of course, they can do.