lkml.org 
[lkml]   [2022]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 01/20] x86/sgx: Call cond_resched() at the end of sgx_reclaim_pages()
On Fri, Sep 23, 2022 at 03:32:43PM +0300, Jarkko Sakkinen wrote:
> On Thu, Sep 22, 2022 at 10:10:38AM -0700, Kristen Carlson Accardi wrote:
> > From: Sean Christopherson <sean.j.christopherson@intel.com>
> >
> > Move the invocation of post-reclaim cond_resched() from the callers of
> > sgx_reclaim_pages() into the reclaim path itself. sgx_reclaim_pages()
> > is always called in a loop and is always followed by a call to
> > cond_resched(). This will hold true for the EPC cgroup as well, which
> > adds even more calls to sgx_reclaim_pages() and thus cond_resched().
>
> This would be in my opinion better:
>
> "
> In order to avoid repetion of cond_sched() in ksgxd() and
> sgx_alloc_epc_page(), move the call inside sgx_reclaim_pages().
>
> This will hold true for the EPC cgroup as well, which adds more
> call sites sgx_reclaim_pages().
> "
>
> This way it is dead obvious and is better description because
> it enumerates the consequences (i.e. call sites).

Forgot 3rd call site: sgx_reclaim_direct(), which is used by
SGX2 ioctls. The call sites of sgx_reclaim_direct() do not
call cond_resched(). You should address why adding this call
to those flows is fine.

BR, Jarkko

\
 
 \ /
  Last update: 2022-09-23 14:36    [W:0.068 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site