All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: "Vij, Mona" <mona.vij@intel.com>,
	"Sakkinen, Jarkko" <jarkko.sakkinen@intel.com>,
	"Kumar, Deepak1" <deepak1.kumar@intel.com>,
	"Helm, Kent" <kent.helm@intel.com>,
	"Narjala, Ranjit S" <ranjit.s.narjala@intel.com>,
	"Huang, Haitao" <haitao.huang@intel.com>,
	"Mathew, Shama" <shama.mathew@intel.com>,
	"Hossain, Md Iqbal" <md.iqbal.hossain@intel.com>,
	"Saffores, Ryan D" <ryan.d.saffores@intel.com>,
	"Jaramillo, Alex V" <alex.v.jaramillo@intel.com>,
	"Kuvaiskii, Dmitrii" <dmitrii.kuvaiskii@intel.com>,
	"Mahalingam, Ganesh" <ganesh.mahalingam@intel.com>
Cc: "Sterrett, Craig" <craig.sterrett@intel.com>,
	"Macieira, Thiago" <thiago.macieira@intel.com>,
	"Salunke, Manoj" <manoj.salunke@intel.com>,
	"Gandhi, Jinen" <jinen.gandhi@intel.com>,
	"linux-sgx@vger.kernel.org" <linux-sgx@vger.kernel.org>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Subject: SGX Performance Creep
Date: Mon, 8 Mar 2021 16:40:20 -0800	[thread overview]
Message-ID: <990a55e9-5160-c2ae-08ab-7e1d277bd310@intel.com> (raw)
In-Reply-To: <MW3PR11MB47295461B3E28FEEA28AE8A1999F9@MW3PR11MB4729.namprd11.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

I got my hands on a NUC7CJYH, which is the first piece of functional
Flexible Launch Control hardware I've actually laid my hands on.

I went looking for any "performance creep".  I tried a very simple test:
Create and run an enclave that touches a 64MB statically-allocated
buffer.  (The patch to the kernel selftest to do this is attached).

tl;dr: I'm not seeing any meaningful change in runtimes, even after
running and tearing down the enclave for 6-7 hours.

I'm running the selftest like this, creating a log file with /usr/bin/time:

NOW=$(date +%s); make && while true; do /usr/bin/time ./test_sgx >>
$NOW.log 2>> $NOW.timelog || break; done

This lets me do a quick and dirty histogram of the runtimes.  Note that
there's a single, nice peak.  It's not "smeared" like I would expect
from slowly-degrading run times.

$ cat 1615229976.timelog  | grep elapsed | awk '{print $1}' | sort | uniq -c
      4 2.08user
     14 2.09user
    106 2.10user
    403 2.11user
   1055 2.12user
   1518 2.13user
   1268 2.14user
    726 2.15user
    302 2.16user
     96 2.17user
     23 2.18user
      8 2.19user
      1 2.20user

I'll run for another day or two and see if anything interesting shows
up.  But, for now, nothing interesting is happening.  Whatever folks are
seeing, it doesn't seem to be present on my little simple test case, or
this Atom-based hardware.

The kernel is: stock 5.12.0-rc2.
The CPU is: Intel(R) Celeron(R) J4005 CPU @ 2.00GHz


[-- Attachment #2: 64mb-enclave.patch --]
[-- Type: text/x-patch, Size: 667 bytes --]

diff --git a/tools/testing/selftests/sgx/test_encl.c b/tools/testing/selftests/sgx/test_encl.c
index cf25b5dc1e03..dd45a72a1b42 100644
--- a/tools/testing/selftests/sgx/test_encl.c
+++ b/tools/testing/selftests/sgx/test_encl.c
@@ -14,7 +14,21 @@ static void *memcpy(void *dest, const void *src, size_t n)
 	return dest;
 }
 
+#define DATA_LEN (64 * 1<<20)
+static unsigned char data[DATA_LEN] = { 0x12 };
+
 void encl_body(void *rdi, void *rsi)
 {
+	int i;
+	int j;
+	int len = DATA_LEN;
+	int loops = 2;
+
+	for (j = 0; j < loops; j++) {
+		for (i = 0; i < len; i++) {
+			data[i] = (unsigned long)rdi;
+		}
+	}
+
 	memcpy(rsi, rdi, 8);
 }

       reply	other threads:[~2021-03-09  0:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BYAPR11MB274479307F08C6AE305FB9A8F2BA9@BYAPR11MB2744.namprd11.prod.outlook.com>
     [not found] ` <MWHPR11MB19048655E5942E21F4D78983DA819@MWHPR11MB1904.namprd11.prod.outlook.com>
     [not found]   ` <edb58aeb-6f6a-236c-046d-b692377cc550@intel.com>
     [not found]     ` <BYAPR11MB274441F17146490289EED9A3F2819@BYAPR11MB2744.namprd11.prod.outlook.com>
     [not found]       ` <DM6PR11MB4723CB5D0DF41F38FB59154399819@DM6PR11MB4723.namprd11.prod.outlook.com>
     [not found]         ` <d5d851d7-ebb0-df51-2684-b916f2b47432@intel.com>
     [not found]           ` <BYAPR11MB2744D84CAB45A321D7B83389F2819@BYAPR11MB2744.namprd11.prod.outlook.com>
     [not found]             ` <BYAPR11MB2744212BCA03E628DA29D2C8F2809@BYAPR11MB2744.namprd11.prod.outlook.com>
     [not found]               ` <MW3PR11MB468192CCAC4C2B12DFF7EC99F9809@MW3PR11MB4681.namprd11.prod.outlook.com>
     [not found]                 ` <MW3PR11MB46012C10D9526DE48641512FB6809@MW3PR11MB4601.namprd11.prod.outlook.com>
     [not found]                   ` <MW3PR11MB47295620E26A7612D81FCB2899809@MW3PR11MB4729.namprd11.prod.outlook.com>
     [not found]                     ` <b9bb309e2385537e02bac93ad29d43b8b86e5143.camel@intel.com>
     [not found]                       ` <MW3PR11MB47295461B3E28FEEA28AE8A1999F9@MW3PR11MB4729.namprd11.prod.outlook.com>
2021-03-09  0:40                         ` Dave Hansen [this message]
2021-03-09 17:16                           ` SGX Performance Creep Sakkinen, Jarkko

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=990a55e9-5160-c2ae-08ab-7e1d277bd310@intel.com \
    --to=dave.hansen@intel.com \
    --cc=alex.v.jaramillo@intel.com \
    --cc=craig.sterrett@intel.com \
    --cc=deepak1.kumar@intel.com \
    --cc=dmitrii.kuvaiskii@intel.com \
    --cc=ganesh.mahalingam@intel.com \
    --cc=haitao.huang@intel.com \
    --cc=jarkko.sakkinen@intel.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jinen.gandhi@intel.com \
    --cc=kent.helm@intel.com \
    --cc=linux-sgx@vger.kernel.org \
    --cc=manoj.salunke@intel.com \
    --cc=md.iqbal.hossain@intel.com \
    --cc=mona.vij@intel.com \
    --cc=ranjit.s.narjala@intel.com \
    --cc=ryan.d.saffores@intel.com \
    --cc=shama.mathew@intel.com \
    --cc=thiago.macieira@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.