Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3954290rdg; Wed, 18 Oct 2023 10:25:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGrCBgu4016gu3iocb+ZWQu7WKJg+dvhfikDR/vRMK5+Lw7s685DDsr/VJdaOms3NRSq5x X-Received: by 2002:a05:6a20:3954:b0:171:48a1:a85a with SMTP id r20-20020a056a20395400b0017148a1a85amr6332055pzg.23.1697649905175; Wed, 18 Oct 2023 10:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697649905; cv=none; d=google.com; s=arc-20160816; b=NXLUH4HPNg6LSMJ7gLc/LC4fMoN9fV56dyKVIa9prdA11jY7FnDFnCgEMS10jnaK7V P98pCsYcNO3Yd11+nrL+tagXlJUdLz86Jjpr74hfU2dX7tsoFu/o1RHf6MLzSzP3ax+2 iUxF6Yg1qRd+3RaAeM5o9cKHWSIws6efthZcABZ/47tkhtnGdmAJqBDQvMBBRbnxg5Hk rGKSAj7JdV4iEPC8Kip8r27CngVajMcHke5/AtdnbdXBUrpbk0NomNlOtr9/Yr4+iAQ4 XpPdZ4ZMuODQHjO7RKxEGJXFacajbCjfEs1qJyBjmDX/B+M9RxFntf6vaUXi3yYTCbad xBlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:message-id:organization :from:content-transfer-encoding:mime-version:date:references:subject :cc:to:dkim-signature; bh=DLS7BP21tRCSjK9GVtphd057YOnHG9Pf6JXrWlhj3qc=; fh=sPpfUYm95IwChWjWzUGsbEQT4UeUm/Xgnb4r5ebnlvY=; b=0xK2xF2tmMPUAS51T0WeAONyF6cHm5KZagaFW8gyGfCssmcr3yRC4OJAOU8q+WERfG KcqGaQFwVHCunu9JfiLDe2tXW1+4ECVLTEQWUhmGvh9WqxCPfgZKWRdhPQj0Oe3VEMh7 4gmiqLf/G21wgQnofMwGYiLHEJmIHhxP3yOznHu7aczp3XpZmo+TrXNPq0kgmZAfPVn3 cFRY9lbypxlO+KfTrM6weMAI7hZ/9cEgM6zE6X9hyJsuv49e9ju5YPu6rwiVhQfQcfyM HiiOrPfTjbrRUKg7OyT95MnHx/jlvovM9YPEDZtiV81ocIUWWBysmL6sdDuFJA9NiVDN MRcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JgmRUzCl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id 129-20020a630087000000b00565f0e9cfbbsi2581430pga.382.2023.10.18.10.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:25:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JgmRUzCl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4EE9C8023A9F; Wed, 18 Oct 2023 10:25:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230281AbjJRRYZ (ORCPT + 99 others); Wed, 18 Oct 2023 13:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231754AbjJRQZh (ORCPT ); Wed, 18 Oct 2023 12:25:37 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEFD711D; Wed, 18 Oct 2023 09:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697646335; x=1729182335; h=to:cc:subject:references:date:mime-version: content-transfer-encoding:from:message-id:in-reply-to; bh=3SzZhMSgWPufMQv3UDQZF8yioB50y/KqV65kuToF9No=; b=JgmRUzClX6MKH0AEVqBGTXpTtU7/rKrOw/bMSsiMHE9Tz5bt5FcU8kiE +vetL7brflYzmYNbgOqaO/9CCfRZs85bkDNMQvrvzSuIq7qmbb5sD239A MrxKtI4stKJtbvaAiGaCejVDd0+hicAPruhDD2bI7ZZnrVQ45DxBMsaVM KFTpMUubFMMsWJfSANPGHRAhvqEiVWA5/e5tyL6/KUQ6Iye7WVDEnv018 enPnsS0iRtTm2PnRVjccyTonw0OjUpMhbipbxV6QHTXSQVPIVYhx/ty5C brp1J7+lPCQQOGXrhbDyvcNhc0AXdy05Zd/eGfsOf8Gsiqs4QyqZi8jCc w==; X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="366306231" X-IronPort-AV: E=Sophos;i="6.03,235,1694761200"; d="scan'208";a="366306231" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2023 09:25:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="756643245" X-IronPort-AV: E=Sophos;i="6.03,235,1694761200"; d="scan'208";a="756643245" Received: from hhuan26-mobl.amr.corp.intel.com ([10.92.17.92]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 18 Oct 2023 09:25:29 -0700 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Dave Hansen" , =?iso-8859-15?Q?Michal_Koutn=FD?= Cc: "Christopherson,, Sean" , "Huang, Kai" , "Zhang, Bo" , "linux-sgx@vger.kernel.org" , "cgroups@vger.kernel.org" , "yangjie@microsoft.com" , "dave.hansen@linux.intel.com" , "Li, Zhiquan1" , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "tglx@linutronix.de" , "tj@kernel.org" , "anakrish@microsoft.com" , "jarkko@kernel.org" , "hpa@zytor.com" , "mikko.ylinen@linux.intel.com" , "Mehta, Sohil" , "bp@alien8.de" , "x86@kernel.org" , "kristen@linux.intel.com" Subject: Re: [PATCH v5 12/18] x86/sgx: Add EPC OOM path to forcefully reclaim EPC References: <35a7fde056037a40b3b4b170e2ecd45bf8c4ba9f.camel@intel.com> <915907d56861ef4aa7f9f68e0eb8d136a60bee39.camel@intel.com> <6lrq4xmk42zteq6thpyah7jy25rmvkp7mqxtll6sl7z62m7n4m@vrbbedtgxeq4> <11413ca0-a8a9-4f73-8006-2e1231dbb390@intel.com> <7a1a5125-9da2-47b6-ba0f-cf24d84df16b@intel.com> Date: Wed, 18 Oct 2023 11:25:28 -0500 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Haitao Huang" Organization: Intel Message-ID: In-Reply-To: User-Agent: Opera Mail/1.0 (Win32) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:25:02 -0700 (PDT) On Wed, 18 Oct 2023 10:52:23 -0500, Michal Koutn=FD w= rote: > On Wed, Oct 18, 2023 at 08:37:25AM -0700, Dave Hansen = > wrote: >> 1. Admin sets a limit >> 2. Enclave is created >> 3. Enclave hits limit, allocation fails > > I was actually about to suggest reorganizing the series to a part > implementing this simple limiting and a subsequent part with the recla= im > stuff for easier digestability. > >> Nothing else matters. > > If the latter part is an unncessary overkill, it's even better. > Ok. I'll take out max_write() callback and only implement non-preemptive= = misc.max for EPC. I can also separate OOEPC_killing enclaves out, which is not needed if w= e = only block allocation at limit, no need killing one enclave to make spac= e = for another. This will simplify a lot. Thanks to all for your input! Haitao =