[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <op.2c2ka4kwwjvjmi@hhuan26-mobl.amr.corp.intel.com>
Date: Thu, 19 Oct 2023 11:05:18 -0500
From: "Haitao Huang" <haitao.huang@...ux.intel.com>
To: Michal Koutný <mkoutny@...e.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 16/18] x86/sgx: Limit process EPC usage with misc
cgroup controller
On Tue, 17 Oct 2023 13:54:54 -0500, Michal Koutný <mkoutny@...e.com> wrote:
> On Fri, Sep 22, 2023 at 08:06:55PM -0700, Haitao Huang
> <haitao.huang@...ux.intel.com> wrote:
>> +static void sgx_epc_cgroup_free(struct misc_cg *cg)
>> +{
>> + struct sgx_epc_cgroup *epc_cg;
>> +
>> + epc_cg = sgx_epc_cgroup_from_misc_cg(cg);
>
> It should check for !epc_cg since the misc controller implementation
> in misc_cg_alloc() would roll back even on non-allocated resources.
Good catch. Will fix.
>
>> + cancel_work_sync(&epc_cg->reclaim_work);
>> + kfree(epc_cg);
>> +}
>> +
>> +static void sgx_epc_cgroup_max_write(struct misc_cg *cg)
>> +{
>> + struct sgx_epc_reclaim_control rc;
>> + struct sgx_epc_cgroup *epc_cg;
>> +
>> + epc_cg = sgx_epc_cgroup_from_misc_cg(cg);
>> +
>> + sgx_epc_reclaim_control_init(&rc, epc_cg);
>> + /* Let the reclaimer to do the work so user is not blocked */
>> + queue_work(sgx_epc_cg_wq, &rc.epc_cg->reclaim_work);
>
> This is weird. The writer will never learn about the result of the
> operation.
>
Right. With the new plan, this callback will be removed.
Thanks
Haitao
Powered by blists - more mailing lists