Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6063081pxb; Mon, 14 Feb 2022 14:26:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQqjX8S5nTSnG06gHFdfD+mAzMhEtUy8rXC1dKgGC/9L+yWu6Cg5W7CZWU3KD8yrQTMbK6 X-Received: by 2002:a17:902:9007:: with SMTP id a7mr941821plp.162.1644877560676; Mon, 14 Feb 2022 14:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644877560; cv=none; d=google.com; s=arc-20160816; b=cIjrR2p95n2hHimD6uk5ZxkI0tjcqda1qCzFWEvm+RTW9TUzHt9fC27b9qnHMLrDSp 2neebtIwnMUUQ+dt2pjEYjPyNXS+rK69eZ1qne45iMS7MdjbPoPiTFw8qLkxAldDeZgs M9BW2L85TvDTQH5/vHdENf8IjcnbX2Pl4H4j/vom0pIvn5xtV+MRcFYgapholXS/Uvco e09fXZDWIid4ARGawSHTjTo0G6FgGZRGqChYN+cGjeCJaJBPAsx8dEg+y7Pzod8owxP7 GhhU9qBKlHbv0RFTtsNiyMvE5K8ryJ9uzLxJWFUAFFFZOwTMpSiD2m1gj1+M0OmP9KPZ hS7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=kA70/BPufwIFD+QWkWEZYMJvcssYHGwiSjUsZ3KLlEs=; b=tIUSaFEFyg8wFKugQDXUZS+y7S5E62kAYZYIBH4SZWVlYMj7lbTnovrb2igzWb5v5n OT0Jmqhf27HgQ+Sfoetq+amFyfVbdEy2zx3h6phKXuRteXTYCV6Uw3cFrAQu2KzVMf2T K4qKsIGoT9kiMU9g6kg2nYwvrXCruQ+2vlFLbACTWECjy8XwGTLlD1TCmUq49OZvyjZi qQvyjkcGam+f77KRUktd+vQ3cWZ0bl/mpetrtdt5bOM5yBQ+AU9ifPjKaIiQ7GwoEBc6 vBpV9IALUuaPrWYwdaKX2JXA2eOva5w6d0LEdk3QQ4SgfzUF5s/garrjFpsEiiWwK7M/ gPfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=eUn2vcLr; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=5rLS96dj; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c24si15666045pfi.125.2022.02.14.14.25.16; Mon, 14 Feb 2022 14:26:00 -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=@linutronix.de header.s=2020 header.b=eUn2vcLr; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=5rLS96dj; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357039AbiBNRYu (ORCPT + 99 others); Mon, 14 Feb 2022 12:24:50 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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