From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB10FC433EF for ; Mon, 14 Feb 2022 17:24:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357043AbiBNRYv (ORCPT ); Mon, 14 Feb 2022 12:24:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232948AbiBNRYt (ORCPT ); Mon, 14 Feb 2022 12:24:49 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 711F0652EF for ; Mon, 14 Feb 2022 09:24:41 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1644859480; h=from:from:reply-to:subject:subject: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=kA70/BPufwIFD+QWkWEZYMJvcssYHGwiSjUsZ3KLlEs=; b=eUn2vcLrQBcjtPtLYnzSg3MVFxReID3dSowCi2S/RCkhhYKB1Xh2GNzY1dz+T/MdGEX4F3 CQnqjyZiPLQiJfvnPlI5joF/r0ocuCnw3TxaTkKUFGgCmasx5aoQQ40zWnSPdw3wDjKYE5 ljgSPQ7ScF6H6hGr3MxTrYLtvWxw+/Iggtb/iGFSLL+yeFxXWqFRJTbaUi15kamKZleZuI ZMhzTW7G9qZM16yOSekuliNmh+SSdzLgywaOnzmz1WhKAr8wB1PcTSLsVwrkpQwO/wfVi9 nDMS6kUxDB1/0yjqH1zr3o9YSeiS/orCE1aOxug2/UsLPAnZ5o1V+ccfDljLow== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1644859480; h=from:from:reply-to:subject:subject: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=kA70/BPufwIFD+QWkWEZYMJvcssYHGwiSjUsZ3KLlEs=; b=5rLS96djUHvk6cd2KmGq84zNkFHTKuMhbrsdvfp72s+BFzWbABl5PKvYjJWod5ckJVpJsE YILVINJrsg2eH4Dg== To: Fenghua Yu , Dave Hansen , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Tony Luck , Lu Baolu , Joerg Roedel , Josh Poimboeuf , Jacob Pan , Ashok Raj , Ravi V Shankar Cc: iommu@lists.linux-foundation.org, x86 , linux-kernel , Fenghua Yu Subject: Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit In-Reply-To: <20220207230254.3342514-6-fenghua.yu@intel.com> References: <20220207230254.3342514-1-fenghua.yu@intel.com> <20220207230254.3342514-6-fenghua.yu@intel.com> Date: Mon, 14 Feb 2022 18:24:39 +0100 Message-ID: <87sfslqs2w.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 07 2022 at 15:02, Fenghua Yu wrote: > PASIDs are process wide. It was attempted to use refcounted PASIDs to > free them when the last thread drops the refcount. This turned out to > be complex and error prone. Given the fact that the PASID space is 20 > bits, which allows up to 1M processes to have a PASID associated > concurrently, PASID resource exhaustion is not a realistic concern. > > Therefore it was decided to simplify the approach and stick with lazy > on demand PASID allocation, but drop the eager free approach and make > a allocated PASID lifetime bound to the life time of the process. > > Get rid of the refcounting mechanisms and replace/rename the interfaces > to reflect this new approach. > > Suggested-by: Dave Hansen > Signed-off-by: Fenghua Yu > Reviewed-by: Tony Luck Reviewed-by: Thomas Gleixner