Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp807454pxv; Fri, 9 Jul 2021 09:27:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwey+mxvUa72SBAdni4oT1OsBqRKJdLgqg90D5z5Ef1PJVOueGwwAP3Hyi41qbVZ+JYAAYE X-Received: by 2002:a17:906:974e:: with SMTP id o14mr28345048ejy.122.1625848039490; Fri, 09 Jul 2021 09:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625848039; cv=none; d=google.com; s=arc-20160816; b=iu7473trcN/aMGxCQG0HqBmUJLFhzjUQ+fYuoAj0OKzSQ5jtFQQMnL/rrI3M8LHm6P jLwnHlCwIC+JGCCwV+eebWVO6modBGvppvn3eUABHH1zFrpBo3V63evBfDSXvyzS2Sae 53onCRmp8nZSrDwktR6ivMEjnKvnf6baeO3mZvR/kmRwEr1qLWpab3Fojy4IO6OdJDXj stiOSBMQoZys9uj2Vk7O1uM1X/Sh2ywYb8qEiin+w6zy4YWJS+yQj7ZVpWHVVK5M/JN6 qVfZjgWnwAgsHumLXUzDVlEuuKdyE5NUrvcclKC4fGBk7w0APEdv/zy6PuetRUz6PnE7 ILzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DYCJdfctqdnB1es+/Glmfpajthoe9bagqqC+VUhISx8=; b=fZuugYJWd5a4Y0cNGDViGexS3BwcECtjc9OVXLWUqxwpRpfE/7guX7QsZ0OHwsBLNr SbeJzUPBqvX3dsn8DDi14S3cahqF4L+GWoVs7cShujwNReHLQ2XjzMizRZX73njMgXoR 8y2d7HMz1PgZawfmYuQntP0QRix0oh4YvbDMjUB2zAoqCuqvgnHF4OQaUDuqm5SweOxu m9gtK8fG32B1O2p1LD0zv6kQz2C/L7XJb+uvTipJNNrjvTinhbXHgoZjbdSqMpU7u+5L yN3Dw59QW+L8vprJl4PpgYHjEfk/kSkGF5TJK2I+/5eOPvdcAukmNoUFfpfVWoaIbzQZ U/VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GzssWKhq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si6644355ejw.102.2021.07.09.09.26.55; Fri, 09 Jul 2021 09:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GzssWKhq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229546AbhGIQ2j (ORCPT + 99 others); Fri, 9 Jul 2021 12:28:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:57182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbhGIQ2j (ORCPT ); Fri, 9 Jul 2021 12:28:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D2D9D61209; Fri, 9 Jul 2021 16:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625847955; bh=Un/4gy3/N+IE7EepqqCaGuWR/s9N9vQBl1fW927WYI4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GzssWKhqrkloCWwaM/eHvG7tOn8yQG7uccWmpmJF8nHdjbkBQb0Nyd0TBMuIkXTxE W1S4vyhQAsgzF9St06Gqg8UOtSiIzz8t+TURxozqaPMyymgFX54Mkvgvm7jfF/ISGP XIKJdCZyY/bp5pZXkHN2bAOYGKtJnmH4AgiahzfOV9ds1aOBKVXSNwj7u/um0OjVRS yR7RucS2jVX0K0IeSdhLzPYKdu5KHev6BaftQ6OHwV4SBOHJgwPvkYWcZm8cdzRBsW FZ5EwTnS010mOudYxSdT/GNaBj+DacD5FZrEtXshDFYF0lMm6kSInb3wfcBWyZXLwK IOxIsCSOuQzUA== Date: Fri, 9 Jul 2021 19:25:51 +0300 From: Jarkko Sakkinen To: Dave Hansen Cc: Reinette Chatre , Shuah Khan , linux-kselftest@vger.kernel.org, linux-sgx@vger.kernel.org, Borislav Petkov , Dave Hansen , linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] selftests/sgx: Trigger the reclaimer and #PF handler Message-ID: <20210709162551.lqfkwusnarh7ugse@kernel.org> References: <20210705143652.116125-1-jarkko@kernel.org> <20210705143652.116125-5-jarkko@kernel.org> <715ed555-5044-6fee-1d09-1c4cfa827af3@intel.com> <20210706235016.uucukyrr3ckk57pi@kernel.org> <16505466-e001-c4b0-ec41-5384ddcf194b@intel.com> <20210707091736.6wzemgmtzuegk3uf@kernel.org> <10664754-7e53-d9d1-f00c-f9dbd4a2d877@intel.com> <20210707205019.6jy64s4uqcw65q4h@kernel.org> <15d563b8-ad41-76c4-a645-ac5c739d6cce@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15d563b8-ad41-76c4-a645-ac5c739d6cce@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 07, 2021 at 02:20:07PM -0700, Dave Hansen wrote: > On 7/7/21 1:50 PM, Jarkko Sakkinen wrote: > > There is consistent known behaviour how reclaimer and also the page fault > > are exercised for each test. I think that is what matters most right now > > that the basic behaviour of both the page reclaimer and page fault handler > > gets exercised. > > There's also a lot of value to ensuring that tests can run _quickly_. > If you have a test that fails one out of a million executions, it's a > lot easier find and debug if it takes 1 ms versus 10 seconds. > > In other words, I think I'd prefer if we run two enclaves in each > execution of the selftest. One can be as small as possible. The other > can be the reclaim-triggering one. > > That's good both for test coverage, and it makes it a *bit* more > straightforward to hack out the reclaim test if you need things to run > faster. > > The pkeys selftest isn't a bad example here either. It has a couple of > different "malloc()" options: THP, hugetlbfs, small-page mmap(), and a > bunch of tests it runs on each type. As we add more SGX tests, we might > end up with "do reclaim" just being an option we pass. Even with large EPC's, the current test runs quite fast, because heap is left unmeasured. It's the EEXTEND operations that would cause a major slow-down. I would go only to something "more complex" when the current test hits the roof. I don't like to make code more complicated, when that does not happen. When there's no compatibility requirements, it's not hard to refactor it later on. /Jarkko