Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6483335pxb; Tue, 15 Feb 2022 03:32:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJz56sVjAJB/c5lxD71YiVa4npr/j0iSSG/cwOdVa9UqFHZSwa1l4hdI5mUSqqbUZGQCrRem X-Received: by 2002:a05:6a00:14cc:: with SMTP id w12mr3876850pfu.47.1644924730931; Tue, 15 Feb 2022 03:32:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644924730; cv=none; d=google.com; s=arc-20160816; b=oZUJ4bTBMAXG+6izb6OIcbVmJ+z6Wd7bjU3tTpKhsDBynzj55c432zA8p7OXHvbGfZ v8hO2aPXjCeycstRlxLeUW89eMOHg4odVhznRkCVmR/b0hMrMotWtIcbMyrAmR04cUqo 5PwFd/9cbp57Y4s0lA9zxe4VIq5P8GU1aWqwq8oOJK6/yye3rVwpYyFzC3sITjV3JGK8 KWyYASVsg4T7VhTTRuMsNFtFZiQjZqtUmi1ueS6FCahZsUOI/CU8UL5b0AzHTxr3Ew/2 kk+l9NcpIs+6sDPCdNZEtlbjI4dPreARftHyka92CzyfexfObbT4chGGkpwi/XzV+uln PLxA== 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; bh=a/qBNnATTMwztXPFrzgmhmf0HsyI/32/EAzt3X4aDGg=; b=CRlnB/5J8CkN5fVUeLNHd+WbA/QAuu62xri2Wavv3JXTaB4AlSoIT/Gat7b7Yeb/wp ZVaoLfaSqm1x7/uUUrL2JpFqhXaa5UfSDWcbwbUbbkZe/TjOIbO2ErcUh1auxUKSWUqW VGc2Nk222OG+LTHmigFYqUtE7ZtIr8xzfuZJK7H6Mq/JKXCvNMQU6rtLexY02+XoQyml vXP+yMvhMJbwOE6Oj7oJgUFBiklnjvFD/xVs0R/VA1bZ+JEjzINT21x8TeGF/iy43HHd +F8Pe9OwbdyXwgEhA0bFUdX/9yTC3AswDvXzSrcc2Q/JIqX7zsQZ7k58KQ+upgAZ3h2H Qfsw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e4si2358462pjr.179.2022.02.15.03.31.57; Tue, 15 Feb 2022 03:32:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235909AbiBOJze (ORCPT + 99 others); Tue, 15 Feb 2022 04:55:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232892AbiBOJzb (ORCPT ); Tue, 15 Feb 2022 04:55:31 -0500 Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0E0810A7FE for ; Tue, 15 Feb 2022 01:55:22 -0800 (PST) Received: by theia.8bytes.org (Postfix, from userid 1000) id F22B836D; Tue, 15 Feb 2022 10:55:20 +0100 (CET) Date: Tue, 15 Feb 2022 10:55:19 +0100 From: Joerg Roedel To: Fenghua Yu Cc: Thomas Gleixner , Dave Hansen , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Tony Luck , Lu Baolu , Josh Poimboeuf , Jacob Pan , Ashok Raj , Ravi V Shankar , iommu@lists.linux-foundation.org, x86 , linux-kernel Subject: Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit Message-ID: References: <20220207230254.3342514-1-fenghua.yu@intel.com> <20220207230254.3342514-6-fenghua.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220207230254.3342514-6-fenghua.yu@intel.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 03:02:48PM -0800, 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 Acked-by: Joerg Roedel