Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2123883rdh; Tue, 26 Sep 2023 13:13:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDAAyCucVfUL4wexaEin48oI4+5GS2r8yITtfIMu+/nIchGphhEfbnSj6Fnh7dUJLAo/BV X-Received: by 2002:a05:6870:2385:b0:1c8:d72a:d6b8 with SMTP id e5-20020a056870238500b001c8d72ad6b8mr61323oap.36.1695759201626; Tue, 26 Sep 2023 13:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695759201; cv=none; d=google.com; s=arc-20160816; b=UyNSBQhZ9ORkTVhsK6J7gkVkfYNU/tE+TE2rRzAIRBzVnAx2/4x1Ach7yL2p4BLhz/ skckm+MCWiVG1UaUOXBX22IvfDPtDnk2U1A+uh6sc5j4/kUtlpYc4XqLikJJM/Khovqd XIyGzOO8TFvSVojO7TlbcqPCczqIRBGsMP8QEbl2Wq5I+TCcdODiXJCdt2zEKgTElumI TGdwKsA97vpBDHdAIVKPiv5JttkDlkMaJEq0qpXB1+OCC/gW/zyZ2w93fCBTx1eRdwer STlBxRYRAzZtZSgK+DMFei0G+2x/rsJikPNUwF4vqUvhcERPbXyd9JoZR8xK/CjWoSj7 gU6Q== 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:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=1pWOUBPCcpmtUZJdmOQxs6+4ceq8QleaQiVRSvw1bc8=; fh=IR5xcTlrDOcsnBMnJG3DivHnS1qTb83Y6uZmAazR5/8=; b=MhHtnSNVUe7j3kVJKAnswf5gBzvOvWigtdd/MCCWjRtBNHn0TiZA5AatTd2JvTmgJ8 FpGu+fW71ODa6LY/yhumr1zpcSpxKWBEmQS1SdbYXAH9q9ZvjmL+wNtK9AkP6HV4uKNu noB0z+uIZ4G7OcksZ+Ch4q0tK4r3ieCcdxAcNiQy9SzJIbxTHTZQ/UTOjj1u6MoRngTG vYUooyBKie50SEjzr/fS5vpXBhsNaN78N+Ih6xoIlaOVhZeH0e6elFO/PH9TyjmyK0za wb68xg7sSwDIAy6GQ7O4mcOLnDDxtMv0kKnRSEgvv3wHjOW2fdJBng7ugDRAF02p4fc2 Qhyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DxLnIcn8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id bg26-20020a056a02011a00b00573e7fd674esi12569539pgb.661.2023.09.26.13.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 13:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DxLnIcn8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 26AF7818650A; Tue, 26 Sep 2023 01:26:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233850AbjIZI0p (ORCPT + 99 others); Tue, 26 Sep 2023 04:26:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232778AbjIZI0o (ORCPT ); Tue, 26 Sep 2023 04:26:44 -0400 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 26 Sep 2023 01:26:34 PDT Received: from mgamail.intel.com (unknown [198.175.65.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65BF4B4; Tue, 26 Sep 2023 01:26: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=1695716794; x=1727252794; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=RzaK2ndr7+vnVbIQ7VkWAWjQc7Kpbl44AZ82PRlStIo=; b=DxLnIcn8spYTzqVglKo5nLp3j79SeqlIvzVQCLtWb6ueGdH9lhL08r24 wb6FTGFlVEbY58SEjaPEmFcQqLmnNd010djymCDIFkUEK7Yw1xPBEgDdL UsL/DQiiVeX+FnVrQvmzZgpdUq8l/4rbVB9Ut3XvUruJT5gkKlT/KrZVw JILb15q/h+SkUpFKiK+6VTnSvdIB4HVaPchPg0HSOncf0BYIwphkfY2gc P2A3yFVp2U1SinoH0GyL7DJHKp9+GHttPyHL6a4cTm5rmc3hazV4tg47/ /FoF+jwGxgavXGwQrnR7Z6giiJjWCZCfqjD03JLTDfadxiravedSsY3aF A==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="160422" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="160422" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 01:25:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="995744380" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="995744380" Received: from jiaqingh-mobl.ccr.corp.intel.com (HELO [10.93.22.70]) ([10.93.22.70]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 01:25:28 -0700 Message-ID: <56cc2e4e-81dd-f2d2-f690-6d82217b9e7d@intel.com> Date: Tue, 26 Sep 2023 16:25:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] iommu/vt-d: Introduce a rb_tree for looking up device Content-Language: en-US To: Joerg Roedel Cc: kvm@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, will@kernel.org, robin.murphy@arm.com, kevin.tian@intel.com, baolu.lu@linux.intel.com, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, yi.y.sun@intel.com References: <20230821071659.123981-1-jiaqing.huang@intel.com> From: "Huang, Jiaqing" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 26 Sep 2023 01:26:46 -0700 (PDT) On 9/25/2023 4:12 PM, Joerg Roedel wrote: > On Mon, Aug 21, 2023 at 12:16:59AM -0700, Huang Jiaqing wrote: >> The existing IO page fault handler locates the PCI device by calling >> pci_get_domain_bus_and_slot(), which searches the list of all PCI >> devices until the desired PCI device is found. This is inefficient >> because the algorithm efficiency of searching a list is O(n). In the >> critical path of handling an IO page fault, this can cause a significant >> performance bottleneck. > Can you elaborate a little more on the 'significant performance > bottleneck' part? Where do you see this as a problem? > > Regards, > > Joerg While lots of dsa devices were enabled, parallel dsa_test with large transfer size would be executed ineffciently and cause cpu stuck in pci_get_domain_bus_and_slot by lock competition. The introduced patch could significantly improve the speed and prevent the CPU from getting sutck. It maybe confusing for "significant performance bottleneck" since it didn't benefit all the cases, would rephase it in the new patch. Thanks! BRs, Jiaqing