Message ID | 20201026145114.59424-20-songmuchun@bytedance.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=wmCO=EB=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 168666A2 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 26 Oct 2020 14:56:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C388524670 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 26 Oct 2020 14:56:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bytedance-com.20150623.gappssmtp.com header.i=@bytedance-com.20150623.gappssmtp.com header.b="woQEvtdr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C388524670 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D7E056B0081; Mon, 26 Oct 2020 10:56:14 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D53D36B0088; Mon, 26 Oct 2020 10:56:14 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C1C616B0089; Mon, 26 Oct 2020 10:56:14 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id 956C26B0081 for <linux-mm@kvack.org>; Mon, 26 Oct 2020 10:56:14 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0E8703623 for <linux-mm@kvack.org>; Mon, 26 Oct 2020 14:56:14 +0000 (UTC) X-FDA: 77414377068.10.hot50_06039e927274 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id D7F7816A0C3 for <linux-mm@kvack.org>; Mon, 26 Oct 2020 14:56:13 +0000 (UTC) X-Spam-Summary: 1,0,0,508b3b66e9b32ba7,d41d8cd98f00b204,songmuchun@bytedance.com,,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1539:1568:1711:1714:1730:1747:1777:1792:2196:2199:2393:2559:2562:3138:3139:3140:3141:3142:3866:3867:4321:4385:5007:6261:6642:6653:6737:6738:8784:10004:11026:11473:11658:11914:12043:12048:12297:12438:12517:12519:12555:12895:13069:13161:13229:13255:13311:13357:13894:14181:14384:14394:14721:21080:21444:21451:21627:30054,0,RBL:209.85.215.196:@bytedance.com:.lbl8.mailshell.net-66.100.201.201 62.2.0.100;04ygcrts35k144i3m6beansnhwpmaycd1wkop995rfndj4iny9n4ei4xtuf8gyw.5ag3pmdrsbm9gs5p8sos1qg1mw911nxob458fddhrt49ey439noix4wkkhdge86.s-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: hot50_06039e927274 X-Filterd-Recvd-Size: 4341 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by imf34.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Mon, 26 Oct 2020 14:56:13 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id t14so6219406pgg.1 for <linux-mm@kvack.org>; Mon, 26 Oct 2020 07:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y9ZdVN328O2uwwSHT+BoNnojVOi64nld5Tda2i3ROBA=; b=woQEvtdrgcTt5KtaGjhWCUPSi5xXh9iNMRclvDRN/w23XTX07a197EfeoZ6etseu0z HXL0T0o7N85P/lN88MJhzuImQQEUAV19uolyMnF24miX1HhhOwQN4x1OSwzwcABZippj sx5kYtTF7ynotAqfdIaeuIul+5NLTLcNH+hJZ5Zl0QrxrDp9QpufqvYhP/XCDhvx+qKW ldXpXuvCHSoxZ3uCWj2AU9BS2PV3x4vWCWEVTSbazHORQVQBMXia8+x+c6Ixdb4bsFrp 4qa3zzyXPfaUUWH9vKMn/vx/Isj4VcNou4jTwTkZy6REvM7nlsw0BxOwKxHDX80gUb6M AqHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y9ZdVN328O2uwwSHT+BoNnojVOi64nld5Tda2i3ROBA=; b=aBIJL3KLwkDnkoX/qxnf3dxtikNCdoRAAEwHR4yqui8ftMexhiQzsT/JQxrGJOgdzh i+Ag42RN4Ymz1VcnEUAtJ+29l4cme57d6FCPUMCvXqW0wNjffr9wmxTS8Ua4kfXw+ymG 3nmftB6HE653CrGuLlAIPyYN4ACriJqpjnN4AC9T0eg0BDkb5DwA1Yn75kyrfhHFqVqU QNCiAiwu6WixPfB25/YWxbh/42B6nwm2/mvP+n/085SmcPhClUCvUfcdToKkBMGXRWZ4 Qb3W/ONdX3gRZxy6uQ0bvYXW87QN9xceNPFycY+fFbcNZJaLss3CehRhn7RtkIC1FbAZ 2CJg== X-Gm-Message-State: AOAM532c0mOlfL2vI/FzLggWwHNjHqwzUYGerFnX0MQ5yn72kFhSHoAw BD3y3LMZkx3qzojOUE6k/A/L6Q== X-Google-Smtp-Source: ABdhPJybtxEw8eg2MrMPnbUEKzS1LAsNT2c0RtK4JcGJiJczRjV0Xm8NBFRBQb7sIRhVCjvqm2TQ+w== X-Received: by 2002:a65:67d0:: with SMTP id b16mr17133830pgs.335.1603724172489; Mon, 26 Oct 2020 07:56:12 -0700 (PDT) Received: from localhost.localdomain ([103.136.220.89]) by smtp.gmail.com with ESMTPSA id x123sm12042726pfb.212.2020.10.26.07.56.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Oct 2020 07:56:11 -0700 (PDT) From: Muchun Song <songmuchun@bytedance.com> To: corbet@lwn.net, mike.kravetz@oracle.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, rdunlap@infradead.org, oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, almasrymina@google.com, rientjes@google.com, willy@infradead.org Cc: duanxiongchun@bytedance.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Muchun Song <songmuchun@bytedance.com> Subject: [PATCH v2 19/19] mm/hugetlb: Add BUILD_BUG_ON to catch invalid usage of tail struct page Date: Mon, 26 Oct 2020 22:51:14 +0800 Message-Id: <20201026145114.59424-20-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20201026145114.59424-1-songmuchun@bytedance.com> References: <20201026145114.59424-1-songmuchun@bytedance.com> MIME-Version: 1.0 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: <linux-mm.kvack.org> |
Series |
Free some vmemmap pages of hugetlb page
|
expand
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 029b00ed52ed..b196373a2a39 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3955,6 +3955,8 @@ static int __init hugetlb_init(void) #ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP BUILD_BUG_ON_NOT_POWER_OF_2(sizeof(struct page)); + BUILD_BUG_ON(NR_USED_SUBPAGE >= + RESERVE_VMEMMAP_SIZE / sizeof(struct page)); #endif if (!hugepages_supported()) {
There are only `RESERVE_VMEMMAP_SIZE / sizeof(struct page)` struct pages can be used when CONFIG_HUGETLB_PAGE_FREE_VMEMMAP, so add a BUILD_BUG_ON to catch this invalid usage of tail struct page. Signed-off-by: Muchun Song <songmuchun@bytedance.com> --- mm/hugetlb.c | 2 ++ 1 file changed, 2 insertions(+)