From patchwork Wed Aug 15 10:23:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 144278 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp655629ljj; Wed, 15 Aug 2018 03:23:46 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwRQPCpUwCJk8P5DmxPPvurMB4jvy+XNWWKawWcDjvYxCnNu9KXSy7LTPMxO1YEFtmucM9u X-Received: by 2002:a63:e56:: with SMTP id 22-v6mr25082256pgo.438.1534328626303; Wed, 15 Aug 2018 03:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534328626; cv=none; d=google.com; s=arc-20160816; b=qxr7pAqsdKzdJggWXZIsLU10r4ePVq+GCZVuFY1NZbgrKWUc8tG64EHjYME+XS3hrw nlFlXKUGIPhKcYfGr8CgiItF+sOgVDLkg9K2jkFFVJTNQc8uXPychHk7c+z+UsmXYyXQ 05QOUUoIrTBQJdWbhQekKZZ+XlpAziA7x82Y+3qYPNQWObGjyyOf+SVH1adbhVnUcrYK plF/EeVOKbiWwbJ4I5DjrUDq+koTU548j2P4ZDy6F847GM/a2Tl0063u4KOBraFmBSSR QylsAsZ8L5ZG/Tj6lFdTQC0diz5x7Vk2mqCoF2aZ9+OsT3ZdtP82XYD0CKTbjQjli9WZ wqOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=OTyYTtAnsKq80Ch9AuO1lKpCRJzOTdbGOHIw+MJmvWc=; b=BnigWhfafotBPV1SMCjg1aegRFyMTpEHNDeupQtbTdPLjHYRTDrzXXGNcq1TFrtGEd E/7iNyzT7Qehqrtk4dNYlmuKye4067VIBzMEyvGHLQxtFyOwAOA0vo7X8x7T5ftYNMuN 29feF9u7pJDc7WXaCm8CqItVfehinp6kfWtdZ/omSnmdSjqR1P8LhYV56W+pTEq0bbro k4wYRqGPU2qI5k5HuCw96sAq1eDRBKXJ/3AFLvldPjtKSXov0UkfqikQf8mqwGsdxLf4 Mwnqb+jhLT9bcKMuoDJCaPw/XnvaIo02zHe/fHaA09uu/Y2NVr6DFtj+g5aVYsoQlqSL Flmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q61-v6si18659044plb.231.2018.08.15.03.23.46; Wed, 15 Aug 2018 03:23:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729171AbeHONPS (ORCPT + 32 others); Wed, 15 Aug 2018 09:15:18 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:60845 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728921AbeHONPR (ORCPT ); Wed, 15 Aug 2018 09:15:17 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C226784E9ED0C; Wed, 15 Aug 2018 18:23:28 +0800 (CST) Received: from localhost (10.177.23.164) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Wed, 15 Aug 2018 18:23:22 +0800 From: Zhen Lei To: Robin Murphy , Will Deacon , Joerg Roedel , linux-arm-kernel , iommu , linux-kernel CC: Zhen Lei , LinuxArm , Hanjun Guo , Libin , "John Garry" Subject: [PATCH v3 0/2] bugfix and optimization about CMD_SYNC Date: Wed, 15 Aug 2018 18:23:00 +0800 Message-ID: <1534328582-17664-1-git-send-email-thunder.leizhen@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v2 -> v3: Although I have no data to show how many performance will be impacted because of arm_smmu_cmdq_build_cmd is protected by spinlock. But it's clear that the performance is bound to drop, a memset operation and a complicate switch..case in the function arm_smmu_cmdq_build_cmd. v1 -> v2: 1. move the call to arm_smmu_cmdq_build_cmd into the critical section, and keep itself unchange. 2. Although patch2 can make sure no two CMD_SYNCs will be adjacent, but patch1 is still needed, see below: cpu0 cpu1 cpu2 msidata=0 msidata=1 insert cmd1 insert a TLBI command insert cmd0 smmu execute cmd1 smmu execute TLBI smmu execute cmd0 poll timeout, because msidata=1 is overridden by cmd0, that means VAL=0, sync_idx=1. Zhen Lei (2): iommu/arm-smmu-v3: fix unexpected CMD_SYNC timeout iommu/arm-smmu-v3: avoid redundant CMD_SYNCs if possible drivers/iommu/arm-smmu-v3.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) -- 1.8.3