Intel SGX development
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: linux-sgx@vger.kernel.org
Cc: sean.j.christopherson@intel.com
Subject: Re: [PATCH v2 00/17] v23 updates
Date: Mon, 16 Sep 2019 11:01:43 +0300	[thread overview]
Message-ID: <20190916080143.GA27356@linux.intel.com> (raw)
In-Reply-To: <20190916075806.GB26608@linux.intel.com>

On Mon, Sep 16, 2019 at 10:58:06AM +0300, Jarkko Sakkinen wrote:
> On Mon, Sep 16, 2019 at 07:14:00AM +0300, Jarkko Sakkinen wrote:
> > My flush of updates for v23. Contains a bunch of clean ups and bug
> > fixes with the main focus on the page reclaimer. The main goal has
> > been to disclose all the other possibilities for failure after
> > ENCLS[EBLOCK] other than EPCM conflict when the whole EPC is
> > invalidated.
> 
> I have at least one more update to the reclaimer but want to merge these
> first.
> 
> It adds optional struct epc_page **reclaimed_page to
> sgx_reclaim_pages(). If NULL, the function will just append everything
> to the free pool. Otherwise, it will use it to return one of the
> reclaimed pages if there are any.
> 
> sgx_alloc_page() then does the following when @reclaim=true:
> 
> 1. If page in free page pool, take one.
> 2. If not, try to reclaim one.
> 3. If nothing was reclaimed -ENOMEM.
> 
> Right now sgx_alloc_page() can in theory take however long.
> 
> I wonder why we do not return -ENOMEM also when @reclaim=false. Where
> did this returning -EBUSY came from? Can't recall.

Checked. I guess it is just for ELDU flow but does not make sense
otherwise. Tuning sgx_vma_fault() should be enough. I mean with
the above change we would start to return -EBUSY sometimes in
OOM situations.

/Jarkko

  reply	other threads:[~2019-09-16  8:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16  4:14 [PATCH v2 00/17] v23 updates Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 01/17] selftest/x86/sgx: Remove encl_piggy.h Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 02/17] x86/sgx: Clean up internal includes Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 03/17] x86/sgx: Write backing storage only if EWB is successful Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 04/17] x86/sgx: Rename 'j' as 'cnt' in sgx_reclaim_pages() Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 05/17] x86/sgx: Turn encls_failed() as inline function Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 06/17] x86/sgx: Move sgx_einit() to encls.c Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 07/17] x86/sgx: Remove pages in sgx_reclaimer_write() Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 08/17] x86/sgx: Calculate page index " Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 09/17] x86/sgx: Move SGX_ENCL_DEAD check to sgx_reclaimer_write() Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 10/17] x86/sgx: Free VA slot when the EWB flow fails Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 11/17] x86/sgx: Call sgx_encl_destroy() " Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 12/17] x86/sgx: Open code sgx_reclaimer_get() and sgx_reclaimer_put() Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 13/17] x86/sgx: Introduce sgx_can_reclaim() Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 14/17] x86/sgx: Replace section->free_cnt with a global sgx_nr_free_pages Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 15/17] x86/sgx: sgx_vma_access(): Do not return -ECANCELED on invalid TCS pages Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 16/17] x86/sgx: Introduce sgx_encl_get_backing() Jarkko Sakkinen
2019-09-16  4:14 ` [PATCH v2 17/17] x86/sgx: Fix pages in the BLOCKED state ending up to the free pool Jarkko Sakkinen
2019-09-16  7:58 ` [PATCH v2 00/17] v23 updates Jarkko Sakkinen
2019-09-16  8:01   ` Jarkko Sakkinen [this message]
2019-09-16 18:37     ` Sean Christopherson
2019-09-17 19:08       ` Jarkko Sakkinen
2019-09-17 19:27         ` Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190916080143.GA27356@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=linux-sgx@vger.kernel.org \
    --cc=sean.j.christopherson@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox