* [PATCH] resource: fix false warning in __request_region()
@ 2025-07-19 11:26 Akinobu Mita
2025-07-19 23:31 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Akinobu Mita @ 2025-07-19 11:26 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-cxl, akpm, akinobu.mita
A warning is raised when __request_region() detects a conflict with a
resource whose resource.desc is IORES_DESC_DEVICE_PRIVATE_MEMORY.
But this warning is only valid for iomem_resources.
The hmem device resource uses resource.desc as the numa node id, which can
cause spurious warnings.
This change fixes this by restricting the warning to only iomem_resource.
This also adds a missing new line to the warning message.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
kernel/resource.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/resource.c b/kernel/resource.c
index 8d3e6ed0bdc1..f9bb5481501a 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -1279,8 +1279,9 @@ static int __request_region_locked(struct resource *res, struct resource *parent
* become unavailable to other users. Conflicts are
* not expected. Warn to aid debugging if encountered.
*/
- if (conflict->desc == IORES_DESC_DEVICE_PRIVATE_MEMORY) {
- pr_warn("Unaddressable device %s %pR conflicts with %pR",
+ if (parent == &iomem_resource &&
+ conflict->desc == IORES_DESC_DEVICE_PRIVATE_MEMORY) {
+ pr_warn("Unaddressable device %s %pR conflicts with %pR\n",
conflict->name, conflict, res);
}
if (conflict != parent) {
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] resource: fix false warning in __request_region()
2025-07-19 11:26 [PATCH] resource: fix false warning in __request_region() Akinobu Mita
@ 2025-07-19 23:31 ` Andrew Morton
2025-07-20 8:17 ` Akinobu Mita
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2025-07-19 23:31 UTC (permalink / raw)
To: Akinobu Mita; +Cc: linux-kernel, linux-cxl
On Sat, 19 Jul 2025 20:26:04 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote:
> A warning is raised when __request_region() detects a conflict with a
> resource whose resource.desc is IORES_DESC_DEVICE_PRIVATE_MEMORY.
>
> But this warning is only valid for iomem_resources.
> The hmem device resource uses resource.desc as the numa node id, which can
> cause spurious warnings.
>
> This change fixes this by restricting the warning to only iomem_resource.
> This also adds a missing new line to the warning message.
What are the circumstance which cause this warning? Are real world
users hitting this? If so, should we backport this fix into earlier
kernels?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] resource: fix false warning in __request_region()
2025-07-19 23:31 ` Andrew Morton
@ 2025-07-20 8:17 ` Akinobu Mita
2025-07-22 16:08 ` dan.j.williams
0 siblings, 1 reply; 4+ messages in thread
From: Akinobu Mita @ 2025-07-20 8:17 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-cxl
2025年7月20日(日) 8:31 Andrew Morton <akpm@linux-foundation.org>:
>
> On Sat, 19 Jul 2025 20:26:04 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote:
>
> > A warning is raised when __request_region() detects a conflict with a
> > resource whose resource.desc is IORES_DESC_DEVICE_PRIVATE_MEMORY.
> >
> > But this warning is only valid for iomem_resources.
> > The hmem device resource uses resource.desc as the numa node id, which can
> > cause spurious warnings.
> >
> > This change fixes this by restricting the warning to only iomem_resource.
> > This also adds a missing new line to the warning message.
>
> What are the circumstance which cause this warning? Are real world
> users hitting this? If so, should we backport this fix into earlier
> kernels?
This warning actually appeared on a machine with multiple cxl memory expanders.
One of the NUMA node id is 6, which is the same as the value of
IORES_DESC_DEVICE_PRIVATE_MEMORY.
In this environment it was just a spurious warning, but when I saw the warning
I suspected a real problem so it's better to fix it.
Fixes: b926b7f3baec ("mm/resource: Move HMM pr_debug() deeper into
resource code")
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] resource: fix false warning in __request_region()
2025-07-20 8:17 ` Akinobu Mita
@ 2025-07-22 16:08 ` dan.j.williams
0 siblings, 0 replies; 4+ messages in thread
From: dan.j.williams @ 2025-07-22 16:08 UTC (permalink / raw)
To: Akinobu Mita, Andrew Morton; +Cc: linux-kernel, linux-cxl
Akinobu Mita wrote:
> 2025年7月20日(日) 8:31 Andrew Morton <akpm@linux-foundation.org>:
> >
> > On Sat, 19 Jul 2025 20:26:04 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote:
> >
> > > A warning is raised when __request_region() detects a conflict with a
> > > resource whose resource.desc is IORES_DESC_DEVICE_PRIVATE_MEMORY.
> > >
> > > But this warning is only valid for iomem_resources.
> > > The hmem device resource uses resource.desc as the numa node id, which can
> > > cause spurious warnings.
> > >
> > > This change fixes this by restricting the warning to only iomem_resource.
> > > This also adds a missing new line to the warning message.
> >
> > What are the circumstance which cause this warning? Are real world
> > users hitting this? If so, should we backport this fix into earlier
> > kernels?
>
> This warning actually appeared on a machine with multiple cxl memory expanders.
> One of the NUMA node id is 6, which is the same as the value of
> IORES_DESC_DEVICE_PRIVATE_MEMORY.
>
> In this environment it was just a spurious warning, but when I saw the warning
> I suspected a real problem so it's better to fix it.
>
> Fixes: b926b7f3baec ("mm/resource: Move HMM pr_debug() deeper into
> resource code")
This should be:
Fixes: 7dab174e2e27 ("dax/hmem: Move hmem device registration to dax_hmem.ko")
...as that is the change that violates the assumptions of
__request_region().
You can add:
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-22 16:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-19 11:26 [PATCH] resource: fix false warning in __request_region() Akinobu Mita
2025-07-19 23:31 ` Andrew Morton
2025-07-20 8:17 ` Akinobu Mita
2025-07-22 16:08 ` dan.j.williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).