[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3LES3rUIZ/PtwzV@slm.duckdns.org>
Date: Mon, 14 Nov 2022 12:42:19 -1000
From: Tejun Heo <tj@...nel.org>
To: Kristen Carlson Accardi <kristen@...ux.intel.com>
Cc: jarkko@...nel.org, dave.hansen@...ux.kernel.org,
linux-kernel@...r.kernel.org, linux-sgx@...r.kernel.org,
cgroups@...r.kernel.org, Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>, zhiquan1.li@...el.com
Subject: Re: [PATCH 17/26] cgroup/misc: Add notifier block list support for
css events
Hello,
On Fri, Nov 11, 2022 at 10:35:22AM -0800, Kristen Carlson Accardi wrote:
> +/**
> + * register_misc_cg_notifier() - Register for css callback events
> + * @nb: notifier_block to register
> + *
> + * Context: Any context.
> + */
> +int register_misc_cg_notifier(struct notifier_block *nb)
> +{
> + return blocking_notifier_chain_register(&misc_cg_notify_list, nb);
> +}
> +EXPORT_SYMBOL_GPL(register_misc_cg_notifier);
> +
> +/**
> + * unregister_misc_cg_notifier() - unregister for css callback events
> + * @nb: notifier_block to unregister
> + *
> + * Context: Any context.
> + */
> +int unregister_misc_cg_notifier(struct notifier_block *nb)
> +{
> + return blocking_notifier_chain_unregister(&misc_cg_notify_list, nb);
> +}
> +EXPORT_SYMBOL_GPL(unregister_misc_cg_notifier);
So, I'm not necessarily against this but wonder whether it'd be more
straightforward to add sth like struct misc_res_ops which contains the
optional callbacks and then have an array of pointers to the structs which
are initialized / registered somehow. What do you think?
Thanks.
--
tejun
Powered by blists - more mailing lists