[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <k4hvow3juyelizqrlwdjmuu57kscvcwanu3xhpeuqnppynzrdu@hmxuvgefqpo5>
Date: Tue, 17 Oct 2023 20:55:02 +0200
From: Michal Koutný <mkoutny@...e.com>
To: Haitao Huang <haitao.huang@...ux.intel.com>
Cc: jarkko@...nel.org, dave.hansen@...ux.intel.com, tj@...nel.org,
linux-kernel@...r.kernel.org, linux-sgx@...r.kernel.org,
x86@...nel.org, cgroups@...r.kernel.org, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, hpa@...or.com,
sohil.mehta@...el.com, zhiquan1.li@...el.com,
kristen@...ux.intel.com, seanjc@...gle.com, zhanb@...rosoft.com,
anakrish@...rosoft.com, mikko.ylinen@...ux.intel.com,
yangjie@...rosoft.com
Subject: Re: [PATCH v5 01/18] cgroup/misc: Add per resource callbacks for CSS
events
On Fri, Sep 22, 2023 at 08:06:40PM -0700, Haitao Huang <haitao.huang@...ux.intel.com> wrote:
> @@ -276,10 +276,13 @@ static ssize_t misc_cg_max_write(struct kernfs_open_file *of, char *buf,
>
> cg = css_misc(of_css(of));
>
> - if (READ_ONCE(misc_res_capacity[type]))
> + if (READ_ONCE(misc_res_capacity[type])) {
> WRITE_ONCE(cg->res[type].max, max);
> - else
> + if (cg->res[type].max_write)
> + cg->res[type].max_write(cg);
> + } else {
> ret = -EINVAL;
>
> + }
Is it time for a misc_cg_mutex? This given no synchronization guarantees
to implementors of max_write. (Alternatively, document it that the
callback must implement own synchronization.)
Thanks,
Michal
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists