Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2723656rwb; Fri, 2 Dec 2022 14:09:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf6jjSo4Az789dwmFE9c46ssuY1GflfseEZDzEuZsNffImffxmKFp9uKWq7p/HjeyI26VxQr X-Received: by 2002:a05:6a00:11:b0:574:e01e:970e with SMTP id h17-20020a056a00001100b00574e01e970emr34113608pfk.20.1670018982332; Fri, 02 Dec 2022 14:09:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670018982; cv=none; d=google.com; s=arc-20160816; b=TJLHCXuWPMXUGr5T7rTQ30bD1PHTI1g5Wep830SR7lNLQwRqlJkUMpx66EPvoCjTi/ VWH6H8zWNP2BaWkKCUtPJ9iC8dVXmja0nVS0i9UHC/NX65lGAOLLEr8MKfRmU1G7hstN po7usDeVfPfJ9jPV2dL96DCsdOH313dQTPiYQzlojG6WNac5KJlQy/aE6mFBMTmVfSGF nYt3ovSn1Au/Wa7OHZk51sUbMxJDcggsd5ZKRn5Ef2LIk8uDL0t9uiRWleKIg20w8QJc dkeog5xSpuP7Hj/IxQD42J/OIFO+fMZXFEe54KMVZ1jY002k0H9L2Zdq5x6sFoR69PVR sQ7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=9f5KbostxEAV+RFNf4XG1ooSo6jjgGnVqXRgip8PujU=; b=qXOTBKPsURVWLNHxpnzP28dLbakk6/P/PvWLL1dQLCh1+ba9rkrkk2nS+NVf7PZWEl Wt2meRTklJGnySooYn6Tqk8khaWZzDJ4Ujk99LOBTRpExAtYEhHfTtyPAQ4Y50FAYTs9 wTaYbswqhVq11IkuYoSwLWuHZGOlJ/yNa+ZIgqQbk8cnb9Rrq7w5NTvsr1JwgXGk1oRB iXB/B0MMwktsGrdxLxHeAKYoMPtDVzUORullMzkjOBP+XZQY6AfxqmRajeoEjPfJS7pp G1ZibasUIPVgUNQ9HORsBjfJZxiZVSEhdV0qMPdivoisx386NgfCBF85Bh3Wo2n2+E76 9lzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cowQvwtR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jd2-20020a170903260200b00178b88d40ebsi7914621plb.51.2022.12.02.14.09.32; Fri, 02 Dec 2022 14:09:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cowQvwtR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234211AbiLBVvQ (ORCPT + 83 others); Fri, 2 Dec 2022 16:51:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbiLBVvP (ORCPT ); Fri, 2 Dec 2022 16:51:15 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F4B1CB23D; Fri, 2 Dec 2022 13:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670017874; x=1701553874; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=9f5KbostxEAV+RFNf4XG1ooSo6jjgGnVqXRgip8PujU=; b=cowQvwtRqxGF4Xhh04eCkEpfUl6emsRYD7OiGf1GWdJnyp+qwN+87jIs dRu6S418crjqxm1hVaAnPMgZK2LzfZWTs6RjqL0RXhJmmIl2X8fb5cUzU I+LC0Wk3HO0I5evZqkZ66EBl3iUiNwRIagKZ7UAbNCVSvJe5ByeA5DLEv ylKhZ97LRPjtKFJhc9GR/+tIJBFMzg5xmGd3b2QF07jHpDAQf038rLBuh 77XC5/4PsYFYAte+z5+EftrvJ/Ivi6PmyRsJzelwPNQlcUc6klWSguR8K JnYET/eJfAbe9QSeNX+7QT1AXol199Jc88f7v/76loR37YIiA610ztbJ9 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10549"; a="317199289" X-IronPort-AV: E=Sophos;i="5.96,213,1665471600"; d="scan'208";a="317199289" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2022 13:51:13 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10549"; a="787440141" X-IronPort-AV: E=Sophos;i="5.96,213,1665471600"; d="scan'208";a="787440141" Received: from kcaskeyx-mobl1.amr.corp.intel.com (HELO [10.251.1.207]) ([10.251.1.207]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2022 13:51:12 -0800 Message-ID: Subject: Re: [PATCH v2 04/18] x86/sgx: Use sgx_epc_lru_lists for existing active page list From: Kristen Carlson Accardi To: Dave Hansen , jarkko@kernel.org, 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" Cc: zhiquan1.li@intel.com, Sean Christopherson Date: Fri, 02 Dec 2022 13:51:10 -0800 In-Reply-To: References: <20221202183655.3767674-1-kristen@linux.intel.com> <20221202183655.3767674-5-kristen@linux.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2022-12-02 at 13:43 -0800, Dave Hansen wrote: > On 12/2/22 10:36, Kristen Carlson Accardi wrote: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0spin_lock(&sgx_global_lru.lo= ck); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0for (i =3D 0; i < SGX_N= R_TO_SCAN; i++) { > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0if (list_empty(&sgx_active_page_list)) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0epc_page =3D > > sgx_epc_pop_reclaimable(&sgx_global_lru); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0if (!epc_page) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= break; >=20 > One other nit about the structure of the patches: This introduced > *both* > reclaimable and unreclaimable list_heads.=C2=A0 But, it has zero use for > the > unreclaimable ones during the refactoring here.=C2=A0 I probably would > have > left out the 'unreclaimable' bits for now. I know - and originally the addition of unreclaimable was added later, but when I posted the RFC I felt there was some misunderstanding about what this data structure was and how it would be used because the addition of the unreclaimable bits came later. So I stuck both lists in one so it'd be a better view of what the data structure would look like. >=20 > BTW, this is a nice sign: >=20 > > =C2=A0arch/x86/kernel/cpu/sgx/main.c | 39 +++++++++++++++++------------= - > > ---- > > =C2=A01 file changed, 19 insertions(+), 20 deletions(-) >=20 >=20