Re: [PATCH] iommu: Use dev_dbg for group handling code

From: Pranjal Shrivastava

Date: Tue Apr 07 2026 - 11:37:46 EST


On Tue, Apr 07, 2026 at 09:06:38PM +0800, Lin Ruifeng wrote:
> When devices are frequently registered/unregistered, there will be a large
> number of iommu group adding/remove messages, which will flood the dmesg buffer
> and flush out other logs. For iommu group handling messages, we can use dev_dbg
> to output logs only when needed.
>
> Signed-off-by: Lin Ruifeng <linruifeng4@xxxxxxxxxx>
> ---
> drivers/iommu/iommu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 50718ab810a4..18ceaba6cf0a 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -1283,7 +1283,7 @@ static struct group_device *iommu_group_alloc_device(struct iommu_group *group,
>
> trace_add_device_to_group(group->id, dev);
>
> - dev_info(dev, "Adding to iommu group %d\n", group->id);
> + dev_dbg(dev, "Adding to iommu group %d\n", group->id);
>
> return device;
>
> @@ -1337,7 +1337,7 @@ void iommu_group_remove_device(struct device *dev)
> if (!group)
> return;
>
> - dev_info(dev, "Removing from iommu group %d\n", group->id);
> + dev_dbg(dev, "Removing from iommu group %d\n", group->id);
>
> __iommu_group_remove_device(dev);
> }

I believe this was discussed roughly an year ago as well:

https://lore.kernel.org/linux-iommu/84cb9155-4793-45f9-bb67-6926e103dc84@xxxxxxx/

And 5 years ago as well:

https://lore.kernel.org/linux-iommu/20200302154426.GC6540@xxxxxxxxxx/

The general consensus is that the maintainers and the community would
like to keep this log in place as it helps us debug issues just based on
dmesg logs shared over an email.

I understand that losing dmesg logs in such situations could be
frustrating but I guess you could try increasing the log buffer size..

Thanks,
Praan