Re: [PATCH v14 02/14] cgroup/misc: Add per resource callbacks for CSS events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: jarkko@xxxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, kai.huang@xxxxxxxxx, tj@xxxxxxxxxx, mkoutny@xxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-sgx@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, cgroups@xxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, hpa@xxxxxxxxx, sohil.mehta@xxxxxxxxx, tim.c.chen@xxxxxxxxxxxxxxx, chenridong <chenridong@xxxxxxxxxx>
- Subject: Re: [PATCH v14 02/14] cgroup/misc: Add per resource callbacks for CSS events
- From: "Haitao Huang" <haitao.huang@xxxxxxxxxxxxxxx>
- Date: Thu, 06 Jun 2024 09:51:55 -0500
- Cc: zhiquan1.li@xxxxxxxxx, kristen@xxxxxxxxxxxxxxx, seanjc@xxxxxxxxxx, zhanb@xxxxxxxxxxxxx, anakrish@xxxxxxxxxxxxx, mikko.ylinen@xxxxxxxxxxxxxxx, yangjie@xxxxxxxxxxxxx, chrisyan@xxxxxxxxxxxxx
- In-reply-to: <eeb1f936-2989-4de0-8353-b2373ce47474@huawei.com>
- Organization: Intel
- References: <20240531222630.4634-1-haitao.huang@linux.intel.com> <20240531222630.4634-3-haitao.huang@linux.intel.com> <eeb1f936-2989-4de0-8353-b2373ce47474@huawei.com>
- User-agent: Opera Mail/1.0 (Win32)
On Thu, 06 Jun 2024 08:37:31 -0500, chenridong <chenridong@xxxxxxxxxx>
wrote:
If _misc_cg_res_alloc fails, maybe some types do not call ->alloc(), but
all types ->free() callback >will be called, is that ok?
Not sure I understand. Are you suggesting we ignore failures from
->alloc() callback in _misc_cg_res_alloc() as it is per-resource, and have
->free() callback and resource provider of the failing type to handle the
failure internally?
IIUC, this failure only happens when a specific subcgroup is created
(memory running out for allocation) so failing that subcgroup as a whole
seems fine to me. Note the root node is static and no pre-resource
callbacks invoked by misc. And resource provider handles its own
allocations for root. In SGX case we too declare a static object for
corresponding root sgx_cgroup struct.
Note also misc cgroup (except for setting capacity[res] = 0 at root) is
all or nothing so no mechanism to tell user "this resource does not work
but others are fine in this particular cgroup."
Thanks
Haitao
[Index of Archives]
[AMD Graphics]
[Linux USB Devel]
[Linux Audio Users]
[Yosemite News]
[Linux Kernel]
[Linux SCSI]