Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp344952lqp; Thu, 4 Apr 2024 15:21:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXM4BhOwNBgmW0P6fUgOE1Whb9vCpxwOHQmDV546Vjs8ls4DP7qeafK++3VOj1bNAWuvIeCvKMixq5ZZkmuOZhpb5O/WMsmomLB5/D+YA== X-Google-Smtp-Source: AGHT+IGS/exWzthAYGhJJIxFxnn0ZVjce4mu0Y0knA2Q7Xa5U9brK2FCtCEJftOduDRHQbNyVtnG X-Received: by 2002:a17:907:7b82:b0:a46:da57:6ee4 with SMTP id ne2-20020a1709077b8200b00a46da576ee4mr715756ejc.73.1712269306995; Thu, 04 Apr 2024 15:21:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712269306; cv=pass; d=google.com; s=arc-20160816; b=GnV4NtE78/GqCN4q8GjyUGQFbZARUKTACmTgCIOlf5SwmhGxuocYGfmjyja5UtrmIy mcrdQrdf2FoIaNXkJzzp++znFrbPe8LKnhKNLP5q3NhMJm0WZO/ObcKVkaVu8EFs7d/v Hml2nEtuRDEdhWqefVY5+2v4H70NhsGTEIHHZP9aOgR1u3fa21qmMl5ZxTmfUt98quKF aRj0aShkU7cGWTksr+PwXjJm8z9zRLPxlTsh3jbeDn4zi6PnTfoaYhRUFqcz+BVER/EZ pGueaBwSuUM7A3nuyu6wOFHVa8ZadK5FTOURqL7cfId7FK+P0PF4BDyGWIBgRNUnFtBv 0Nqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=++dzxOPcGrPRuU5QPkJJ1av5+QIVUNGTVn6eTxHtevE=; fh=VDGAkfatl3/BGxWomcztYN61f0F5K02f1RyD/KJyHKk=; b=svU6UuMmwLqrUOh/oj5CgoDe3L90B/kZ9ycRUHmudjC5TSmrd0/8DPSessoVa6HISS hh63LqDs0KNWP5AtDFo1aSyrxIii8yPOKOAFmRIX2zhNVZcguNK1Ya7WgN+KrqMMaZgs D2YRpK6T5UhHHI9Qa29H5IeHf24Xi2f/cA6HhjvOYJBaqZk21P3QgNShyT8SLU3AzoFx G+Jki/+ksQI9X3uIhiyM6OccaOb9+JWDhlz9nIpJ3amxtwQF2gzGx4RK4PN6QpV5nDU3 iBdlP7wgePg3Lc+KQ8ZpofVZkKQsXYLh08saMzyeB7y/DX1SbcoCip+BqsI5SQa/4iT8 hdIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=BG4fxvuA; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-132200-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132200-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u22-20020a1709063b9600b00a4e531ad383si67128ejf.466.2024.04.04.15.21.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 15:21:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132200-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=BG4fxvuA; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-132200-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132200-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id ACA4A1F2289E for ; Thu, 4 Apr 2024 22:21:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ABA7113C661; Thu, 4 Apr 2024 22:20:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="BG4fxvuA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4D5713C3EF for ; Thu, 4 Apr 2024 22:20:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712269257; cv=none; b=cYhH/cPZEDS3Tz3/aMg62gR0zy++te4EjOVmr9emFBWqd9fVwZnuxrDN89mF3nZfZLoiGX41p/5D0GhMYs/Q11Rb/gjoAjsXq7oHDqaBvFYziOzG2hdAUlAiQZvJvr+VFxdIwhCeMv8KZYKmYVYyHeCZ8dXsnbEfLqtQ3U0vv7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712269257; c=relaxed/simple; bh=x4zQufQrnwQJkcZWOFYuzKnnC758IPxss8keXX+/N3A=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=H8lXeNzbnWqgRKP/bHImcrFCkd/nbvRbJYm6jBXpL05GMr56hLsR7cW9WEACx+CLtszok9xMgxGwrS68Khg5yWPPNjY3SULY6d8ssjcmEHJpTHuxX2WkYtMiL/FIQYna9bNuvIr+E4y8Xr7QGD7ai/s7/cuEh0cObNKbiaiKNj4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=BG4fxvuA; arc=none smtp.client-ip=10.30.226.201 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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...