Message ID | 20201108141113.65450-22-songmuchun@bytedance.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=tGVy=EO=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 4AD241130 for <patchwork-linux-mm@patchwork.kernel.org>; Sun, 8 Nov 2020 14:15:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1090C208B6 for <patchwork-linux-mm@patchwork.kernel.org>; Sun, 8 Nov 2020 14:15:19 +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="dtAkgmRZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1090C208B6 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 4189F6B0071; Sun, 8 Nov 2020 09:15:18 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3C78B6B0075; Sun, 8 Nov 2020 09:15:18 -0500 (EST) 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 28F486B0078; Sun, 8 Nov 2020 09:15:18 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0172.hostedemail.com [216.40.44.172]) by kanga.kvack.org (Postfix) with ESMTP id F16446B0071 for <linux-mm@kvack.org>; Sun, 8 Nov 2020 09:15:17 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 99B00180AD801 for <linux-mm@kvack.org>; Sun, 8 Nov 2020 14:15:17 +0000 (UTC) X-FDA: 77461448274.15.bread24_13114dd272e4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 7947A1814B0C7 for <linux-mm@kvack.org>; Sun, 8 Nov 2020 14:15:17 +0000 (UTC) X-Spam-Summary: 1,0,0,dd6db6e168837f33,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:12986:13069:13161:13229:13255:13311:13357:13894:14181:14384:14394:14721:21080:21444:21451:21627:30054,0,RBL:209.85.216.68:@bytedance.com:.lbl8.mailshell.net-62.2.0.100 66.100.201.201;04yr6bfmj9r4ewonb7aq69nx33syqocd1wkop995rfndj4iny9n4ei4xtuf8gyw.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:68,LUA_SUMMARY:none X-HE-Tag: bread24_13114dd272e4 X-Filterd-Recvd-Size: 4376 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by imf33.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Sun, 8 Nov 2020 14:15:16 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id s35so942178pjd.1 for <linux-mm@kvack.org>; Sun, 08 Nov 2020 06:15:16 -0800 (PST) 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=OnGydSB89Ks+7A/rv+/g9HtnO+i1rkH3g7IQtAkMLnc=; b=dtAkgmRZvJyerFmLgvB020I8l7g2zfjdCP5+XPHwtRIVlzmSxGCms9ehfCCLZVR0al K3JEfW3a2cb5lBH7KjGzZyZrkL7hgeK/f2RD4IsS1Kj345ewDSKl0gN8nT7fWfEfkcJI u3b8lh2Q+kTTgqwf898OshwauP1wqeUPYm+BywQDdmDrksbRVO1bTpuqODZQMUA+Tbup U2492FOYkIMh79TDUAZeLqRQT+FdC0R774chbr3yXZ1IsUjGj+FrqjVTaTMu14zfZLdg F7nJH66mGkbImWLK0uFhhdIxQVUgjXdhbDJSAeXpHhZ5XHlHKi8MJEGRs4dxh8HBN5S5 Qoog== 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=OnGydSB89Ks+7A/rv+/g9HtnO+i1rkH3g7IQtAkMLnc=; b=rSNRGf2s5cE9Ne83iJMhpTnS4+oxgIzgN/pGkAOOzKAape1gDaH5/MwSdzPxLdd5Ji H4O9/UR64Zil5gAeP3aUT34VQ2sN/EhAWwAl+takNkIG/wrxKVU4EwOuXBVb3is73c7e rSH/sj1gp3sOPT7Jyinme1EiKZCF09Z91GK2v+T/fD+KByhehBP1Xulj/M/0knvmymd0 9OM5cA3z/p5OOLwV7zl+fknRi+zK3I3aGxsQehobasIrG1K2nhz+ern8ZZDZj/irAhlv zT9UgbYTnCqKSh1s5EHthjnfLDnjxj17o67kKNsWXe/bHOxUDHS8kGHkIdW8+thxzg1S hUkQ== X-Gm-Message-State: AOAM533HLAE6UaQSd7CKX/rRDNUoYFtA5jne1Q/BsSrdhmHmCiEXo51Q aqxS1GPcFN3R06FqcU4xOSB9Dw== X-Google-Smtp-Source: ABdhPJw5tONPh/PhIVeqbhhlTnTuEnWt6avZ/HRA/KkSY5X/hL2YRz93iJrM7qp1GWj08vA2LU067Q== X-Received: by 2002:a17:90a:430b:: with SMTP id q11mr8471967pjg.129.1604844916262; Sun, 08 Nov 2020 06:15:16 -0800 (PST) Received: from localhost.localdomain ([103.136.220.94]) by smtp.gmail.com with ESMTPSA id z11sm8754047pfk.52.2020.11.08.06.15.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2020 06:15:15 -0800 (PST) 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, osalvador@suse.de, mhocko@suse.com 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 v3 21/21] mm/hugetlb: Add BUILD_BUG_ON to catch invalid usage of tail struct page Date: Sun, 8 Nov 2020 22:11:13 +0800 Message-Id: <20201108141113.65450-22-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20201108141113.65450-1-songmuchun@bytedance.com> References: <20201108141113.65450-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 1dd1a9cec008..66b96705597a 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3946,6 +3946,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(+)