Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2660965rdb; Mon, 12 Feb 2024 11:59:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFK9JmzVkw10siZ63UPSJOBwQ5LxPpCg2w4V2R69xLJ24W9SM+8iDs5wVyN1iXIEFFJnrSX X-Received: by 2002:a05:6808:398f:b0:3bf:cd51:b8d4 with SMTP id gq15-20020a056808398f00b003bfcd51b8d4mr13249972oib.11.1707767954907; Mon, 12 Feb 2024 11:59:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707767954; cv=pass; d=google.com; s=arc-20160816; b=dRHK9xPly0kwvsF0l2kb9Y0Tt8qyHIe5r7zXlsF5TgRpHY9SsG+R2oxvG7eYqrgtEQ asm7Xd2GYg6L5hgk67UTEJ/b8LUPLSyhn+1vzSDSZrHCtjrNjkAEumOQ8KMrnsLf32E3 I5zjTHvkYOr29WwQjGE0I2oY8OFS9nBwmjKcbmHP9A5uHh/KRaf9IHApoD+DC8XuL4ms RWrBTZTxpfEkXo8j12SEcGQJCa3rYizFBwl38s7EjsDwmPx+kyfteOObp9hy/SzQOAS4 ci6N8slyk/PcfAzguuQscuRBflQt9zDUtCNCrJSQ3pN/E6EJU7whODGrgF4Jww8OH3uY rxCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=vGvl6PhSpluLFBRiIOmvYMHmObyYB3dpbTcBJelM/6Q=; fh=3/mvqBxFT0E4NOjxczJHj1T7ML0FEtXDzqCFJtiIy+4=; b=rQf16Rswxzm6DntZrPFfGybapgKrRXJo0is8p8bV/Vfor7z2uw3bbypwdZcPTpErA+ m+XDmwo/IIqO75ij8uXwMc8v0gFC8+Z2d0yvNdRfzx2wcSvHpk1nJ7BYSwkFrugtHb8R GtoYYgplhNjUIdtTXyZiKw9WN0SQ3eXdgDMJE2Q2T47Nwg43z1Y4aCkeIRLu3rDoFmdb 4llRmt2KhVPVRfufZwXaqucXpn6f8k9bEVt456xZaDsK+Xe7pg9xsRNzkb2BoYCB9E13 nf546cRXNqZvsQfoAPsL4GRg/VnQ1HKqx86pe6jnVKVWaFdbGTFtFtPmQWQ+yQz6wOGR KUpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FV2S7L0n; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWTJUj/EkjLyb1DAV67JLVlDNyAsEISib0weTNzsashXAasz1VhK8yHJRtiMW51PutnIv5xltvbC5IvKz+Y1YFAcRnlAYoFv8VY5iFGrQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b8-20020ac85bc8000000b0042c4cbe76aesi1260932qtb.302.2024.02.12.11.59.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 11:59:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FV2S7L0n; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 A457C1C21CF4 for ; Mon, 12 Feb 2024 19:59:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEF4747F6A; Mon, 12 Feb 2024 19:59:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FV2S7L0n" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDCBC46435; Mon, 12 Feb 2024 19:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707767944; cv=none; b=TddtHNIrpktRdWcYcQOYOu/S88epkI943eI0w2CJSu+zKf5AQRAy+DiX8kLgP/tp3IOM0BONoCrUQIOje3XFu32+NLJGIdVlDATpYeHHbj4+1+6/7nS/mTmxRJ6W6ICpyuFswbdT+r/4W8Dut1FSIWk1KanYlr6D2+Ru8yZ6fd8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707767944; c=relaxed/simple; bh=r8S/sbIq2+trVDIDyjR/VHgzjICcRo23QMsda6iYpfk=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=HOlxMmi4rXLnez9KuOFmPK/2h7B8d+sEUlp6EKUckMBOViKDO33IBuAY9WFqGTvSm78voyMSEUEPMiL1/v2ntRAmpbV1CG8qrcn9uIkwQDGmT2LPAXfYONI5Fw+7eIns3sFLMGqbW4DwUPPqQkSQBTQxloIEF2F3Zwb0u4NtUU0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FV2S7L0n; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BE52C43390; Mon, 12 Feb 2024 19:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707767943; bh=r8S/sbIq2+trVDIDyjR/VHgzjICcRo23QMsda6iYpfk=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=FV2S7L0nDFE2yfQnloBYTUlUjVyBRgw9vTy54dqn5UTflrxuJwX46jmL4i07inaf0 FmczWV5V82RukiWZyujS/YuRWViV/7kBgtqI2oIGc9dr44gjfrysnREfu3Ud71AVwO wrV9IKAsalHUUsPWCpBy87CAkEFtwzD0zBPZsshasC8giOTayIaAlufIyQp+zGsGE/ M1Hik2uj6jTpsDcM9QziQc81GnXp6rb7016VwRC5X+6pnxZzaihdUHDrIXQXrOtWtx l/OHzF2/1W/DTE+SJStJ+oqf6rImSy5kijTlE2QcjGGtsIrIYuKF4KIHsK/SG/Ys7F QnwNoOLm/1ybQ== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 12 Feb 2024 21:58:57 +0200 Message-Id: Subject: Re: [PATCH v9 12/15] x86/sgx: Expose sgx_epc_cgroup_reclaim_pages() for global reclaimer From: "Jarkko Sakkinen" To: "Haitao Huang" , , , , , , , , , , , , , Cc: , , , , , , , X-Mailer: aerc 0.16.0 References: <20240205210638.157741-1-haitao.huang@linux.intel.com> <20240205210638.157741-13-haitao.huang@linux.intel.com> In-Reply-To: <20240205210638.157741-13-haitao.huang@linux.intel.com> On Mon Feb 5, 2024 at 11:06 PM EET, Haitao Huang wrote: > From: Kristen Carlson Accardi > > When cgroup is enabled, all reclaimable pages will be tracked in cgroup > LRUs. The global reclaimer needs to start reclamation from the root > cgroup. Expose the top level cgroup reclamation function so the global > reclaimer can reuse it. > > Co-developed-by: Sean Christopherson > Signed-off-by: Sean Christopherson > Signed-off-by: Kristen Carlson Accardi > Co-developed-by: Haitao Huang > Signed-off-by: Haitao Huang > --- > V8: > - Remove unneeded breaks in function declarations. (Jarkko) > > V7: > - Split this out from the big patch, #10 in V6. (Dave, Kai) > --- > arch/x86/kernel/cpu/sgx/epc_cgroup.c | 2 +- > arch/x86/kernel/cpu/sgx/epc_cgroup.h | 7 +++++++ > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/cpu/sgx/epc_cgroup.c b/arch/x86/kernel/cpu/s= gx/epc_cgroup.c > index abf74fdb12b4..6e31f8727b8a 100644 > --- a/arch/x86/kernel/cpu/sgx/epc_cgroup.c > +++ b/arch/x86/kernel/cpu/sgx/epc_cgroup.c > @@ -96,7 +96,7 @@ bool sgx_epc_cgroup_lru_empty(struct misc_cg *root) > * @indirect: In ksgxd or EPC cgroup work queue context. > * Return: Number of pages reclaimed. > */ > -static unsigned int sgx_epc_cgroup_reclaim_pages(struct misc_cg *root, b= ool indirect) > +unsigned int sgx_epc_cgroup_reclaim_pages(struct misc_cg *root, bool ind= irect) Now that is an ugly function name... IMHO, be would not lost a lot of information if these would be shortened as sgx_cgroup_reclaim_pages() and such and so forth. No risk for amiguity and much much more digestable code to read. BR, Jarkko