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 A9DD8EB64DC for ; Mon, 17 Jul 2023 14:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231799AbjGQOj3 (ORCPT ); Mon, 17 Jul 2023 10:39:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229796AbjGQOj2 (ORCPT ); Mon, 17 Jul 2023 10:39:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 340171B6; Mon, 17 Jul 2023 07:39:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C688461070; Mon, 17 Jul 2023 14:39:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CAB7C433C7; Mon, 17 Jul 2023 14:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689604766; bh=jQupSR0cXaId81B1Mtbxu7kk9Li8dlHjg4WKD/ovjs0=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=A9NGmVEsJX3Q0g0VVdhcmbnI6LA5zdNI75Kr/PbREnqbsfYEgd3TMgoBSDx07rAPo claZfcAgKGqqjSbGrRHCRymlCCP7DI7Lri2tjqxlrN0h2sxw6kO+aknAg8oafQpH33 cr49Eaae8sEDtjQFPCYxgLsqym2U5TfuHbqS0aNCZR9OebxfJGkozc1QyoDysBzq0U Xm5cHXOR7aV+dXTGTEF0mxUbKhzVrUK+EpPIlSoqClWYzGeQhxSen5xVxm9gDAZUXK 6RLgAoZ50mZhSl16QJmWDzRaKcBBmPo4y5FhZIhOzK0FKqsOjnIUy9AG8vPXFVVsmG eA++hXcIFxnlQ== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 17 Jul 2023 14:39:21 +0000 Message-Id: Cc: , , "Kristen Carlson Accardi" , , Subject: Re: [PATCH v3 03/28] x86/sgx: Add 'struct sgx_epc_lru_lists' to encapsulate lru list(s) From: "Jarkko Sakkinen" To: "Haitao Huang" , , , , , , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , , "H. Peter Anvin" X-Mailer: aerc 0.14.0 References: <20230712230202.47929-1-haitao.huang@linux.intel.com> <20230712230202.47929-4-haitao.huang@linux.intel.com> In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org On Mon Jul 17, 2023 at 1:23 PM UTC, Haitao Huang wrote: > On Mon, 17 Jul 2023 07:45:36 -0500, Jarkko Sakkinen = =20 > wrote: > > > On Wed Jul 12, 2023 at 11:01 PM UTC, Haitao Huang wrote: > >> From: Kristen Carlson Accardi > >> > >> Introduce a data structure to wrap the existing reclaimable list > >> and its spinlock in a struct to minimize the code changes needed > >> to handle multiple LRUs as well as reclaimable and non-reclaimable > >> lists. The new structure will be used in a following set of patches to > >> implement SGX EPC cgroups. > >> > >> The changes to the structure needed for unreclaimable lists will be > >> added in later patches. > >> > >> Signed-off-by: Sean Christopherson > >> Signed-off-by: Kristen Carlson Accardi > >> Signed-off-by: Haitao Huang > >> Cc: Sean Christopherson > >> > >> V3: > >> Removed the helper functions and revised commit messages > >> --- > >> arch/x86/kernel/cpu/sgx/sgx.h | 17 +++++++++++++++++ > >> 1 file changed, 17 insertions(+) > >> > >> diff --git a/arch/x86/kernel/cpu/sgx/sgx.h =20 > >> b/arch/x86/kernel/cpu/sgx/sgx.h > >> index f6e3c5810eef..77fceba73a25 100644 > >> --- a/arch/x86/kernel/cpu/sgx/sgx.h > >> +++ b/arch/x86/kernel/cpu/sgx/sgx.h > >> @@ -92,6 +92,23 @@ static inline void *sgx_get_epc_virt_addr(struct = =20 > >> sgx_epc_page *page) > >> return section->virt_addr + index * PAGE_SIZE; > >> } > >> > >> +/* > >> + * This data structure wraps a list of reclaimable EPC pages, and a = =20 > >> list of > >> + * non-reclaimable EPC pages and is used to implement a LRU policy = =20 > >> during > >> + * reclamation. > >> + */ > >> +struct sgx_epc_lru_lists { > >> + /* Must acquire this lock to access */ > >> + spinlock_t lock; > > > > Isn't this self-explanatory, why the inline comment? > > I got a warning from the checkpatch script complaining this lock needs = =20 > comments. OK, cool, not a big deal. BR, Jarkko