Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2746634rwe; Sun, 28 Aug 2022 21:54:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7IJrHe9KiVveIsuITsq7Uzuze1O7ihmTREDMp48ZsWfojNKlQZIWZo893irAdGoq7x1JAF X-Received: by 2002:a05:6402:c45:b0:442:c549:8e6b with SMTP id cs5-20020a0564020c4500b00442c5498e6bmr15162540edb.123.1661748843685; Sun, 28 Aug 2022 21:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661748843; cv=none; d=google.com; s=arc-20160816; b=KBsK5t6ZiAgY77xiKW554BPeMDFOb/elyayvZmzT8qpfde/Kq18PSw1eN35CKpcPqj 1ROOIbcg5a3Y3SXch6pkybqB9z7QEHbNs5qJ/j2D6dLPMziOsSwt9Sw/HK3BQ8YeJKPh /EW2jMk0yIlquW6E2WPz8xtooeO5mpFnOE/2NsVMIy68o0IeXcILA4y2Z3QMmyw1fV+y tAoiB2a/AeHCiDMdCbG7QFZUS1u1K7j1M5ZBZ38bAmO3Lxelk4qJCzCiryR0quQgq/Pv 94QRHTwpat8NjEYJO9artoMy1ny3ZkSBVbwvbaMG1aTCRHHb+coEGAbdvLfwaX9L27+h 402w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=ZF8+nVWTaoMqvA20juCLYalvktzKtJc3JGLpjKX3FBk=; b=b3gM8qG/ph4p2jyCv6kTWS8YPTKK8ZR/1eITJZcXSN4kXOCo+80LJf/PHAwUykPwqR oR9WlS7gOZ0SmnDyTPE82cEd1NUqzrNIENA2yewatISyqgyHxmfH0TYz9ulYcNeTvYEr l2B1h1edpL5s7c29ftp3PWauTL7FAFy4Tbxoh2lZKWRhLK5mtSkxKXAztqXSXDKQypro 3WY25D4FvqNK2a+zTK8I9H5Hg/OM23RdsxjsGMCoviM28vC215+otm1VmwGFNcIyPUzV tXSp/zfhlUxlnVU8HmjRJFdddDFdUmslSS4WgTJYUB9oudUJJ1AZSr0KIjS2A8w3z12+ Fi6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BaiPprdC; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ej7-20020a056402368700b004482385b6ecsi3722032edb.64.2022.08.28.21.53.38; Sun, 28 Aug 2022 21:54:03 -0700 (PDT) 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=@intel.com header.s=Intel header.b=BaiPprdC; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229459AbiH2Dki (ORCPT + 99 others); Sun, 28 Aug 2022 23:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiH2Dke (ORCPT ); Sun, 28 Aug 2022 23:40:34 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18DC525E83; Sun, 28 Aug 2022 20:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661744434; x=1693280434; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=Oya5Hnsy4mm0/87tApeZ1XDEJ4Ant4xomrwmja1Ayxw=; b=BaiPprdCwpJzSQwrPMkVoX57Ja0QkwdvBAksmUSaWqz6VdoiMImfWt3i 7p90/j6Gf/qZRWqdjTuD0yRPuCCp2BBrMlSBAKRkWC5PgzY3PYmi8KWiK b8kDZWwJGqAlR8eZ2TgiFTU+5S4+4jowKFzCR7hF3WgAU2uKgSzwT0N2H MkrXYEPom2YQEj2/tdiBY5kL9bKlpOmVhMpariNdy7KszouK3ciy15Jdv AdNFJ4xLZIQg28ERtgbqa9PLCr9MO+sSQYVlXMHc7yK/QzL9RDy7aokJX 6x+np27kQb7l6Dp/OZ9io2m+n8grCQn4TZgCv2EUSkIAUd96K2+uqbCXJ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10453"; a="274549902" X-IronPort-AV: E=Sophos;i="5.93,271,1654585200"; d="scan'208";a="274549902" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2022 20:40:33 -0700 X-IronPort-AV: E=Sophos;i="5.93,271,1654585200"; d="scan'208";a="644276121" Received: from lizhipe2-mobl.ccr.corp.intel.com (HELO [10.254.210.26]) ([10.254.210.26]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2022 20:40:26 -0700 Message-ID: <316f6575-59ea-08e3-aaaf-bc1e4f42a574@linux.intel.com> Date: Mon, 29 Aug 2022 11:40:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Christoph Hellwig , Bjorn Helgaas , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Dave Jiang , Fenghua Yu , Vinod Koul , Eric Auger , Liu Yi L , Jacob jun Pan , Zhangfei Gao , Zhu Tony , iommu@lists.linux.dev, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v12 07/17] iommu: Try to allocate blocking domain when probing device Content-Language: en-US To: Jason Gunthorpe References: <20220826121141.50743-1-baolu.lu@linux.intel.com> <20220826121141.50743-8-baolu.lu@linux.intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,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 2022/8/26 22:52, Jason Gunthorpe wrote: > On Fri, Aug 26, 2022 at 08:11:31PM +0800, Lu Baolu wrote: >> Allocate the blocking domain when probing devices if the driver supports >> blocking domain allocation. Otherwise, revert to the previous behavior, >> that is, use UNMANAGED domain instead when the blocking domain is needed. >> >> Signed-off-by: Lu Baolu >> Tested-by: Zhangfei Gao >> Tested-by: Tony Zhu >> --- >> drivers/iommu/iommu.c | 29 +++++++++++++++++------------ >> 1 file changed, 17 insertions(+), 12 deletions(-) > This seems like a lot of overhead to allocate these things for every > group? > > Why not add a simple refcount on the blocking domain instead and > allocate the domain on the pasid attach like we do for ownership? I am working towards implementing static instance of blocking domain for each IOMMU driver, and then, there's no much overhead to allocate it in the probing device path. Best regards, baolu