Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp156276pxj; Thu, 10 Jun 2021 17:57:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysXHDmJt08bRXh2Lu6A6mw+kBZjLImXcCBaxhzNnVa2ZL2mcn01xBn8951laDz/VbVSQI1 X-Received: by 2002:a17:906:b308:: with SMTP id n8mr1037828ejz.93.1623373069021; Thu, 10 Jun 2021 17:57:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623373069; cv=none; d=google.com; s=arc-20160816; b=0erUXrsX6ms1dk16WpWhDSBumurLG/kKGOhQlNwNTGYUQjkY4NDYxVmYVT/s5a3o1C yod+zXbdG0LdEWN9EX7ZQBl/VkZUGIiO7gva2hUbRch4VW5ITGVPcXBgDahZO7PzA0R8 PzM1vbcjaaC0gHFhNj5iB8Azr1wyZ8fmepk7DjAiZnIPxcIR8vgsp2R8f8hGyR6TvtFv 8geAxJvaroOenVhoIUo1KqnmM658PoAQ5fyReREPWANuryKdL9HGdhJglh6b5G5KbxMT x/kO9bQ2ts+8Way3HCpDAgtny0skW01gxnHbeeHuciX7esnp6bchBNk8xqULL3LI2/rh goRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=dcfJebiUK44kAjvGVha7ugPfEUhpoyAPBqW17zs14Co=; b=jPdNu4SKZ4fPvud2xs0F9XRpnXE8dqS3mo5CQddD7IgEwfNBEDvwPmlO1rrg0BtkvV GhQjabWwID7BvB0eccbIuaCEfvlQF2sMxUC4ry7tRatNjyBpdarGmBdNIgo73QOAhw02 QyhCdbwS3ncnDDplOveOaGtk5vzPlZ2/o1eTCkQ0R122J5ZnWVlXoXScqtuq4Llp4EBI SJdBV4+vfzLI3Bqavt0BA7tUxszjgqakBJZlAsyHAts/lrzEkGE3HxyvYWecdtVdEqCu 2pGSoye00darBIQi8zWMJOpjz/P1kl7P+jf7hAhdr4ZzZKGpMqaMXVipWtjUbNbdLfZv Vv1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=Wr1vEiqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z18si3290379edd.97.2021.06.10.17.57.25; Thu, 10 Jun 2021 17:57:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=Wr1vEiqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231288AbhFKA43 (ORCPT + 99 others); Thu, 10 Jun 2021 20:56:29 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:20125 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231256AbhFKA42 (ORCPT ); Thu, 10 Jun 2021 20:56:28 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623372872; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=dcfJebiUK44kAjvGVha7ugPfEUhpoyAPBqW17zs14Co=; b=Wr1vEiqqVwpScbOYUQeoHspCHLGGbfyX/vvjJgBDj8HrdZaceu6bC5eae8JpIIBZ029MynYb 8HP/QLdFMH3rOc/e3AzqKgZEAm2tcoeYamRXiZgyGCMhcfczyhwPdJPp6zCwc3fgVItKrqgU /8Oa+Eq32uERM5XNubenBKH/x3g= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-east-1.postgun.com with SMTP id 60c2b42fabfd22a3dca34416 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 11 Jun 2021 00:54:07 GMT Sender: saiprakash.ranjan=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 142B1C4360C; Fri, 11 Jun 2021 00:54:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5D9D1C4338A; Fri, 11 Jun 2021 00:54:06 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 11 Jun 2021 06:24:06 +0530 From: Sai Prakash Ranjan To: Krishna Reddy Cc: Robin Murphy , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Will Deacon , linux-arm-kernel@lists.infradead.org, Thierry Reding Subject: Re: [PATCH] iommu/io-pgtable-arm: Optimize partial walk flush for large scatter-gather list In-Reply-To: References: <20210609145315.25750-1-saiprakash.ranjan@codeaurora.org> <35bfd245-45e2-8083-b620-330d6dbd7bd7@arm.com> <12067ffb8243b220cf03e83aaac3e823@codeaurora.org> <266f190e-99ae-9175-cf13-7a77730af389@arm.com> <61c69d23-324a-85d7-2458-dfff8df9280b@arm.com> Message-ID: <07001b4ed6c0a491eacce6e4dc13ab5e@codeaurora.org> X-Sender: saiprakash.ranjan@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krishna, On 2021-06-11 06:07, Krishna Reddy wrote: >> > No, the unmap latency is not just in some test case written, the issue >> > is very real and we have workloads where camera is reporting frame >> > drops because of this unmap latency in the order of 100s of milliseconds. >> > And hardware team recommends using ASID based invalidations for >> > anything larger than 128 TLB entries. So yes, we have taken note of >> > impacts here before going this way and hence feel more inclined to >> > make this qcom specific if required. > > Seems like the real issue here is not the unmap API latency. > It should be the high number of back to back SMMU TLB invalidate > register writes that is resulting > in lower ISO BW to Camera and overflow. Isn't it? > Even Tegra186 SoC has similar issue and HW team recommended to rate > limit the number of > back to back SMMU tlb invalidate registers writes. The subsequent > Tegra194 SoC has a dedicated SMMU for > ISO clients to avoid the impact of TLB invalidates from NISO clients on > ISO BW. > Not exactly, this issue is not specific to camera. If you look at the numbers in the commit text, even for the test device its the same observation. It depends on the buffer size we are unmapping which affects the number of TLBIs issue. I am not aware of any such HW side bw issues for camera specifically on QCOM devices. Thanks, Sai >>> Thinking some more, I >>> wonder if the Tegra folks might have an opinion to add here, given >>> that their multiple-SMMU solution was seemingly about trying to get >>> enough TLB and pagetable walk bandwidth in the first place? > > While it is good to reduce the number of tlb register writes, Flushing > all TLB entries at context granularity arbitrarily > can have negative impact on active traffic and BW. I don't have much > data on possible impact at this point. > Can the flushing at context granularity be made a quirk than > performing it as default? > > -KR -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation