From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32293C3A5A7 for ; Thu, 8 Dec 2022 09:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbiLHJ0k (ORCPT ); Thu, 8 Dec 2022 04:26:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbiLHJ0i (ORCPT ); Thu, 8 Dec 2022 04:26:38 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B45425E3E4; Thu, 8 Dec 2022 01:26:37 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 548BC61E37; Thu, 8 Dec 2022 09:26:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 366D0C433D7; Thu, 8 Dec 2022 09:26:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670491596; bh=TNqJerM9UR1fg07xX3h23a2j69g0XEpwAAYXPgA4ZEI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=s6CZZHIqy2xxLR3jpTBP+mtBdBxj+rY6+ATpzcxHIKjvPsU3xfYS23x1cuKm0NQk+ e968/2VYe1r14ryWx5aHvjSKkXQ4zjUGk7Hgtk/Hzv8hDAuO+++M1V1bQydOn6A/N0 2W/r+n3CWFatZLQsHsAuP4sjEd2PJlz+jkd6B62gzFpcAeYYBeoKWUqbWjvfnZ1ni7 yF2MmE2sGvH57azEdUviynHwYkog9ABiYbMYnpbBLFPbzauFUeeOsRoXkF+ATDOjY/ aDptE0IvKxRc/b5rhT68YTFEMuVzo7jJ4aXGihkgIMomwPzb5CTZeY/8KO3gUGZwM9 zquRZ/oh754XQ== Date: Thu, 8 Dec 2022 09:26:32 +0000 From: Jarkko Sakkinen To: Kristen Carlson Accardi Cc: dave.hansen@linux.intel.com, tj@kernel.org, linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org, cgroups@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , zhiquan1.li@intel.com, Sean Christopherson Subject: Re: [PATCH v2 08/18] x86/sgx: Allow reclaiming up to 32 pages, but scan 16 by default Message-ID: References: <20221202183655.3767674-1-kristen@linux.intel.com> <20221202183655.3767674-9-kristen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221202183655.3767674-9-kristen@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 02, 2022 at 10:36:44AM -0800, Kristen Carlson Accardi wrote: > From: Sean Christopherson > > Modify sgx_reclaim_pages() to take a parameter that specifies the > number of pages to scan for reclaiming. Specify a max value of > 32, but scan 16 in the usual case. This allows the number of pages > sgx_reclaim_pages() scans to be specified by the caller, and adjusted > in future patches. > > Signed-off-by: Sean Christopherson > Signed-off-by: Kristen Carlson Accardi > Cc: Sean Christopherson > --- > arch/x86/kernel/cpu/sgx/main.c | 25 +++++++++++++++---------- > 1 file changed, 15 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/kernel/cpu/sgx/main.c b/arch/x86/kernel/cpu/sgx/main.c > index 83aaf5cea7b9..f201ca85212f 100644 > --- a/arch/x86/kernel/cpu/sgx/main.c > +++ b/arch/x86/kernel/cpu/sgx/main.c > @@ -18,6 +18,8 @@ > #include "encl.h" > #include "encls.h" > > +#define SGX_MAX_NR_TO_RECLAIM 32 SGX_NR_TO_SCAN_MAX BR, Jarkko