[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <op.2cyma0e9wjvjmi@hhuan26-mobl.amr.corp.intel.com>
Date: Tue, 17 Oct 2023 07:58:02 -0500
From: "Haitao Huang" <haitao.huang@...ux.intel.com>
To: "Christopherson,, Sean" <seanjc@...gle.com>,
"Huang, Kai" <kai.huang@...el.com>
Cc: "Zhang, Bo" <zhanb@...rosoft.com>,
"linux-sgx@...r.kernel.org" <linux-sgx@...r.kernel.org>,
"cgroups@...r.kernel.org" <cgroups@...r.kernel.org>,
"yangjie@...rosoft.com" <yangjie@...rosoft.com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"Li, Zhiquan1" <zhiquan1.li@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"tj@...nel.org" <tj@...nel.org>,
"anakrish@...rosoft.com" <anakrish@...rosoft.com>,
"jarkko@...nel.org" <jarkko@...nel.org>,
"hpa@...or.com" <hpa@...or.com>,
"mikko.ylinen@...ux.intel.com" <mikko.ylinen@...ux.intel.com>,
"Mehta, Sohil" <sohil.mehta@...el.com>,
"bp@...en8.de" <bp@...en8.de>, "x86@...nel.org" <x86@...nel.org>,
"kristen@...ux.intel.com" <kristen@...ux.intel.com>
Subject: Re: [PATCH v5 12/18] x86/sgx: Add EPC OOM path to forcefully reclaim
EPC
On Mon, 16 Oct 2023 20:34:57 -0500, Huang, Kai <kai.huang@...el.com> wrote:
> On Mon, 2023-10-16 at 19:10 -0500, Haitao Huang wrote:
>> On Mon, 16 Oct 2023 16:09:52 -0500, Huang, Kai <kai.huang@...el.com>
>> wrote:
>> [...]
>>
>> > still need to fix the bug mentioned above here.
>> >
>> > I really think you should just go this simple way:
>> >
>> > When you want to take EPC back from VM, kill the VM.
>> >
>>
>> My only concern is that this is a compromise due to current limitation
>> (no
>> other sane way to take EPC from VMs). If we define this behavior and it
>> becomes a contract to user space, then we can't change in future.
>
> Why do we need to "define such behaviour"?
>
> This isn't some kinda of kernel/userspace ABI IMHO, but only kernel
> internal
> implementation. Here VM is similar to normal host enclaves. You limit
> the
> resource, some host enclaves could be killed. Similarly, VM could also
> be
> killed too.
>
> And supporting VMM EPC oversubscription doesn't mean VM won't be
> killed. The VM
> can still be a target to kill after VM's all EPC pages have been swapped
> out.
>
>>
>> On the other hand, my understanding the reason you want this behavior is
>> to enforce EPC limit at runtime.
>
> No I just thought this is a bug/issue needs to be fixed. If anyone
> believes
> this is not a bug/issue then it's a separate discussion.
>
AFAIK, before we introducing max_write() callback in this series, no misc
controller would possibly enforce the limit when misc.max is reduced. e.g.
I don't think CVMs be killed when ASID limit is reduced and the cgroup was
full before limit is reduced.
I think EPC pages to VMs could have the same behavior, once they are given
to a guest, never taken back by the host. For enclaves on host side, pages
are reclaimable, that allows us to enforce in a similar way to memcg.
Thanks
Haitao
Powered by blists - more mailing lists