From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) (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 DA59D3CB2EF for ; Thu, 2 Jul 2026 11:26:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782991584; cv=none; b=I/f5YuXiTI6O0n5T9U9q4NNpsonFXwsZMXgClb3iMKcnT5WV9HAnGNEQeZS7vPrhlBLeuiMVjfZk15F1WS+y+fkCNf5cEkgqe6+mBQPp677P+c8oNA7duuXCFhIlaCihSZeFto/DZI6t01Aekknn8UDqLGwd/YV6ciiiEFWdaXU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782991584; c=relaxed/simple; bh=wDuyZBDH15IDvfRdDqS6WSduOxADhN2enSa8+94q0zU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=uDUo3YN8bja4p4ZKq/+TtNxBxTbvDilGJ9uROng5hlblSfOwBzHgPMJaR5049pcwOdtMqb9WVz3Q8hWWe9CLlvL8jGak5/jk4PrQ2TBxqQiBVKIOWqLyt+RO4FXWtOTNcXJnPTJTlvMl3f0jq2P4jZRy6z4H6jp2lgHE0ML1khQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=e1uGaexo; arc=none smtp.client-ip=115.124.30.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="e1uGaexo" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1782991572; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=2XVDzpeJaJW5FwzPOwl9DBXHXFuaS6E1gNSIdkK5Nm4=; b=e1uGaexoV022ZWJ9ZyYQ0q9wgEeC8u5sA80CLUySVOf3HkIGIYp61eWH339HEID2oP4GekJV5c71wYiUIbW9RdbFIhvlKH96Vopxek0MH8Fz8zKAbieJ0GaP85Ni/TSVG+aW3ehREAgSCxMvuyBQ/JMfZg4PnT3mnUudJb7gBYU= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045098064;MF=feng.tang@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0X6EZatn_1782991571; Received: from localhost(mailfrom:feng.tang@linux.alibaba.com fp:SMTPD_---0X6EZatn_1782991571 cluster:ay36) by smtp.aliyun-inc.com; Thu, 02 Jul 2026 19:26:12 +0800 From: Feng Tang To: Andrew Morton , Uladzislau Rezki Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Feng Tang Subject: [PATCH] mm/vmalloc: add alignment info in warning print as possible failure reason Date: Thu, 2 Jul 2026 19:26:10 +0800 Message-Id: <20260702112610.21589-1-feng.tang@linux.alibaba.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When running 'fix_align_alloc_test' case of test_vmalloc module with command: insmod ./test_vmalloc.ko run_test_mask=64 It will fail, which is the expected result, as the case increment the alignment parameter gradually to 64bit limit. And the dmesg has warning msg: "vmalloc_test/0: vmalloc error: size 4096, vm_struct allocation failed, mode:0xdc0(GFP_KERNEL|__GFP_ZERO), nodemask=(null),cpuset=/,mems_allowed=0" It doesn't give the alignment info, which is the real reason for the failure (not the 'size'). Add alignment info to the warning print to give the necessary hint for possible failure reason, and the message will be: "vmalloc_test/0: vmalloc error: size 4096, align 0x800000000000, vm_struct allocation failed, mode:0xdc0(GFP_KERNEL|__GFP_ZERO), nodemask=(null),cpuset=/,mems_allowed=0" Signed-off-by: Feng Tang --- mm/vmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 1afca3568b9b..e066324dcc76 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -4045,8 +4045,8 @@ void *__vmalloc_node_range_noprof(unsigned long size, unsigned long align, if (!area) { bool nofail = gfp_mask & __GFP_NOFAIL; warn_alloc(gfp_mask, NULL, - "vmalloc error: size %lu, vm_struct allocation failed%s", - size, (nofail) ? ". Retrying." : ""); + "vmalloc error: size %lu, align 0x%lx, vm_struct allocation failed%s", + size, align, (nofail) ? ". Retrying." : ""); if (nofail) { schedule_timeout_uninterruptible(1); goto again; -- 2.43.5