From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8D44305E28 for ; Thu, 27 Nov 2025 21:05:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764277505; cv=none; b=gcy+eabKHlWCrs/ciV6zeRG3A2offq3hARXAaAWGQO6AUVwcA2nxwnPSKB39ou+GvIizvMS7KFoyLMGunYcofzJby7v50bMBDybQTXFq266/bpiPjs649Bb2qNTPCav3cVGECN+5wORQh4OA5jhb+UXeLM+d2hvqq5ZvamtpPKs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764277505; c=relaxed/simple; bh=T5q3euDjz88zRc/lCF3AoTAKBTDshGtl7hdN48+nAAI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JqjsY1HbO9puEb0YL2TYbkFarKlzNDkkv8hUiLYCSl+oCMAzwaj0KBZgqN++yU+Vp0+ZaydtJChMczJQ8La6jR03b6XMMqiDTrU31jj+dGPvUIeV0onMI5wxV1o8BLcnA5xWqpwz7l1oB8EJxOkyx89scnpXeG9qu3tjgEb03MM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AaAImZgq; arc=none smtp.client-ip=209.85.128.49 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.b="AaAImZgq" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-47774d3536dso10006955e9.0 for ; Thu, 27 Nov 2025 13:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764277500; x=1764882300; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RBBvxgyZWifINMkz9fV/+cWWMFnJEc+vKoCkegTc0aA=; b=AaAImZgqOnQ3D3ckcrzAiyDH3PLv1ygzzfdeQAJWlxfK49t/hTxZEp64vRB9GKGZZG NeiPltHweJiR59Oczzvo92Us8DWujz6iLvGWNJCNAb/OxVFFEP4VgfXkWW+XwGl7Fbtj uRsBIFOqhrn5QyFORQevuZVXFbVACh6zaKF6wrl18RZvrVRcDaf95Jh6cWQUygk4rH0c EJ5RHHFsambLBoSCXs/DqBUGPbFn0gYlRUKvFojTNKyO2bT62IyCeLJW8BFoeXdJswKH uLvFvdMu+gRgrWYzCZ6VqqS+rnehDdxgZJKuEZVvE/CHODFm6y04Tyst/e7eZzJDLbs9 L7AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764277500; x=1764882300; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RBBvxgyZWifINMkz9fV/+cWWMFnJEc+vKoCkegTc0aA=; b=DsV2+j+2DS9Il+ivDCSZfbf0Oe4Xc16j29WICpCAi8bvN9orDXQ/r6m1L/WLK15DBz C8iP2yhpzI7ugi2ISk4hSgLQjSkgzj6V2XzHFWvAtlgcP18VcUWGOtz6i+JAryPNnEiS UcI5LNwtCXMrPyxlRpFZ1F3FuRWJfgszgzEQzW/oZuvwK9U5pmttDhuipNtpCFaLyY7L tGVJtOImLhYefqSVoFJ4BY1BpMR8InP1AWVDVA2rlwZG1G1+0ZTaj1Gg2d+lrI6OTWX+ pnEjznYqIxKR+Wu4ILGgbpuscfA1KvA3wUgL7+KOtuh0TY8pbnaB587Jtw+DB9vrgfuL J1ug== X-Forwarded-Encrypted: i=1; AJvYcCXxRZfmRNaie5GslNX6JIVURdSoo2O4IVi3wm6cwBfdIOCFKMlW3TWdrjjNewFmDnmeAFtlimqYIamhrpc=@vger.kernel.org X-Gm-Message-State: AOJu0YyKYQ03UZ213APOZXqSG66jITo7tvWaKmrdLFAXp39ukDPud+qG /CACqYvGMDXpudSGcAnuIeP1Zhy24loOVjiUJAkNu0ysGCWpfiR3bItw X-Gm-Gg: ASbGncuwyqErJzRiOxBuRkjUzSoHr4TAxhpxt3+ROjAah4WRwyp921+m2zeyyiDHkgH +ZxZbYSAbo3Qci4PjESSlR14GND41De2cLNoWKX7v9mqsBKiZHmh79/+Gej8SqVpX6nqCYASecX 3m2oPXfYaHQav9sVEb4LjSQJyoxZFr/KbLVKmWl20Dn6Sm3SpAAOZAWNHdNbCMz0M5Pwd+YiuNg 3jpDQCZYYDN23x0//j8rytF7YLk5dElyVXihEfCbRaUnU3upz6EMRJ6S92eqcNp8cRxXsd2X/TA oheb3ovJ3UHsf7+fZClS6LJVexMjLdsmLlvI9YNTz3N3b6fOWFtGg2Pwv3pJSa4U52HHsvU0QgB 8veLV+v/GZWowDLQyvrs13YskKwx7iWu0rHDN2kBVBlsfMcJ4mfJHlwDXy1hPshixQJgy+0XZ2K Dxb81fn0gpSEFH6FKXINgrXvf+v/cnoqz6DcmN7y39eEhpudnPuH4Fx0eE+J8fD1tfXUJVsog0i hljjG+z2+Bg X-Google-Smtp-Source: AGHT+IGb0ks6/klyin7qZnbtX5/7Tp1pDDxVcoRkIeVZ2ynIDtL+0fVbk8+RYn93h0Y99LtD+Bn/rw== X-Received: by 2002:a05:600c:4eca:b0:46f:a2ba:581f with SMTP id 5b1f17b1804b1-477c0540a68mr282815585e9.16.1764277499988; Thu, 27 Nov 2025 13:04:59 -0800 (PST) Received: from ?IPV6:2a02:6b6f:e750:1800:450:cba3:aec3:a1fd? ([2a02:6b6f:e750:1800:450:cba3:aec3:a1fd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4790adc6f7bsm122263015e9.2.2025.11.27.13.04.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Nov 2025 13:04:59 -0800 (PST) Message-ID: <56673a9c-a4c9-4962-baec-2d4483af3cfa@gmail.com> Date: Thu, 27 Nov 2025 21:04:58 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] mm/memblock: only mark/clear KHO scratch memory when needed Content-Language: en-GB To: Andrew Morton Cc: rppt@kernel.org, kas@kernel.org, changyuanl@google.com, graf@amazon.com, leitao@debian.org, thevlad@meta.com, pratyush@kernel.org, dave.hansen@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20251127203724.3177621-1-usamaarif642@gmail.com> <20251127203724.3177621-3-usamaarif642@gmail.com> <20251127125539.98b2f148c6225f1cb7c9d045@linux-foundation.org> From: Usama Arif In-Reply-To: <20251127125539.98b2f148c6225f1cb7c9d045@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 27/11/2025 20:55, Andrew Morton wrote: > On Thu, 27 Nov 2025 20:33:20 +0000 Usama Arif wrote: > >> The scratch memory for kexec handover is used to bootstrap the >> kexec'ed kernel. It is only needed when CONFIG_KEXEC_HANDOVER >> is enabled and only if it is a KHO boot. Add checks to prevent >> marking a KHO scratch region unless needed. > > What effect does this change have? Lessened memory consumption, > presumably. Of what magnitude and for what time period? For some context, this came out of https://lore.kernel.org/all/ba690e06-c2a1-4d2e-9428-9ca2ea9f2b86@gmail.com/ (I should have probably added that in the commit message..) We are experiencing several warnings a day in meta fleet due to a warning introduced in that patch. We dont have CONFIG_KEXEC_HANDOVER enabled in the fleet. The IMA memory seems to conincide with the 1st MB, but as Mike pointed out they are different arrays so this scratch memory is likely not a cause of the warnings. But it is not useful (and was a bit confusing) seeing KHO scratch memory being marked even when KHO is disabled. The imapct is as you said, but its only marked for a very short period of time. I think a better reason for this patch is just to not mark the memory at all when KHO is disabled (or not in use) for clarity.