Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1174969rwb; Thu, 8 Dec 2022 07:34:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf4HTt75LDBAhx8Q5pWIevi/DMiarJR2cu111IucD7D41KUQYq8pUQGHtUnHnMnategP6qxK X-Received: by 2002:a17:906:a08d:b0:7c0:fa2e:13ba with SMTP id q13-20020a170906a08d00b007c0fa2e13bamr12695865ejy.203.1670513657390; Thu, 08 Dec 2022 07:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670513657; cv=none; d=google.com; s=arc-20160816; b=jUIxRo1aBAraEj9pqchjjySt2hOqD7ocSGGhwuMpK2E8HE+m3hmhmUFzZd7Jf2X9m+ XBy2S3eqsSZSlAzLMr9WhpmDjBr2aIATN3L/J/KRib2DergWduUS/Fsd5p/Pzi+ANABy FxLERlpSsLfD1FaFU9OL962D0/1uAJz2IKeh9QFhlDoBcYYthXTkfKFpKiCvk3nudIJL IqyElun4+s9MXjTp1Aznt1F7JQn7b6kYURX+cPY7wolh3P+lWu+2sMlqYS+k4g9CznZK KwYA4SECh69efldmmJnYOI+2n0MPAO0fQ/3j5nEdj1YHWwOC4pVH6NZCkUJ++sjQKxn1 gKAA== 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=+PphC318XpNV6NE3vSiwrRTJshByBWyKUXLnQiDE7jw=; b=rTriyZ5rc0Z6isWsUMkJGW5xkE5oNkqOUANj6Soc7uwrFNDnK2pZXOjKdw7ld4UO9x bzF9a8fGlP1hSW9ooP1miUtK/hkU0uz9QvCsjQNsoZQK2W43No9KwtU9b6Kint8vvKRQ 87X7VQcv1SLGdif9rZp0FoHSRnVDjdzvkOg4FbKkYIxISGINB5mVnIRpXl5d+IZxXy13 CHPbat483Pi+V2YVDPdORAFUec4fwzsu5dgquyh3CUd6IPaK1jeyWd9AEFe0gJ5g7pzA 9gDrCE3pZKAyw+aZ+h/K/cIHLuLd8NnYMDJ7GnLVRpMXy0RVa5Y6dmn1u1Vs08r9Gdtx WnQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BCxpw+co; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb11-20020a0564020d0b00b0046cc0dece7dsi8343886edb.163.2022.12.08.07.33.49; Thu, 08 Dec 2022 07:34:17 -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=@kernel.org header.s=k20201202 header.b=BCxpw+co; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229877AbiLHPWV (ORCPT + 72 others); Thu, 8 Dec 2022 10:22:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230383AbiLHPVw (ORCPT ); Thu, 8 Dec 2022 10:21:52 -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 0E0D53C6ED; Thu, 8 Dec 2022 07:21:50 -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 9F16361F7E; Thu, 8 Dec 2022 15:21:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85A86C433B5; Thu, 8 Dec 2022 15:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670512909; bh=tVhThTBTlto5XgoPkDUpcJfWLSIca0Vm8CQvc7flH4s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BCxpw+coCm32MFSOsv6tLA547eDwyk4iQhTiUW/Ytxds1Zu2n21wyNNnkRPAo/Ldt A2P2emB8IohSGVOuAZDyQ3onEcJTxkkXJcOUswbVaOZuAxfoKxx65R9yLJgsopJBkZ EwvrLquzFwnulvZ2qde9ZHEHmvbnfUEyxE74AIclMW5UI7Du9BESExsk5brwHxJfbL 8Y+SR98pX/6rtfEV3yck316uUZVBoJNwGRgB+XSuud9/61/BzRfGXC5Jq1NOT3RZVX yWMu2AF2a1wNGB3z5CI1Ho5arosZAu8/JM9KpaUyKdUMN81d+MfZzdj22UrUNsPqWI xoHky3O1Tw7uQ== Date: Thu, 8 Dec 2022 15:21:44 +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 14/18] x86/sgx: Add EPC OOM path to forcefully reclaim EPC Message-ID: References: <20221202183655.3767674-1-kristen@linux.intel.com> <20221202183655.3767674-15-kristen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221202183655.3767674-15-kristen@linux.intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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, Dec 02, 2022 at 10:36:50AM -0800, Kristen Carlson Accardi wrote: > From: Sean Christopherson > > Introduce the OOM path for killing an enclave with the reclaimer > is no longer able to reclaim enough EPC pages. Find a victim enclave, > which will be an enclave with EPC pages remaining that are not > accessible to the reclaimer ("unreclaimable"). Once a victim is > identified, mark the enclave as OOM and zap the enclaves entire > page range. Release all the enclaves resources except for the > struct sgx_encl memory itself. > > Signed-off-by: Sean Christopherson > Signed-off-by: Kristen Carlson Accardi > Cc: Sean Christopherson Why this patch is dependent of all 13 patches before it? Looks like something that is orthogonal to cgroups and could be live by its own. At least it probably does not require all of those patches, or does it? Even without cgroups it would make sense to killing enclaves if reclaimer gets stuck. BR, Jarkko