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 A5202CD1292 for ; Thu, 4 Apr 2024 22:21:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 252106B008C; Thu, 4 Apr 2024 18:21:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 201C76B0093; Thu, 4 Apr 2024 18:21:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CB3E6B0099; Thu, 4 Apr 2024 18:21:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E37FC6B008C for ; Thu, 4 Apr 2024 18:21:03 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 77856160415 for ; Thu, 4 Apr 2024 22:21:03 +0000 (UTC) X-FDA: 81973270806.30.1E0A8CD Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf27.hostedemail.com (Postfix) with ESMTP id 4905D40017 for ; Thu, 4 Apr 2024 22:21:00 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=BG4fxvuA; spf=pass (imf27.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712269261; a=rsa-sha256; cv=none; b=o8BySios7HihTcw2dEzpH/tXdFcLjFgw5nJXoUfCKxiAikMg3z6pwpQDT1TJqhScKeHv7n iFnP2t8wNsVSkVH4ofhzWvPixvYos00r6KWrrgONaJ7aYvRXnE8Fjtll00bj71bY3KgWUD AC+eBzpraKn1V8NBKtR6ZEh0GRqhToA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=BG4fxvuA; spf=pass (imf27.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712269261; 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=++dzxOPcGrPRuU5QPkJJ1av5+QIVUNGTVn6eTxHtevE=; b=RHk1cDAf4n4P9i/Z/VwDKOypPSc4faqkfKq+JeTzSr1vvTKh125iOIcpDl/iHSUUwhxWub sZDlt5t1qjdEkDEaDmcA35BSE7tu2a1yV5admyHpEiw3+TePZJpwCkNu33XCAdcfdGEpUA Us4x2FYG3LDC7QMvu3ta9y99V0KL7XY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 0A44ECE3496; Thu, 4 Apr 2024 22:20:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17BBFC433C7; Thu, 4 Apr 2024 22:20:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1712269257; bh=x4zQufQrnwQJkcZWOFYuzKnnC758IPxss8keXX+/N3A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BG4fxvuAzCSlXjqBIlIRkLL7s18/JCaVK6BzwaosCwcgIUVXRtEaqvbPc18u824Zr KzDtEzJ7r+TXpIKP4GB92aQ3cxJGrnxzGQrlMKhB7mWhB1muvb1kLu68R1l0X2No5u SQJis2uIY/kcEgknLU+0M9Lz1hoVV5sO2d9m15LU= Date: Thu, 4 Apr 2024 15:20:56 -0700 From: Andrew Morton To: Frank van der Linden Cc: Roman Gushchin , David Hildenbrand , linux-mm@kvack.org, muchun.song@linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm/hugetlb: pass correct order_per_bit to cma_declare_contiguous_nid Message-Id: <20240404152056.2bbf0313d934edb09d9a9f29@linux-foundation.org> In-Reply-To: References: <20240404162515.527802-1-fvdl@google.com> <20240404162515.527802-2-fvdl@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 4905D40017 X-Stat-Signature: uwtz4wtf3ecft5p86d6sjhfjo9ppnuyq X-Rspam-User: X-HE-Tag: 1712269260-687569 X-HE-Meta: U2FsdGVkX1/9iMsN5NjpaMthk/3jXF/crYsIo9tlkzRURYY49Sp5ts/u51WFjDWeBt7HyEN51f9RvtKSNrzHX8ZYSi7p6PGBoKMJMfSxA2bQ9fVaKcT1wuG5HGQ2Tul11cKbfr97akHisJTOJo0R3NXupNKUJ3E5BFRUiW0fd7VZQ6bjA0jWIQaGrFuQwdILX16WpzZEbRU0G+BplGAzoWxQBHNzzkq1tdoiyrpOzUzw2iBolkCox1UOjxBOp7WWmUAoPZSJl74pqRX9FzuOu1tVeLYq29qxiWm25kYsVQrI53SUv6hncDaR3H1/DLPIm0/H3UUAyh+OgVOa9CUn4aS8M9NOBalmlqgcPBywqSiVoEYMWyWvZ+PdnCk16KM67urZAjdZd3cku2CnMJ9/DXLKX9BhcXYb/D/SEAK6RcotYriLBiqUyxGF5vf8q13oxAvOe1FG6J0AUzpft47GZpsejFnkpi5ElyhZSZJg8bY8bKZOp/CIuidRUu/12vb0nBywbAFATZqT7N6BSFq5BYkmf0h0ubJJ95CJm8q56RW0NGN+81duXpumNKe1HyRKSqYfQrBsapi93xDiFlvX1asG2KkuIHCBijVenNWEr/tZc8oAtKKgaWJcujK6QsI1iXa+Z9POs/rpkHeM5tkwBRvcOJxYJnMZmEa64g1XuLIp/6CBZ69ZwrTXGJ53tzNPofij5Zfbjqj0JmH8t8lpdeotVYMBdcHLuqEs+Ig3VEyaOZLe8auOq0N4Gz8nuCAdqQBWdla6oXSTbFghGTBZ4Tg0wu4dk5Pm9QEAkVNNUuDx3w+DYDOZCQq1kz2O6DWNnIS+YL4LB8tfhhu6YWYGt52uQs3Jl4LkPY87gnYeh79Ckh0UmLjIuIwPRp++6ecEONN8bmB8mv1rYhdK5CvGSjhn/ciAfwQTrTtHiTSAzdDCGaRWxYn3Jyvnv8+KNaUsp4lQtX/ktmX3yr+dN0v j3KEKG2x ysoV2XyS3zMNOUqixkAludGZBN7FcoX5KW0Mh+c+kRTc/EVsal2io0ImecHsINcuYhMkAmYrarpwdjBj9s9/5UG08ADXTHpcR6S5YfXpzshAu18hBRdcBdpLvJs9RGYAEwkcwgHdHt3IIaw9ct9qn03AOeL8YnucokmeUGS0MVzseEfUG/kyN7aRZK+G2vn8wF4XKrZJ8wCsBFGBVDvaEFKyRHU3w/jw6zULjaDdGk0scLxQAUW7KWbZ0kBoFeJ0Nig7FOvngoDpQmSHIA1I8Ii+nWi6CIL1pZpFB1v5bKIcVYt4= 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: On Thu, 4 Apr 2024 15:02:34 -0700 Frank van der Linden wrote: > Rushing is never good, of course, but see my reply to David - while > smaller hugetlb page sizes than HUGETLB_PAGE_ORDER exist, that's not > the issue in that particular code path. > > The only restriction for backports is, I think, that the two patches > need to go together. > > I have backported them to 6.6 (which was just a clean apply), and > 5.10, which doesn't have hugetlb page demotion, so it actually can > pass the full 1G as order_per_bit. That works fine if you also apply > the CMA align check fix, but would fail otherwise. OK, thanks. I added cc:stable to both patches and added this: : It would create bitmaps that would be pretty big. E.g. for a 4k page : size on x86, hugetlb_cma=64G would mean a bitmap size of (64G / 4k) / 8 : == 2M. With HUGETLB_PAGE_ORDER as order_per_bit, as intended, this : would be (64G / 2M) / 8 == 4k. So, that's quite a difference. : : Also, this restricted the hugetlb_cma area to ((PAGE_SIZE << : MAX_PAGE_ORDER) * 8) * PAGE_SIZE (e.g. 128G on x86) , since : bitmap_alloc uses normal page allocation, and is thus restricted by : MAX_PAGE_ORDER. Specifying anything about that would fail the CMA : initialization. to the [2/2] changelog. For extra test & review I'll leave them in mm-[un]stable so they go into mainline for 6.10-rc1 which will then trigger the backporting process. This can of course all be altered...