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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C4B5C433FF for ; Wed, 14 Aug 2019 00:42:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F43720842 for ; Wed, 14 Aug 2019 00:42:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jvEO1BKO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F43720842 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JWszycr21fusXeMnKZzGACZ7APUOnrH2ebz1oQO+F+Q=; b=jvEO1BKOqRCIFx XJJ12/3mw/9fh4Xvtj++SpkvX3OUpVDQ2E/VEStOUqF7zDo6VckdtH8SppehovQCJs5PXwk+5X7U5 WzI4obn8t/wAs9L6XSAx2VDu3V3cCRCyr9w+DWoQiao+kPPwba1k+36XELeSS5IDhR4Zu8P3oGFid 7k/fXXFXRzmSqnEhapl+QwyplszoA6sskKrckndBlA6tar+J107AwlGUEXZMbJjoAae65imOjIBZX KBuHmIBfTH8R7t0j5dTiy/+lXJnJcS9D2Ccq+J5+A+2xN2h/bMxiw068DbbAs3bLHCMXGkxLtLzIq URT+FYKTFr80TuIH6nCA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hxhMc-0001cV-6l; Wed, 14 Aug 2019 00:42:06 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hxhMY-0001bV-9a for linux-arm-kernel@lists.infradead.org; Wed, 14 Aug 2019 00:42:04 +0000 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 509E972F8571B7ADFF66; Wed, 14 Aug 2019 08:41:48 +0800 (CST) Received: from [127.0.0.1] (10.133.215.186) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Wed, 14 Aug 2019 08:41:38 +0800 Subject: Re: [PATCH] iommu/arm-smmu-v3: add nr_ats_masters to avoid unnecessary operations To: Will Deacon , John Garry References: <20190801122040.26024-1-thunder.leizhen@huawei.com> <20190813171039.y64wslo4dzgyis3e@willie-the-truck> From: "Leizhen (ThunderTown)" Message-ID: <19e427af-7ff3-99a5-cfec-60ebce686cb2@huawei.com> Date: Wed, 14 Aug 2019 08:41:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190813171039.y64wslo4dzgyis3e@willie-the-truck> Content-Language: en-US X-Originating-IP: [10.133.215.186] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190813_174202_494319_798AAE31 X-CRM114-Status: GOOD ( 14.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jean-philippe@linaro.org, Jean-Philippe Brucker , Joerg Roedel , linux-kernel , iommu , Robin Murphy , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2019/8/14 1:10, Will Deacon wrote: > On Mon, Aug 12, 2019 at 11:42:17AM +0100, John Garry wrote: >> On 01/08/2019 13:20, Zhen Lei wrote: >>> When (smmu_domain->smmu->features & ARM_SMMU_FEAT_ATS) is true, even if a >>> smmu domain does not contain any ats master, the operations of >>> arm_smmu_atc_inv_to_cmd() and lock protection in arm_smmu_atc_inv_domain() >>> are always executed. This will impact performance, especially in >>> multi-core and stress scenarios. For my FIO test scenario, about 8% >>> performance reduced. >>> >>> In fact, we can use a atomic member to record how many ats masters the >>> smmu contains. And check that without traverse the list and check all >>> masters one by one in the lock protection. >>> >> >> Hi Will, Robin, Jean-Philippe, >> >> Can you kindly check this issue? We have seen a signifigant performance >> regression here. > > Sorry, John: Robin and Jean-Philippe are off at the moment and I've been > swamped dealing with the arm64 queue. I'll try to get to this tomorrow. Hi, all: I found my patch have some mistake, see below. I'm sorry I didn't see this coupling. I'm preparing v2. > @@ -1915,10 +1921,10 @@ static void arm_smmu_detach_dev(struct arm_smmu_master *master) > list_del(&master->domain_head); > spin_unlock_irqrestore(&smmu_domain->devices_lock, flags); > > - master->domain = NULL; > arm_smmu_install_ste_for_dev(master); "master->domain = NULL" is needed in arm_smmu_install_ste_for_dev(). > > arm_smmu_disable_ats(master); > + master->domain = NULL; > } > > Will > > . > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel