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=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 CC2B2C38A29 for ; Wed, 15 Apr 2020 15:34:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 72895206D5 for ; Wed, 15 Apr 2020 15:34:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="nDe1C43q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72895206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D4F828E0026; Wed, 15 Apr 2020 11:34:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D27798E0001; Wed, 15 Apr 2020 11:34:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C63C48E0026; Wed, 15 Apr 2020 11:34:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id ABE308E0001 for ; Wed, 15 Apr 2020 11:34:32 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 66137180AD80F for ; Wed, 15 Apr 2020 15:34:32 +0000 (UTC) X-FDA: 76710486384.12.shade58_7ee2db2737a36 X-HE-Tag: shade58_7ee2db2737a36 X-Filterd-Recvd-Size: 5013 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Apr 2020 15:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=k93jWTHKWpFEN4F9SAvfEChcPWYMd81tShHsmAijNZM=; b=nDe1C43qgxEOthZ67P6sU4NyQv zE92U1Iyh0Rp3KjlFj5uRvTGHFP9dO/SsV4ELkffAtS7uHTfK4LXyyNBrdDAeSjPgUCPahiDm7wKn WjfthkaM/NbPOS04qn47WarfifXSDfKorWU4Ze1oE0qPrHn5Mm9dbgc/1PJgoxZTxHDNZRu7oKnED mthpJ086zvdIrp9FzDSJoQYOAfswJgQ9WEJXWPXXCxFlRB7NGRE/FdVevvVqMlf+WSoMu7hqmw2cN K84Vewnr1SqfXYr1kV28cHEqNCstQwQCjvpIOLfOGEyWotcBHuyCtbj/wSXtXox/qbZKzwUw88LQG rKvA8fGg==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOk3X-0002Tz-VE; Wed, 15 Apr 2020 15:34:28 +0000 Subject: Re: linux-next: Tree for Apr 14 (mm/shmem.c) To: Hugh Dickins , Andrew Morton Cc: Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List , Linux MM References: <20200414123900.4f97a83f@canb.auug.org.au> <200c608a-8159-18ce-b44e-cad2022e23e2@infradead.org> <20200414182430.c5af29ddb1735f5fd0083983@linux-foundation.org> From: Randy Dunlap Message-ID: Date: Wed, 15 Apr 2020 08:34:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US 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: On 4/14/20 11:54 PM, Hugh Dickins wrote: > On Tue, 14 Apr 2020, Andrew Morton wrote: >> On Tue, 14 Apr 2020 07:18:01 -0700 Randy Dunlap wrote: >>> On 4/13/20 7:39 PM, Stephen Rothwell wrote: >>>> Hi all, >>>> >>>> Changes since 20200413: >>>> >>>> New tree: mhi >>>> >>>> My fixes tree contains: >>>> >>>> 6b038bdcd3d1 sh: mm: Fix build error >>>> >>>> Non-merge commits (relative to Linus' tree): 1154 >>>> 1160 files changed, 31764 insertions(+), 13498 deletions(-) >>>> >>>> --------------------------------------------------------------------= -------- >>> >>> on x86_64: >>> # CONFIG_TRANSPARENT_HUGEPAGE is not set >> >> Thanks. hm, this took a long time to be discovered. >> >>> In file included from ../include/linux/export.h:43:0, >>> from ../include/linux/linkage.h:7, >>> from ../include/linux/fs.h:5, >>> from ../mm/shmem.c:24: >>> ../mm/shmem.c: In function =E2=80=98shmem_undo_range=E2=80=99: > ... >>> ../mm/shmem.c:961:26: note: in expansion of macro =E2=80=98HPAGE_PMD_= NR=E2=80=99 >>> round_up(start, HPAGE_PMD_NR)) >>> ^~~~~~~~~~~~ >> >> That's >> if (index < >> round_up(start, HPAGE_PMD_NR)) >> start =3D index + 1; >> >> from Hugh's 71725ed10c40696 ("mm: huge tmpfs: try to split_huge_page() >> when punching hole"). >=20 > Sorry about that. Yes, odd that it should only hit now: the false > PageTransCompound in shmem_punch_compound() has always been good > enough to handle it for me, but maybe Randy is trying a less able > compiler, or maybe unrelated changes in linux-next have just made > it harder for the compiler to see the optimization. >=20 > I hope the patch below fixes it? >=20 > [PATCH] mm/shmem: fix build without THP >=20 > Some optimizers don't notice that shmem_punch_compound() is always true > (PageTransCompound() being false) without CONFIG_TRANSPARENT_HUGEPAGE=3D= y: > use IS_ENABLED to help them to avoid the BUILD_BUG inside HPAGE_PMD_NR. >=20 > Fixes: 71725ed10c40 ("mm: huge tmpfs: try to split_huge_page() when pun= ching hole") > Reported-by: Randy Dunlap > Signed-off-by: Hugh Dickins Works for me, using gcc 7.5.0. Acked-by: Randy Dunlap # build-tested Thanks. > --- >=20 > mm/shmem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > --- 5.7-rc1/mm/shmem.c 2020-04-11 12:58:26.415524805 -0700 > +++ linux/mm/shmem.c 2020-04-14 23:20:25.517656174 -0700 > @@ -952,7 +952,7 @@ static void shmem_undo_range(struct inod > VM_BUG_ON_PAGE(PageWriteback(page), page); > if (shmem_punch_compound(page, start, end)) > truncate_inode_page(mapping, page); > - else { > + else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) { > /* Wipe the page and don't get stuck */ > clear_highpage(page); > flush_dcache_page(page); >=20 --=20 ~Randy