Archive-only list for patches
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Maor Gottlieb <maorg@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Jason Gunthorpe <jgg@nvidia.com>, Sasha Levin <sashal@kernel.org>,
	leon@kernel.org, phaddad@nvidia.com, msanalla@nvidia.com
Subject: [PATCH AUTOSEL 6.15 8/8] RDMA/core: Rate limit GID cache warning messages
Date: Mon,  7 Jul 2025 20:02:15 -0400	[thread overview]
Message-ID: <20250708000215.793090-8-sashal@kernel.org> (raw)
In-Reply-To: <20250708000215.793090-1-sashal@kernel.org>

From: Maor Gottlieb <maorg@nvidia.com>

[ Upstream commit 333e4d79316c9ed5877d7aac8b8ed22efc74e96d ]

The GID cache warning messages can flood the kernel log when there are
multiple failed attempts to add GIDs. This can happen when creating many
virtual interfaces without having enough space for their GIDs in the GID
table.

Change pr_warn to pr_warn_ratelimited to prevent log flooding while still
maintaining visibility of the issue.

Link: https://patch.msgid.link/r/fd45ed4a1078e743f498b234c3ae816610ba1b18.1750062357.git.leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

**YES**

This commit should be backported to stable kernel trees. Here's my
extensive analysis:

## Key Reasons for Backporting:

### 1. **Fixes a Real-World Bug**
The commit addresses a concrete problem where warning messages can flood
the kernel log. This is not a theoretical issue - it occurs when users
create many virtual interfaces without sufficient GID table space. This
is a common scenario in production environments with RDMA/InfiniBand
deployments.

### 2. **Small and Contained Change**
The change is minimal - only replacing `pr_warn()` with
`pr_warn_ratelimited()` on lines 585-586. This is exactly 2 lines of
functional change with no architectural modifications or new features
added.

### 3. **Low Risk of Regression**
- The change only affects logging behavior, not functional behavior
- `pr_warn_ratelimited()` is a well-established kernel API that behaves
  identically to `pr_warn()` except for rate limiting
- No data structures are modified
- No locking changes
- No protocol or API changes

### 4. **Follows Stable Kernel Rules**
According to stable kernel rules, this fix qualifies because:
- It fixes a bug that bothers people (kernel log flooding)
- It's a trivial change (2 lines)
- It has been tested in mainline
- It doesn't add new features

### 5. **Similar to Historical Backports**
Looking at the similar commits provided:
- Similar Commit #1 (backported): Fixed a hardware limitation issue with
  clear bounds
- Similar Commit #2 (NOT backported): Added rate limiting to ipoib_warn
  but was more invasive with macro changes
- This commit is more like #1 - a targeted fix for a specific issue

### 6. **Production Impact**
Log flooding can have serious production impacts:
- Fills up `/var/log` partitions
- Makes it difficult to find other important kernel messages
- Can impact system performance due to excessive logging
- Can trigger log rotation issues

### 7. **Context-Specific Analysis**
The error path where this warning occurs (line 571: `ret = -ENOSPC`)
specifically handles the case when the GID table is full. In
environments with many virtual interfaces, this condition can be hit
repeatedly in quick succession, causing the flood described in the
commit message.

The commit message clearly states this is fixing an observed problem:
"This can happen when creating many virtual interfaces without having
enough space for their GIDs in the GID table."

This is a perfect example of a stable-appropriate fix: minimal change,
fixes a real bug, no risk of functional regression, and improves system
stability in production environments.

 drivers/infiniband/core/cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 9979a351577f1..81cf3c902e819 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -582,8 +582,8 @@ static int __ib_cache_gid_add(struct ib_device *ib_dev, u32 port,
 out_unlock:
 	mutex_unlock(&table->lock);
 	if (ret)
-		pr_warn("%s: unable to add gid %pI6 error=%d\n",
-			__func__, gid->raw, ret);
+		pr_warn_ratelimited("%s: unable to add gid %pI6 error=%d\n",
+				    __func__, gid->raw, ret);
 	return ret;
 }
 
-- 
2.39.5


      parent reply	other threads:[~2025-07-08  0:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08  0:02 [PATCH AUTOSEL 6.15 1/8] Revert "ACPI: battery: negate current when discharging" Sasha Levin
2025-07-08  0:02 ` [PATCH AUTOSEL 6.15 2/8] virtio_net: Enforce minimum TX ring size for reliability Sasha Levin
2025-07-08  0:02 ` [PATCH AUTOSEL 6.15 3/8] virtio_ring: Fix error reporting in virtqueue_resize Sasha Levin
2025-07-08  0:02 ` [PATCH AUTOSEL 6.15 4/8] drm/amd/display: Don't allow OLED to go down to fully off Sasha Levin
2025-07-08  0:02 ` [PATCH AUTOSEL 6.15 5/8] regulator: core: fix NULL dereference on unbind due to stale coupling data Sasha Levin
2025-07-08  0:02 ` [PATCH AUTOSEL 6.15 6/8] PM: Restrict swap use to later in the suspend sequence Sasha Levin
2025-07-08  6:25   ` Pavel Machek
2025-07-08  6:39   ` Pavel Machek
2025-07-08 19:13   ` Eric W. Biederman
2025-07-08 19:32   ` Eric W. Biederman
2025-07-08 20:32     ` Sasha Levin
2025-07-08 20:37       ` Pavel Machek
2025-07-08 20:46         ` Willy Tarreau
2025-07-08 20:49           ` Pavel Machek
2025-07-08 21:12           ` Sasha Levin
2025-07-08 21:26             ` Pavel Machek
2025-07-09  5:34             ` Pavel Machek
2025-07-08 20:41       ` Pavel Machek
2025-07-08 21:46       ` Eric W. Biederman
2025-07-08 22:26         ` Sasha Levin
2025-07-09  5:39           ` Pavel Machek
2025-07-09 14:35             ` Mario Limonciello
2025-07-09 16:23           ` Eric W. Biederman
2025-07-09 16:35             ` Mario Limonciello
2025-07-09 16:55               ` Rafael J. Wysocki
2025-07-09 17:37             ` Sasha Levin
2025-07-08 20:38     ` Pavel Machek
2025-07-08  0:02 ` [PATCH AUTOSEL 6.15 7/8] platform/x86: asus-nb-wmi: add DMI quirk for ASUS Zenbook Duo UX8406CA Sasha Levin
2025-07-08  0:02 ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250708000215.793090-8-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=maorg@nvidia.com \
    --cc=msanalla@nvidia.com \
    --cc=patches@lists.linux.dev \
    --cc=phaddad@nvidia.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox