Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2486077iob; Fri, 6 May 2022 04:07:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdeDRvG4alDh3Nou6P/z1L+ZYz/pkuEszJScsR5kjGa22xJXqeD6clUFF4oJxJe1PzgOLo X-Received: by 2002:a17:906:e9b:b0:6f3:cfcc:922e with SMTP id p27-20020a1709060e9b00b006f3cfcc922emr2410111ejf.346.1651835235694; Fri, 06 May 2022 04:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651835235; cv=none; d=google.com; s=arc-20160816; b=Ky0QhByq67On3BfVnzwC5uYrn4M+YZGJ1Z39fTCfXNfctV/nm5TT9I7fV6Hp+N7qB1 HCC8kj8zq6/LNPMvTmRz1sxkiWpt0zpb96c3lviqYeXaN7W2G1vw//olleHsxLN3OU7b Nubor67QqH4E9iQj8JPFjlhV+N/Ms/XhhrwtouSPTmkx+FRPb3EW7cmce41zEwC79AjE muLtE/aybnJkluSf2CLN7c3WS7488OiT2pwYV9XVFjfKF2/mej/3/DwqWA6CWXwW+n+l pu8UIR6yWeumZhTcVgfV2MuJ7g3Ff1Wo0LwJJW9rZceR7KcfALDkCsHG8vnr9kLKJqEZ uoKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mujr4HJa96VPr/XH9OIxQXVtiG/Pp0+SfCt0cUw+dvU=; b=mra/3pGRppDDAliKucbNUhRfDS++ABbW9Mwy9r5lWOV17HffL0K6HER8YUG5sqgbke EE3pKyjwON7xafgLeyicyJCD0MzaeZzbcvDBaMga+itpU9bP2xiBnjCPyu309A1W4N3b qqgtSzn0Rn39BeLOuShbg64pJeNO9YmnfSp8vHUFF1o6GXsP7fOQQlzaxsnsXBTp7rRr 1vqR3VHoNjFHO9HRCME33XpPYGLMQSc4dVe336s1yVJxSeC52Jv5bBNGvy0G6HVY/001 QztM8UyLrNaA0M0U1krj3bMqtxE7UQPQlOYhtNa7umfzNC/+bGXi1Dq0LAS8sKQHmb8w Txbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q6z3UyTf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a056402511100b00425e960d175si4749455edd.350.2022.05.06.04.06.51; Fri, 06 May 2022 04:07:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q6z3UyTf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377848AbiEDULy (ORCPT + 99 others); Wed, 4 May 2022 16:11:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358149AbiEDULt (ORCPT ); Wed, 4 May 2022 16:11:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41B73220D5 for ; Wed, 4 May 2022 13:08:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E62ACB828A5 for ; Wed, 4 May 2022 20:08:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4141BC385B1; Wed, 4 May 2022 20:08:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651694889; bh=CGUidupZKZlTBIzgz45tkTfw8MnXPRqOctPSPdF1FH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q6z3UyTfDkC0XihPAQhouzs84LPDo5VJkIKLL9wAS7RfOiAy30FofvfXKz9I5Mmp7 BGVfTInSZnNjpRLyzN0TFlDMBWwY4c9sLXDYYAeBQLit32p8Yw+HYE1lMcr6cD09P2 +wUT5K992LOlny6psv6sqsvFo99x2kdBVHw9W3BpA89ahM2CWw3cWQ7bSAL8CC/Ww7 maMrMISYQT5NdfGmui/vYh1AIsYwr6lTRFG/HvsAu3GUJZpTdFy46YU2Es4hR5hcXh 9bFKeYbiaGQpLepoqbDH4+Yh1DsbGOX3L8ovHCvGfHhvsMhDC8AtN41XKhXPb9na/N NWLiV1aJk/4fg== From: SeongJae Park To: akpm@linux-foundation.org, willy@infradead.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH for mm-unstable 3/3] mm/shmem: Use folio_test_transhuge() for THP check Date: Wed, 4 May 2022 20:07:58 +0000 Message-Id: <20220504200758.314478-4-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504200758.314478-1-sj@kernel.org> References: <20220504200758.314478-1-sj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 94cdf3e8c0bf ("mm/shmem: convert shmem_getpage_gfp to use a folio") on 'mm-unstable' replaces 'PageTransHuge()' with 'folio_test_large()' instead of 'folio_test_transhuge()'. This results in below build error when 'CONFIG_TRANSPARENT_HUGEPAGE' is unset. CC mm/shmem.o In file included from .../linux/include/linux/kernel.h:25, from .../linux/arch/x86/include/asm/percpu.h:27, from .../linux/arch/x86/include/asm/preempt.h:6, from .../linux/include/linux/preempt.h:78, from .../linux/include/linux/spinlock.h:55, from .../linux/include/linux/wait.h:9, from .../linux/include/linux/wait_bit.h:8, from .../linux/include/linux/fs.h:6, from .../linux/mm/shmem.c:24: .../linux/mm/shmem.c: In function ‘shmem_getpage_gfp.isra.0’: .../linux/include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_252’ declared with attribute error: BUILD_BUG failed 352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ .../linux/include/linux/math.h:15:46: note: in definition of macro ‘__round_mask’ 15 | #define __round_mask(x, y) ((__typeof__(x))((y)-1)) | ^ .../linux/mm/shmem.c:1900:12: note: in expansion of macro ‘round_down’ 1900 | hindex = round_down(index, HPAGE_PMD_NR); | ^~~~~~~~~~ .../linux/include/linux/compiler_types.h:340:2: note: in expansion of macro ‘__compiletime_assert’ 340 | __compiletime_assert(condition, msg, prefix, suffix) | ^~~~~~~~~~~~~~~~~~~~ .../linux/include/linux/compiler_types.h:352:2: note: in expansion of macro ‘_compiletime_assert’ 352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^~~~~~~~~~~~~~~~~~~ .../linux/include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^~~~~~~~~~~~~~~~~~ .../linux/include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^~~~~~~~~~~~~~~~ .../linux/include/linux/huge_mm.h:307:28: note: in expansion of macro ‘BUILD_BUG’ 307 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) | ^~~~~~~~~ .../linux/include/linux/huge_mm.h:105:26: note: in expansion of macro ‘HPAGE_PMD_SHIFT’ 105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) | ^~~~~~~~~~~~~~~ .../linux/include/linux/huge_mm.h:106:26: note: in expansion of macro ‘HPAGE_PMD_ORDER’ 106 | #define HPAGE_PMD_NR (1<: .../linux/include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_253’ declared with attribute error: BUILD_BUG failed 352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ .../linux/include/linux/compiler_types.h:333:4: note: in definition of macro ‘__compiletime_assert’ 333 | prefix ## suffix(); \ | ^~~~~~ .../linux/include/linux/compiler_types.h:352:2: note: in expansion of macro ‘_compiletime_assert’ 352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^~~~~~~~~~~~~~~~~~~ .../linux/include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^~~~~~~~~~~~~~~~~~ .../linux/include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^~~~~~~~~~~~~~~~ .../linux/include/linux/huge_mm.h:307:28: note: in expansion of macro ‘BUILD_BUG’ 307 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) | ^~~~~~~~~ .../linux/include/linux/huge_mm.h:105:26: note: in expansion of macro ‘HPAGE_PMD_SHIFT’ 105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) | ^~~~~~~~~~~~~~~ .../linux/include/linux/huge_mm.h:106:26: note: in expansion of macro ‘HPAGE_PMD_ORDER’ 106 | #define HPAGE_PMD_NR (1< --- mm/shmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 3dc34a5a7923..c51d3532c962 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1888,7 +1888,7 @@ static int shmem_getpage_gfp(struct inode *inode, pgoff_t index, goto unlock; } - if (folio_test_large(folio)) + if (folio_test_transhuge(folio)) hindex = round_down(index, HPAGE_PMD_NR); else hindex = index; @@ -1910,7 +1910,7 @@ static int shmem_getpage_gfp(struct inode *inode, pgoff_t index, spin_unlock_irq(&info->lock); alloced = true; - if (folio_test_large(folio) && + if (folio_test_transhuge(folio) && DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE) < hindex + HPAGE_PMD_NR - 1) { /* @@ -1973,7 +1973,7 @@ static int shmem_getpage_gfp(struct inode *inode, pgoff_t index, unacct: shmem_inode_unacct_blocks(inode, folio_nr_pages(folio)); - if (folio_test_large(folio)) { + if (folio_test_transhuge(folio)) { folio_unlock(folio); folio_put(folio); goto alloc_nohuge; -- 2.25.1