From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381489; b=gXP9fkn3/jhkIyafKxHxi5fll1PIbDTek5sN1mvmiWa3ZmeVSwA3+ZInT0FysZXOwLhu UK6trIOKUdajBJL2Ox2m7SICLBBZl6KYJ5sQhtUdyC3Ad8YdW3iOwbPufaOdDCcKWGW3U 118uWE5kjF9tFNFT3709J/JUFt+e1+f6XdPjQ/G6kf59sGuouB7LaXwbo1pA/Uw7LthiO pi5rygcLYSPvUn7c5Qa6OctBOXyjyqZCf8S+ifyJlN4eH3RXZSr99/2siFPMCunZ8hrWU 2EbwifDAzOu5g7SnJnhGoApxq/feZJToXQKNvcyNmSHJrSlHyQBf6YLHuEuWvlfVnRg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381489; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=cDCFZdvR8IyNqzDuJPcHMc7z4+5W4azgoLKZaqtbexY=; b=c7od6VCM84CR6C+HfzrtEDIc5o20n627VU8eld5kyN56/7HOW7ENBSwOYLZrMxnP5A9x flTl791nHjm0m5AKKh3cNhR6hATk7tJRBjiBdIdM/ILWpn9ZRt5XsSWaHjlc+JzXesgaO bjX7D2xpLtWUntYbOd+KOB5MM7PtKK7mVs+teHNeo0FQBDA8Iwdn5NYHMAuRYGESAVNw5 3mp4S1ryAPPYKNZ9jKRbICMWrBMmxm6Pt13vgvHILB6yVD8q488pRdjrlJwIOQxD717qH nn19riBZ3GU3neqfsSbC5GX1S/+fwljF1wB2DAdUAwt6wZk5xCVyJRlh5UUOV5FYdfA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rLy4SNj4; arc=none smtp.remote-ip=209.85.221.50 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6637606A687 for ; Fri, 4 Dec 2026 10:51:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C6637606A687 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rLy4SNj4 Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-4a358881793so350875f8f.0 for ; Fri, 04 Dec 2026 02:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796381487; x=1796986287; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cDCFZdvR8IyNqzDuJPcHMc7z4+5W4azgoLKZaqtbexY=; b=rLy4SNj4vQsAUeWGIE9WYsZDUcX41m4LskgOiFZyotpzTLaNQeXs6pwCUX/BMaxK7/ d7swm++HssT5qEIPy9sZIA/Nr+c/V7imqe7JYCk/TmzX8spNlok7JjTYr4MqSADR566Y +/lDIEdaGd/9WpsnraOAdBVg1fNVVwT1j2d3h79A5OGYjXyl8SXuNfc0ApgDRBs6TL8e bqOolNSI2jg3L4unUmKwq5gtU10uglS44nbJLd8MulvEXQrU5DDNdaUrVoLaWVyq0ua3 2LHx1hfpf4XXdmmA5MOy670SH1v8qiBu8Ch0nB65WxqKcdnzwOM+5XgH6SoAmLwTSb0b Y02A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796381487; x=1796986287; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=cDCFZdvR8IyNqzDuJPcHMc7z4+5W4azgoLKZaqtbexY=; b=BvlzHPs91VhX38LCm+2y4CYtOU3rTtchldpnAUHX2WrIIQZ5fGvl58F3LwxbXDzO+v eo12tdgpp7ei8PTYKfVrWxWNTmDSW5674/UwY0zzhthjPuvCgQHjRucdVzd1+N4Wwyg/ FJcWmOBC6a4zIStKRNYzZjD/kxXyU/WDz83qozUqsIh41YqMAVBWPiiINP4C6g2rLIu4 aQ+ipb2V6s6cLn1uB6ri/m6LbInebVv39s68fjIIfgJ/UMXblvOmi2L7M0EPoWGrkCad 9DivRM9dexw3+Vf52C5TVMYMSOe8xgLTVa4i0r5bvVBbX9SxXKjCme8OPVwLYpOOrIHA nrdw== X-Forwarded-Encrypted: i=1; AL+hErGf8qfAX/oBVCJj4YkSUOMtOoRVn/OfqEu8rk0uwKhUNQnBiMGm45IfFXNW4d4bKdepQX/E5xkdTV6itfoe@vger.kernel.org X-Gm-Message-State: APuU4Z+nKtvNCBcx6Vy+t5CTCFxF4iwyvLadSZBDKuA3jz60TMRx+t8i 71YbP2zFi5FmIaNcl+6VL8Q6grolN0t2QFBzDeDAjPYpGCxPY7l8HEaZ X-Gm-Gg: AZFdTZcKmC/yJcdqhn/l6qHTI5/E0S7LtdGAUX/STw0QE4ftSykprt4Ud3aImN3kbRS u8q67X/o0W/mLVR6s2mOJ7zdPaogYZNLB+9WB/MDXbUNoD3sqkqt8cyN2Vmw+R8YVlqA5t4Em62 ElxH9zYb4z9dKELAaDfMQjtmQaBMxwvM+gMr9yRZyXKGhiSZK9tUrB+HtAVP6Maa7tiJ3JUT4XS GybhhMOJgzwc438WYcmqAuOZ/du7ETIe+1nT11reb35hodIBLe/eBCfwGnEmSikYErcYdBX5wtJ iLgD3wCPdR0unmknvb78saKkfCyCBRdGoKo0n+K4JAnsJq0xIR4PRxiSCGCSYp2B14Ee3Zy26t/ QkiSAZWAO69mYJsqTaKLnUoyMthll7Ajtv4Ba5c+jlAYUN5/8S6/WpaR+W4gxcpVDpuUUB0kHuT 69E+mjNpGHBcegQLFnlbRPrcdVWrg+iV3pG8qrJm8z3QZh6sHq7c6v2lIAfS9jqhLe47Mw9G8/k 5T6HXDSKkliEB7ynm6FTVRN7xUbWD1lLg3icvfkSOc8Hff0ihbSmdOkb8tZ0meZHWzJT0mYTWgL xYjnG09FjjssSIIPwcDe53BWetB9cHT0yRWK/3gTRK0DYK5XCpYVBmk= X-Received: by 2002:a05:6000:2487:b0:49d:7e8c:e89c with SMTP id ffacd0b85a97d-4d1ebca0904mr3369325f8f.42.1796381484798; Fri, 04 Dec 2026 02:51:24 -0800 (PST) Received: from [192.168.1.22] ([83.231.69.9]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d172f363b8sm4959509f8f.22.2026.12.04.02.51.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 02:51:24 -0800 (PST) Message-ID: <140d3731-fe1b-4bad-ad47-90bc426494fe@gmail.com> Date: Fri, 4 Dec 2026 11:51:21 +0100 X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 11/35] mm/hugetlb_cma: reset hugetlb_cma_size if the arch doesn't support it To: "David Hildenbrand (Arm)" , Muchun Song , Oscar Salvador , Andrew Morton , Hongfu Li , Jinmeng Zhou , Mina Almasry , Davidlohr Bueso , Naoya Horiguchi , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Michal Hocko , Jonathan Corbet , Shuah Khan , Randy Dunlap , Vivek Kasireddy , Mel Gorman , Hugh Dickins , Baolin Wang , Dave Airlie , Jason Gunthorpe , Andy Whitcroft , Roman Gushchin , Barry Song , Andrea Arcangeli , Lorenzo Stoakes , Suren Baghdasaryan , Shakeel Butt , Pedro Falcato , Jann Horn , Guillaume Morin , Yang Shi , James Houghton , Rik van Riel , Harry Yoo , Lance Yang , Axel Rasmussen , Peter Xu , Sasha Levin , Kiryl Shutsemau , Christian Brauner , "Steven Rostedt (Google)" , Hongbo Li , Gregory Price , Zi Yan , Joshua Hahn , Rakie Kim , Ying Huang , Matthew Brost , Byungchul Park , Alistair Popple , Andi Kleen , David Rientjes , Joern Engel , "Aneesh Kumar K.V" Cc: linux-mm@kvack.org, linux-doc@vger.kernel.org, Gerd Hoffmann , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Johannes Weiner , Chris Mason , Jiaqi Yan , Sashiko References: <20261203-hugetlb_fixes_2-v2-0-9bbeabb555d2@kernel.org> <20261203-hugetlb_fixes_2-v2-11-9bbeabb555d2@kernel.org> Content-Language: en-US From: "Jose A. Perez de Azpillaga" In-Reply-To: <20261203-hugetlb_fixes_2-v2-11-9bbeabb555d2@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/3/26 12:37 PM, David Hildenbrand (Arm) wrote: > With hugetlb_cma=, hugetlb_cma_reserve() reserves CMA areas for gigantic > huge pages. If it ends up not reserving anything, it sets > hugetlb_cma_size to 0, as it is the signal to the rest of hugetlb that > the hugetlb CMA area exists. > > However, if the architecture does not support hugetlb CMA, > hugetlb_cma_reserve() only warns and returns, but leaves > hugetlb_cma_size as set by the command line. > > Consequently, we skip the boot-time allocation of gigantic huge pages, > which matters on architectures where gigantic huge pages are allocated at > boot, like powerpc with the hash MMU in an LPAR, where the firmware > provides 16G pages. Further, we disable demotion of small huge pages and > don't clear hugetlb_cma_only, so gigantic huge pages cannot be allocated > at all. > > This only affects architectures with gigantic huge pages but without > hugetlb CMA support, such as sparc64, sh, or powerpc with the hash MMU in > an LPAR. > > The fix is trivial, so let's just reset hugetlb_cma_size like we do on > the other paths that don't reserve anything. > > This has low urgency, as it requires passing hugetlb_cma= on one of these > architectures. No need to CC stable. > > Fixes: dbda8feadfa4 ("mm/hugetlb: avoid hardcoding while checking if cma is enabled") > Reported-by: Sashiko > Signed-off-by: David Hildenbrand (Arm) LGTM: Reviewed-by: Jose A. Perez de Azpillaga -- cheers, jose a. p-a