[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66104f505de74_e9f9f294f5@iweiny-mobl.notmuch>
Date: Fri, 5 Apr 2024 12:21:52 -0700
From: Ira Weiny <ira.weiny@...el.com>
To: Dave Jiang <dave.jiang@...el.com>, Ira Weiny <ira.weiny@...el.com>, Fan Ni
<fan.ni@...sung.com>, Jonathan Cameron <Jonathan.Cameron@...wei.com>,
"Navneet Singh" <navneet.singh@...el.com>
CC: Dan Williams <dan.j.williams@...el.com>, Davidlohr Bueso
<dave@...olabs.net>, Alison Schofield <alison.schofield@...el.com>, "Vishal
Verma" <vishal.l.verma@...el.com>, <linux-btrfs@...r.kernel.org>,
<linux-cxl@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 05/26] cxl/core: Simplify cxl_dpa_set_mode()
Dave Jiang wrote:
>
>
> On 3/24/24 4:18 PM, Ira Weiny wrote:
> > cxl_dpa_set_mode() checks the mode for validity two times, once outside
> > of the DPA RW semaphore and again within. The function is not in a
> > critical path. Prior to Dynamic Capacity the extra check was not much
> > of an issue. The addition of DC modes increases the complexity of
> > the check.
> >
> > Simplify the mode check before adding the more complex DC modes.
>
> I would augment this by saying simplify "by using scope-based resource menagement".
However, using the guard cleanup is not really the simplification here. It is
more about checking the mode a single time.
That said I will change this to:
Simplify the mode check and convert to use of a cleanup guard.
Ira
Powered by blists - more mailing lists