[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250610103704.000023c4@huawei.com>
Date: Tue, 10 Jun 2025 10:37:04 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: "Koralahalli Channabasappa, Smita"
<Smita.KoralahalliChannabasappa@....com>
CC: <linux-cxl@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<nvdimm@...ts.linux.dev>, <linux-fsdevel@...r.kernel.org>,
<linux-pm@...r.kernel.org>, Davidlohr Bueso <dave@...olabs.net>, Dave Jiang
<dave.jiang@...el.com>, Alison Schofield <alison.schofield@...el.com>, Vishal
Verma <vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>, Dan
Williams <dan.j.williams@...el.com>, Matthew Wilcox <willy@...radead.org>,
Jan Kara <jack@...e.cz>, "Rafael J . Wysocki" <rafael@...nel.org>, Len Brown
<len.brown@...el.com>, Pavel Machek <pavel@...nel.org>, Li Ming
<ming.li@...omail.com>, Jeff Johnson <jeff.johnson@....qualcomm.com>, Ying
Huang <huang.ying.caritas@...il.com>, Yao Xingtao <yaoxt.fnst@...itsu.com>,
Peter Zijlstra <peterz@...radead.org>, Greg KH <gregkh@...uxfoundation.org>,
"Nathan Fontenot" <nathan.fontenot@....com>, Terry Bowman
<terry.bowman@....com>, Robert Richter <rrichter@....com>, Benjamin Cheatham
<benjamin.cheatham@....com>, PradeepVineshReddy Kodamati
<PradeepVineshReddy.Kodamati@....com>, Zhijian Li <lizhijian@...itsu.com>
Subject: Re: [PATCH v4 5/7] cxl/region: Introduce SOFT RESERVED resource
removal on region teardown
Hi Smita,
> >> +/*
> >> + * normalize_resource
> >> + *
> >> + * The walk_iomem_res_desc() returns a copy of a resource, not a reference
> >> + * to the actual resource in the iomem_resource tree. As a result,
> >> + * __release_resource() which relies on pointer equality will fail.
> >
> > Probably want some statement on why nothing can race with this give
> > the resource_lock is not being held.
>
> Hmm, probably you are right that normalize_resource() is accessing the
> resource tree without holding resource_lock, which could lead to races.
>
> I will update the function to take a read_lock(&resource_lock) before
> walking res->parent->child..
>
> Let me know if you'd prefer this locking be handled before calling
> normalize_resource() instead..
I don't mind either way - see what looks better to you.
Powered by blists - more mailing lists