Messages in this thread | | | Date | Tue, 17 Oct 2023 20:55:02 +0200 | From | Michal Koutný <> | 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@linux.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 [unhandled content-type:application/pgp-signature] | |