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 BB931C25B10 for ; Tue, 7 May 2024 01:47:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE7D86B007B; Mon, 6 May 2024 21:47:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D97B76B0082; Mon, 6 May 2024 21:47:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C866B6B0083; Mon, 6 May 2024 21:47:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A785F6B007B for ; Mon, 6 May 2024 21:47:22 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 40EEE80C89 for ; Tue, 7 May 2024 01:47:22 +0000 (UTC) X-FDA: 82089912324.22.3403A70 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) by imf02.hostedemail.com (Postfix) with ESMTP id 1CBF180002 for ; Tue, 7 May 2024 01:47:18 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=rh7g+0H1; spf=pass (imf02.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.118 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715046440; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Dpx0yvmheJb/T/XlRkV3cxPjBuNg/KGEhlA/osbYz3g=; b=Po89JgCehk5+ncJ/l0yKxBCW5TM17uQP0h9xYou435hcE3xYd8Top7ndk/TYuyqcs1q27V 2eTPBWCFKRv4B4oYWwyiw2nCoM6vWpMCi3037o92GNxkZsAIx16pZenSH80MLUsOvNCtYW Ijk5YcSNWFQfwVey12OYhvcJTtbMGHY= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=rh7g+0H1; spf=pass (imf02.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.118 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715046440; a=rsa-sha256; cv=none; b=Oqblikkqim3+II8UyEgYSFSU8oLbkrQ7AkHVY1XfNGX8gZ3CQIPDtzR8s8XVfl2R4vAnME Yf9M4quf4Y6zMefr5no8NPsSn90HzKo8+P1DEkBqcYGgJ/lu8avHYd5mLxJEdFdiMSBURL I/lqsg0toG1hEKXK+H4OZAa4baov4T8= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1715046436; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=Dpx0yvmheJb/T/XlRkV3cxPjBuNg/KGEhlA/osbYz3g=; b=rh7g+0H1n3dr9RSZeFyh4+/NliFzB+OaGw7aGOmA0f4WkzNfT2yFvO5Zid1WQzEwsO6qo12bxGKD5mC4cfcKBRxYYUTW32GzQjnfqQC4rsoiqf9ou5WWMTZBdTXqvA5t9lOIZGad18FadkTGiwu7IWwr5iPB4EtUOwggNxbHwdk= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R851e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045075189;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0W6-HUJs_1715046433; Received: from 30.97.56.67(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W6-HUJs_1715046433) by smtp.aliyun-inc.com; Tue, 07 May 2024 09:47:14 +0800 Message-ID: Date: Tue, 7 May 2024 09:47:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/8] add mTHP support for anonymous shmem To: Lance Yang Cc: 21cnbao@gmail.com, akpm@linux-foundation.org, david@redhat.com, hughd@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ryan.roberts@arm.com, shy828301@gmail.com, wangkefeng.wang@huawei.com, willy@infradead.org, ying.huang@intel.com, ziy@nvidia.com References: <20240506105447.1171-1-ioworker0@gmail.com> From: Baolin Wang In-Reply-To: <20240506105447.1171-1-ioworker0@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 1CBF180002 X-Rspamd-Server: rspam06 X-Stat-Signature: gnfyd3h7t3anfb3mn1hp655sz1zbckkw X-HE-Tag: 1715046438-551364 X-HE-Meta: U2FsdGVkX182s4flXck3pTh/UTFezILcw+O/NVQ+OL/nF1IIs1Gh4rMieEIi1wmGUv3ScSFU5SvcrB8KcEsB3RtwLNPaEpnWvOJSsSMmbKhW9Frrgs9adP8P6J2lQ8RfYmjtM5e76SIo7byUElQwW6JjuRE/y3ieCRWi8dmV+fabkZ3Tq0S9femQDtFCEs0xLa5jP+1/HSS4uUC1wC2zdzwznle0nSAZjAGaGrDC+sVb0Wnf/zgswSvMb2jkq+O401UzPYHbwFXZ1vFarqXiHpwWPXY5xQ+5SwzIc5QjHzP2aot8zP2xib2JLfwWzAoRHJdL0PCiAggDCfjFYsJl23JzJgQaPf70Vh1u8TiaWaZirHaSUItHzF5ZVOlR3nAGwGKkSNXn03ABTVQHWP9Z/iY44nR+jDbL4ACTK1Y3fvmSLd6VyZ3LOCgk3QvEnWEgVP5JQ3AiySIatQEFsHbYgM+Z08EDWAftU4KVbRaDY9pi7nmdDPCmXj8d0UDfKi3Qr39cbZAS+Jx8/i0sXp1TJUf7DJPE8d8HelgbAaN+RTfzJ//KIkRvs5lv3oOyIBKI3HYzXgxWF/HZgBHDjbT2/p/cblLLXLrOskfj5lIW3+rl/N8OgtQ+J/zshJJgubO9QhvupqOyHnwpIDvh43WKrRzByiqlrFKA7GFxIFBL1F5AxBjaqEwmuW+uHMzXD+BonqmsDHY+u/s2nQAdNQj5g5OEKITMRNAXHRnrwiX/6DyxGG9Kx6K+DngwZ2QVetA9+151UCzrz/4hoe9OX8oO6LWo7iWkHbEHvcOM0gsQBekxlNSmlQRSpOLSmDlp9IoSHlr6ZbD88SE61BYGKRNjaUiIU3ip74RA54Bh4zh7vqWjPDS6HS49+WuSedr4bZzL2CZj61i4vRyNQRwSTd0JN8FJEjt7bYnBgOaN4QDHVBaB6sHSUp7nsn7RMqtWhfWi1YsUK3wM9lJSAuSgoMa uBsDFfix FaoZoBdV7JUta/xps3ffJtNoLAKpkYoDaW+77v2i41mPpW/0dhpfwIyfREt+afUvHytsU5e5+ELBUKU7vtBMnCDXB8UJRAK+Oeg8gANUHG0a6O1mAYhfaqIdMIi7vm36RZFHEf0j5a1TtCaX2Mlot2AxRsTTFXZWYSxTabliE+XkS4ripOJYAA9Mz4z90aqhCgoI7pHFDZJ95ZchZGsaiNSeXPg== 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: List-Subscribe: List-Unsubscribe: Hi Lance, On 2024/5/6 18:54, Lance Yang wrote: > Hey Baolin, > > I found a compilation issue that failed one[1] of my configurations > after applying this series. The error message is as follows: > > mm/shmem.c: In function ‘shmem_get_unmapped_area’: > ././include/linux/compiler_types.h:460:45: error: call to ‘__compiletime_assert_481’ declared with attribute error: BUILD_BUG failed > _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > ^ > ././include/linux/compiler_types.h:441:25: note: in definition of macro ‘__compiletime_assert’ > prefix ## suffix(); \ > ^~~~~~ > ././include/linux/compiler_types.h:460:9: note: in expansion of macro ‘_compiletime_assert’ > _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > ^~~~~~~~~~~~~~~~~~~ > ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’ > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > ^~~~~~~~~~~~~~~~~~ > ./include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’ > #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") > ^~~~~~~~~~~~~~~~ > ./include/linux/huge_mm.h:97:28: note: in expansion of macro ‘BUILD_BUG’ > #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) > ^~~~~~~~~ > ./include/linux/huge_mm.h:104:35: note: in expansion of macro ‘HPAGE_PMD_SHIFT’ > #define HPAGE_PMD_SIZE ((1UL) << HPAGE_PMD_SHIFT) > ^~~~~~~~~~~~~~~ > mm/shmem.c:2419:36: note: in expansion of macro ‘HPAGE_PMD_SIZE’ > unsigned long hpage_size = HPAGE_PMD_SIZE; > ^~~~~~~~~~~~~~~ > > It seems like we need to handle the case where CONFIG_PGTABLE_HAS_HUGE_LEAVES > is undefined. > > [1] export ARCH=arm64 && make allnoconfig && make olddefconfig && make -j$(nproc) Thanks for reporting. I can move the use of HPAGE_PMD_SIZE to after the check for CONFIG_TRANSPARENT_HUGEPAGE, which can avoid the building error: diff --git a/mm/shmem.c b/mm/shmem.c index 1af2f0aa384d..d603e36e0f4f 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2416,7 +2416,7 @@ unsigned long shmem_get_unmapped_area(struct file *file, unsigned long inflated_len; unsigned long inflated_addr; unsigned long inflated_offset; - unsigned long hpage_size = HPAGE_PMD_SIZE; + unsigned long hpage_size; if (len > TASK_SIZE) return -ENOMEM; @@ -2446,6 +2446,7 @@ unsigned long shmem_get_unmapped_area(struct file *file, if (uaddr == addr) return addr; + hpage_size = HPAGE_PMD_SIZE; if (shmem_huge != SHMEM_HUGE_FORCE) { struct super_block *sb; unsigned long __maybe_unused hpage_orders;