Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1847688lqe; Tue, 9 Apr 2024 02:03:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUx8PTxzwF7SMMUwTc00CZypYOf1KP55Y4Yk012GLAgqG90VxuNGyPB/6HSqeLQnIW/64HSxICoHiMBz3xn2Sd5yUJlNUnSWD5xKPwi3g== X-Google-Smtp-Source: AGHT+IF0CCojDIl9wvNhlGqprFsILoocS5gc3+g3MsX0/Cz0hzpellXNK2/4qgPw/3BkoFQVc7uz X-Received: by 2002:ac8:7f0a:0:b0:434:8ab3:c11c with SMTP id f10-20020ac87f0a000000b004348ab3c11cmr5959466qtk.48.1712653423044; Tue, 09 Apr 2024 02:03:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712653423; cv=pass; d=google.com; s=arc-20160816; b=XYdD3YnuIoZvIylEK/u2+MeTkSUY0Uxc4wMBiwCweb4MLc0Qo+WwCDi9aQUe8lpCbu f0GabfnebcsDWoqqixD39wUD6RhqRigmw4uXKuA+ZHwV6SX5DlXveaRnMds730zAEb8A MruIOtJVh12lOJa0WUVhYaPUgH+do6VfSLL4VL0V139FrZmtxkFU0UBAZcWw1uBRGYHk DOHpjLDZ8mq9llEmcTJJCj1XusIv/I6hsR8jzD94Ti3yDX4W562AxZvIu6QnOVrLLyZV DnzpegXoA+tyz/CKMEvRNAgy/D9cMfMqxN3m4ne+eqLLiw/cFzLpC/hjuRwhZF20Y//L InlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=NvyrWquLz7geaixcVsAUQI3Ex1g1XLIRXoJG2iDV3q8=; fh=OgQHmoRRP1PoGckTEsZ2BVZrr2Wc1EGluSrnJM4rsmA=; b=koc6kyeWxo6sLpi4CUAbpoW0k31HP7X4lzxeIjITv3/EjHiyjaZfu+wdwT/FAbj9Y6 WAdzm8HZkuz1Cu4j7eSfAwFEwZZASMrucLXoEc9ZiexWw7SMK7gT2+5DJH+H9n0t4EfQ SdHDP+jDnIoOP/X3iE2BaJ4wmg80v6RmJPRDVZlh0On4UQqgneUfS32PPdP7akGDogJV 4Dh5r+GvJMy0J1T13EE/UmMPOYSBcqLU7LIqu1Sp6847sVZznTTFHy20qEIjwugzgTOd 4MHg9HtlbJpQCWDUTnzFynSdgdjlrfDGqlHenLNCI5O5HVVzK9UHNc0hBGJwSq6AUeTI FfZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="LFKFhsR/"; dkim=pass header.i=@suse.com header.s=susede1 header.b="LFKFhsR/"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-136517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j22-20020ac85f96000000b0043489afbd7dsi5214830qta.109.2024.04.09.02.03.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 02:03:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="LFKFhsR/"; dkim=pass header.i=@suse.com header.s=susede1 header.b="LFKFhsR/"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-136517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B700E1C21CF4 for ; Tue, 9 Apr 2024 09:03:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C87C27EF04; Tue, 9 Apr 2024 09:03:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="LFKFhsR/"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="LFKFhsR/" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06A027E580; Tue, 9 Apr 2024 09:03:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712653411; cv=none; b=ngsl4Li6bbPBswnbvgk0kfGdMbE9T9ZKoCs2fu7dWd+0qydLrZNfGgAca4wmJTQUdVo7sxunOlcOJN8Ls16p2lnhursKqbIdvjV2nm6x1qE1okegDFICcG8/aHUciRgRiM8qif5p9udCZtBeNuwcY7VsHMB/Muc7TQPc9N8U7tY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712653411; c=relaxed/simple; bh=h2kiHo+GgQz/ZCISfMuUvv0y5uUfdVCdxMdXR1Xy7zs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iVQmGUUbuSnqpx92bVQXPqxcyN4znPMQAoG9+TdWpiHY+6fnTypMhwn9PhQkJZGX+pZosX4WTOkId4jS2zCiDrMHzlDSYQGOZAZv9vz04viEPdotUp8ujzEWrRomZ3MOfpCDiIB1W+YQDCF7z7H86Bb/hoH+vyQ3cpTu2osw9KY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=LFKFhsR/; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=LFKFhsR/; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 21BA622C8E; Tue, 9 Apr 2024 09:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1712653408; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NvyrWquLz7geaixcVsAUQI3Ex1g1XLIRXoJG2iDV3q8=; b=LFKFhsR/O3HPCXRLhG6lA9hzbnDne02ClR7rfW/zzyLDNHsX6Qwj3M+hs/tUx61xlnR/Pm KeIJWt+2wkYO1tAV8a1eNsHwcvNjS98Nl6wgFhT2Kfh+9/rSDgoDywHh+5CQDTfmilPXkb 8P/1X9iKX5h8BmVwPKjyGM/CXN0muzk= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1712653408; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NvyrWquLz7geaixcVsAUQI3Ex1g1XLIRXoJG2iDV3q8=; b=LFKFhsR/O3HPCXRLhG6lA9hzbnDne02ClR7rfW/zzyLDNHsX6Qwj3M+hs/tUx61xlnR/Pm KeIJWt+2wkYO1tAV8a1eNsHwcvNjS98Nl6wgFhT2Kfh+9/rSDgoDywHh+5CQDTfmilPXkb 8P/1X9iKX5h8BmVwPKjyGM/CXN0muzk= Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 095811332F; Tue, 9 Apr 2024 09:03:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id 5FoaAmAEFWaaQAAAn2gu4w (envelope-from ); Tue, 09 Apr 2024 09:03:28 +0000 Date: Tue, 9 Apr 2024 11:03:22 +0200 From: Michal =?utf-8?Q?Koutn=C3=BD?= To: Haitao Huang Cc: "hpa@zytor.com" , "tim.c.chen@linux.intel.com" , "linux-sgx@vger.kernel.org" , "x86@kernel.org" , "dave.hansen@linux.intel.com" , "jarkko@kernel.org" , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "tglx@linutronix.de" , "Mehta, Sohil" , "tj@kernel.org" , "mingo@redhat.com" , "bp@alien8.de" , "Huang, Kai" , "mikko.ylinen@linux.intel.com" , "seanjc@google.com" , "anakrish@microsoft.com" , "Zhang, Bo" , "kristen@linux.intel.com" , "yangjie@microsoft.com" , "Li, Zhiquan1" , "chrisyan@microsoft.com" Subject: Re: Re: [PATCH v10 12/14] x86/sgx: Turn on per-cgroup EPC reclamation Message-ID: References: <20240328002229.30264-1-haitao.huang@linux.intel.com> <20240328002229.30264-13-haitao.huang@linux.intel.com> <7a21c0de-ba59-4e76-8d67-70957f9db581@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ltmvwvtmhbsdsweo" Content-Disposition: inline In-Reply-To: X-Spam-Flag: NO X-Spam-Score: -5.39 X-Spam-Level: X-Spamd-Result: default: False [-5.39 / 50.00]; BAYES_HAM(-2.49)[97.68%]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; NEURAL_HAM_SHORT(-0.20)[-1.000]; TO_DN_EQ_ADDR_SOME(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_TWELVE(0.00)[23]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[intel.com:email] --ltmvwvtmhbsdsweo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 08, 2024 at 11:23:21PM -0500, Haitao Huang wrote: > It's always non-NULL based on testing. >=20 > It's hard for me to say definitely by reading the code. But IIUC > cgroup_disable command-line only blocks operations in /sys/fs/cgroup so u= ser > space can't set up controllers and config limits, etc., for the diasabled > ones. Each task->cgroups would still have a non-NULL pointer to the static > root object for each cgroup that is enabled by KConfig, so > get_current_misc_cg() thus sgx_get_current_cg() should not return NULL > regardless 'cgroup_disable=3Dmisc'. >=20 > Maybe @Michal or @tj can confirm? The current implementation creates root css object (see cgroup_init(), cgroup_ssid_enabled() check is after cgroup_init_subsys()). I.e. it will look like all tasks are members of root cgroup wrt given controller permanently and controller attribute files won't exist. (It is up to the controller implementation to do further optimization based on the boot-time disablement (e.g. see uses of mem_cgroup_disabled()). Not sure if this is useful for misc controller.) As for the WARN_ON(1), taking example from memcg -- NULL is best synonymous with root. It's a judgement call which of the values to store and when to intepret it. HTH, Michal --ltmvwvtmhbsdsweo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQpEWyjXuwGT2dDBqAGvrMr/1gcjgUCZhUEVgAKCRAGvrMr/1gc jpkmAQDC0m6kfTm0e/ebDdbus7JzB7oXpjF+aa05c4n6JTgMZAD/cof9Y5sOlPGG my7EEJBDBJYKcFgS8YtpUYJdZwjKvwE= =CQHh -----END PGP SIGNATURE----- --ltmvwvtmhbsdsweo--