From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.224.134 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796525448; b=1GpwE6frEIdXZ9oL4TGSWwXHVb6cpSRLbFSYcSFuHG27V52tkp42mvm+p22+s0Fkd8TD AVgV+jopZhlhPOfLnakaOxsdrkWDEIVp7aty0I7OaX9wcg5BqTLTHFzAetELEZxeuDXyZ BF5VlS1DWAbw3Pt76A9ufpP783ul/eERZo5pREaFyVA+mE2bHEzn5VtWT0aN3YsipXoTD Ygxl1jTRyOOWGoYqKukMhMQ+xIX9Xbh45RYD865RWvw5mkEpYU9tt0aGXwXlxRmProb5b tXkjokDVunM8dzPK01SVfaXFdMXqpi1VjS8uet/3ZOgQEv8Xud5DZJkxEB1EBlkD4Ig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796525448; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type:Content-Disposition:User-Agent; bh=+CsMCAJoXu6hvRRx83n23/G/ITqANFS+hz/YgNGOiMQ=; b=14sUvaicXZxtceZWxwg6cOr3oQHoygR3CKY5jh/nKrPWgKkWSeCvCkyT7ceVSSDK61JD cImyszXbVICJi1ceZ70SHUFVMdF+PpTmxyVzpAeiACQ5X/M3qZdoD58ULFCwACCZyx5E6 +dLPYi/1ElAtqbyh/LFTODweK7cgAe9jyd4cOZ84kr/GfBnG2qsUSbkcCyRO4MzT+A7Ey HNiAGxjHRPsXgHjJt3JVf7YAn/4GbWIrUcZSLeg1EVAQWXnG3Su+DoFKgANqmFBDFE4at VVzjW/HBMNPFCB1l9UHy7U5Khw31jX2YV9NpuISv9/ytHZc7HleJ8PByhdf8VJa7fNg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chrisdown.name; spf=pass smtp.mailfrom=chrisdown.name; dkim=pass header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=dRg+IPdt; arc=none smtp.remote-ip=74.125.224.134 Received: from mail-yx2-f6.google.com (mail-yx2-f6.google.com [74.125.224.134]) (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 D4B08606A31F for ; Sun, 6 Dec 2026 02:50:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D4B08606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=dRg+IPdt Received: by mail-yx2-f6.google.com with SMTP id 00721157ae682-8b4d0c15898so3002327b3.0 for ; Sat, 05 Dec 2026 18:50:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1796525447; x=1797130247; darn=vger.kernel.org; h=user-agent:content-disposition:content-type:mime-version:message-id :references:in-reply-to:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=+CsMCAJoXu6hvRRx83n23/G/ITqANFS+hz/YgNGOiMQ=; b=dRg+IPdtzIAXPM+B1w+NhCYHy5o0CdzIYVqCRJHQb4AmZvzoiwkPrWREnQevdNmCL4 SxplXLyB7KHAm/jwFf0vFvgpxPEinPtrqPOczBwzWFyc/wubTXfHFg2UPipuybamA3Nb lp4uB3He8QFgnPjn4T4u10C4yroFBTqChTtDw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796525447; x=1797130247; h=user-agent:content-disposition:content-type:mime-version:message-id :references:in-reply-to:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=+CsMCAJoXu6hvRRx83n23/G/ITqANFS+hz/YgNGOiMQ=; b=kQwC8X21WX6M3a6gpXjUco9fzo+IPhb9d5IsZZeDUkczLx9/y4C6urcloRU1wHQA1U FEeoFmkqYagAtPk0Bnxl/19Pc3B7ROiE9DrM+0C7R7h1HwWaJ5NJpk5u9B2g1QOHn23J /Xyf9mEU82EvazCqdV2/56I3Gwk0io/rl4oiPoxR5ElsRqSYniNZarC/83Db+OLYSC12 Vht1t7T0FztdI3x+WCtwcUDmkE4HoNws9w6OJ7fOc89tTBUvm/Ln6Pe8HwH6La+7mQoq Ee1/i5f73BECnb0h6xtfYk378mzCMWQwb8GAuqKg0f4Unn6+7QTI3UBIrU97VF84wSBX ckgg== X-Forwarded-Encrypted: i=1; AL+hErG/vHX8oOhvBrHOgCTKSSkGxTzxNl8XvPHiixyvSX2QWU6bfgNMmEDhXVyVSsF/G61PCGGAhBL1lFzm0xk=@vger.kernel.org X-Gm-Message-State: AB4q+uGIhg4rSfYUIfwQXfXoFlmLgX8SAAij78UwjxsOkTAyuLVLrY06 eXf+Q3Q8VSnbg3p5eLrNte3KhY4qNwbZvOAkz6DKP6BV+UAbpLFb1uIv1wWUI6R5x3e3NfUJrQU wfFb0uuvMbIMelB3rfXDi X-Gm-Gg: AZFdTZc8OPVCobl+tRMA9pssHl+eOg/47NlZ91kzYt+zu5iHpKT4bRI8LE1lLy6peCM qWju/4Giq2IB5xrPL1A5Udsz5iOhzjTUmcCQwx1gyUdIPbc5tkQxg9KnBUN9rx+jeu4cYqQR+WI taPWHAS8TRrj0rDkSIQOWF4tU94+97t94EgUx6wnERol9pGvIKIBE4xkH7yUZDbaXblgw5Z92bn 8UGsZBBpTCfEr4YwTgyOo5M+hU5wY8ifXQYTq5hbaezBMRLN/Q3BiLCFiQxtamSfgsaWiuOD0c7 cC5ulE/wMVZROz0YGan0YIidUVhd/xQMxbf+PCuUO6cLAdfV+mOgGFjWf9KHyyKy0p4+kJIuFZ/ aLda90crvBH7/s2ZgjBGmPsNXEzoMbacq9hd/qKbtPXZ2CPDTJHK6tuIC/nS+KZp7gUqwwjqAu4 KhUhVpHZlFMK2HlpS05VFTRxPRlDeikVHKGXO8yjLzEnoEAbvIth50dthQgkDJb/wo6B0Iy/qDz GWFk56NTPbycSIbDuXy+52MXaagDBKqOaBlkK0mrBIsBTcPCrg4vdi/fpI8zC60VwB2+rl8LaqW dAEBcEXkEDv+7zdvTYDYGrYGxbc2J02tfz/zsm89AhhPRCfr5G0eiugi0iav17wSVS29EVcE67y yp6PyuzMKFFDgXYHFg39SoGxLzjOBCvxuWZAAHi7WNhntcZWNsPrkp83C0NnGw6IaOOb2ZDuQQz DS3JDk7k3kY1DDNTPWdIQiwDjJmh+OcH9Pd5aifhsU2XDrFTcgroJBWrv2E6wUgVihnlbAtOTko V29c6h5iU8BskTN8VH0JdUm+f0TRuC/Kj3LmDiczImA X-Received: by 2002:a05:690c:3501:b0:8b4:ce75:d141 with SMTP id 00721157ae682-8b660da140fmr24118987b3.57.1796525446770; Sat, 05 Dec 2026 18:50:46 -0800 (PST) Received: from [172.18.0.2] (c-73-207-185-9.hsd1.ga.comcast.net. [73.207.185.9]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8b658c45ff8sm28177227b3.0.2026.12.05.18.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 18:50:45 -0800 (PST) Date: Sat, 05 Dec 2026 18:50:43 -0800 From: Chris Down To: Zhu Yanjun Cc: Samiullah Khawaja , Pratyush Yadav , Tarun Sahu , Pasha Tatashin , Mike Rapoport , Alexander Graf , "Andersen, Tycho" , Anthony Yznaga , Baolu Lu , David Hildenbrand , David Matlack , "Heyne, Maximillian" , James Gowans , Jason Gunthorpe , Pankaj Gupta , Praveen Kumar , Sagi Shahar , Vipin Sharma , Vishal Annapurve , "Woodhouse, David" , Luca Boccassi , Jork Loeser , Chenghao Duan , Sourabh Jain , linux-mm@kvack.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: KHO bootmem without pre-reservation In-Reply-To: <8015da3a-3f7e-4945-a26b-240df4a960e4@linux.dev> References: <20261124205808.4097419-1-pasha.tatashin@soleen.com> <8015da3a-3f7e-4945-a26b-240df4a960e4@linux.dev> Message-ID: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/2.4.3 (cc9e3943) (2026-10-09) Hi Yanjun, Zhu Yanjun writes: >Is the main concern that a large KHO bootmem reservation reduces the >amount of memory available for unmovable allocations, potentially >causing allocation failures or memory pressure during normal host operation? > >Or are there other concerns, such as memory fragmentation, NUMA >constraints, or the overall memory footprint? It's the former. And the hosts are relatively uninteresting, they have one NUMA node and no real fragmentation to speak of. In July we rolled out a 7.1-based kernel with KHO on by default. On 64GiB hosts booted with hugetlb_cma=6G, reserved memory went from about 1.4GiB to about 30.7GiB, so close to half of the host could only take movable allocations. Page allocation failure warnings went up several times over, so as you can imagine we turned it off again quite swiftly. I looked at a few and found a mix of symptoms. Some have memory stranded in CMA. Some others are plain exhaustion on hosts deep in swap, which doesn't prove that KHO alone caused it, but it's significantly elevated on KHO-enabled hosts. So I can't yet say how much was memory stuck free in CMA and how much was lost capacity, but it's certainly KHO-adjacent. >I'm trying to understand whether the issue is primarily the amount of >physically reserved memory, or rather the restrictions on how that >memory can be used by the running kernel. Both really, since the restriction hurts in proportion to the size. __rmqueue() only prefers CMA for movable allocations when more than half of the zone's free memory is CMA, and nothing moves them into CMA later, so unmovable allocations can fail with CMA still free. That's what Tarun's RFC [0] is about. As for the size, we previously counted reservations more than once, which Mike's fixes (thanks!) address. CMA areas are counted too, though, so even with Mike's fixes hugetlb_cma=1G ends up taking bootmem from 516MiB to 2564MiB on an 8GiB host. I'll post an RFC soon to leave hugetlb_cma out of the sizing. In my tests that semes to significantly improve things. Thanks, Chris [0]: https://lore.kernel.org/r/9huzfqwent4i.fsf@tarunix.c.googlers.com