From nobody Thu Apr 9 12:06:24 2026 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 CA1613630B6 for ; Mon, 2 Mar 2026 11:47:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772452067; cv=none; b=ajGI00Xec3NzDHghJBPqMM4bHLPdB53mYHumZxFc3uRVEIbZH9irqjw9rMlMt5LPryndWR8qQYGAqHxlia1XXtxBl5BDUdaR0Wh86WHPQDSxkPd3ujDWdScJqjZQSgecMJO//2A9h0F20pb/2R7kiztjKkXvtSvFdfI1Cu41usc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772452067; c=relaxed/simple; bh=lKljLVLZ2pT4PvQrgQ0xA5julNNbP9sPxexymX04wmU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DziMqkzFn++wSZWATDqQmc6VnnLR0ScjX8if/BRZ51/+R0dQnyiRA1jgzlpaMstxLfBuukK3xCj2js2+L6vIxYhmeE9dOP3wJea79h16eqwmAsVByKkWwLz/vuWEOzxghh+x9PyfuNygAMtv9GAwA/mGZN/4qwSPRh4qGDHd/d4= 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=Vnx8HxDG; arc=none smtp.client-ip=209.85.208.173 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="Vnx8HxDG" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-389f9895c81so3781831fa.2 for ; Mon, 02 Mar 2026 03:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772452063; x=1773056863; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RRCdKKvPiApTBPbA+MVq+nK6IvIHTol2lBtHSKLnd6s=; b=Vnx8HxDGjC/wIB6FFfbGCM8c+uq6T8kao6DMfZV8ZgMxaYNNci/Kk86i5rD4h6TqqG 3Lei3F1bPz7J7gGK+xPl5zba4wWYu95X7JP07fXi+2MBg5cs17tkrIanccT34XYl9+Qf dcJmAo+CpgE1oFqowoIww3nN0xJ2YxwkOgoHl+AWF7LW+n+yxq1BbInqWhJbyAuwFp/6 E7/hFlyXbPqVv4PconGrvKQ07mCTtYewJdg/2p5GYIWWLD7O38bfF0kbwXEAUWRpXmwU dLB1+9T1F4JYWvwrFPI+eR9kWJwbmR/PndYPRdx1iWtIs/N3Ha2qqS4kXqXNNgaK3GJf /lkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772452063; x=1773056863; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RRCdKKvPiApTBPbA+MVq+nK6IvIHTol2lBtHSKLnd6s=; b=NTONbtpGFxNLc5VJ5ziO4GWkc79DZnC9fZ04rhkNMSrHEsYXSz+awN++00n/OlgnN4 Bs3ZW96Umk1UUUJ5w76ataQFARnA6sEAXSVZES+Sov1MamM7kB89mE1q8GtAEjXejlc3 HccB3zrj2r8AdtUXlHe908vb2trSRWVc3CYwa2Aw/ZVoQSOEX1RyYmow7t/ndMhN6eJs AkCZO3/g9PHqzzD43li3tjsgdmdV9hW6Klmj61pQOqz348KiSkHYE7JfZITK5ASxoN5+ rRCDnAd3zPcWgDNjcDtrFYOk7fgZV9u3dm/MzTiO2FfP2F4SzqDqAtF8DOCxbD9PUA6P 97kA== X-Forwarded-Encrypted: i=1; AJvYcCU2DBvUiF/te2k4V1af7pn9QSKia8L8AmSyAFcCyjM8gxRLUDIHe/YEjRazZu89nuKnsxnOP3hnEIgFRLI=@vger.kernel.org X-Gm-Message-State: AOJu0YwCcLYE5tyA6MYb+u8UdYYgM0vj2uqtsXf9sniPUXMBidrm7liY /vODR9zAYo6NQflyOcil/iM3fLWYcqPjpb9HyvEm2dQt+ZLnysAKQnHY X-Gm-Gg: ATEYQzxkmjI4jSuhDVIZed+34jDHRj0YeJXyej4sPI6G9UhGR9J9nj19JeLhvXzlqrn qUZNnWN/3YZNhU4J879znq0Va5c8sVnqN/r/V2FaKKg8+Ms85bBf0fos2eNk2isjQZT/6eoZlaP u5SViVPSRdL7wYA5M4HSyjinJEhTB63m4HRbCuhVVa4JNw49Br+c92Q/aCPLx3vQb91zClFX/yu UjS/RBFtFQMUsB2uuCl7Styo4vY5mpH5k5zBpS/EynZ1JH11Ncxsj1jLcRCWHc5XMLjUewuv6hW hYdysXaTDKGgOPmNZWmoA0hTVJgEFgRgvnJEuUq9+eR6ZeQfy3lhuiIX1tVka5jI78IVylG9Nd3 ps7vsvXYkRU996OBqf5IB+pZHbqY48Ypo8punWiru2U6zCFFnX+G4/Lu1/KR7t3IMTyJfrZpSNx H/cuCaq+XgYzUdrLw= X-Received: by 2002:a05:651c:3044:b0:380:989:f615 with SMTP id 38308e7fff4ca-389ff116d7emr69597401fa.6.1772452062501; Mon, 02 Mar 2026 03:47:42 -0800 (PST) Received: from localhost.localdomain ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a115bca02asm1603412e87.25.2026.03.02.03.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2026 03:47:42 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: linux-mm@kvack.org, Andrew Morton Cc: Michal Hocko , Mikulas Patocka , Vishal Moola , Baoquan He , LKML , Uladzislau Rezki Subject: [PATCH] mm/vmalloc: Fix incorrect size reporting on allocation failure Date: Mon, 2 Mar 2026 12:47:39 +0100 Message-ID: <20260302114740.2668450-1-urezki@gmail.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When __vmalloc_area_node() fails to allocate pages, the failure message may report an incorrect allocation size, for example: vmalloc error: size 0, failed to allocate pages, ... This happens because the warning prints area->nr_pages * PAGE_SIZE. At this point, area->nr_pages may be zero or partly populated thus it is not valid. Report the originally requested allocation size instead by using nr_small_pages * PAGE_SIZE, which reflects the actual number of pages being requested by user. Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Dev Jain Reviewed-by: Mikulas Patocka Reviewed-by: Vishal Moola (Oracle) --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 61caa55a4402..a06f4b3ea367 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3901,7 +3901,7 @@ static void *__vmalloc_area_node(struct vm_struct *ar= ea, gfp_t gfp_mask, if (!fatal_signal_pending(current) && page_order =3D=3D 0) warn_alloc(gfp_mask, NULL, "vmalloc error: size %lu, failed to allocate pages", - area->nr_pages * PAGE_SIZE); + nr_small_pages * PAGE_SIZE); goto fail; } =20 --=20 2.47.3