mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: John Garry <john.garry@huawei.com>, joro@8bytes.org, will@kernel.org
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
	linuxarm@huawei.com, jsnitsel@redhat.com,
	haifeng.zhao@linux.intel.com
Subject: Re: [PATCH v3 3/3] iova: Remove iovad->rcaches check in iova_rcache_get()
Date: Wed, 7 Sep 2022 14:22:01 +0100	[thread overview]
Message-ID: <342eeb04-f240-b4a7-2994-8f69d4ca4087@arm.com> (raw)
In-Reply-To: <1662555754-142760-4-git-send-email-john.garry@huawei.com>

On 2022-09-07 14:02, John Garry wrote:
> The iovad->rcaches check in iova_rcache_get() is pretty much useless
> without the same check in iova_rcache_insert().
> 
> Instead of adding this symmetric check to fathpath iova_rcache_insert(),

Nit: "fastpath"

> drop the check in iova_rcache_get() in favour of making the IOVA domain
> rcache init more robust to failure in future.

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Signed-off-by: John Garry <john.garry@huawei.com>
> ---
>   drivers/iommu/iova.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c
> index 8aece052ce72..a44ad92fc5eb 100644
> --- a/drivers/iommu/iova.c
> +++ b/drivers/iommu/iova.c
> @@ -875,7 +875,7 @@ static unsigned long iova_rcache_get(struct iova_domain *iovad,
>   {
>   	unsigned int log_size = order_base_2(size);
>   
> -	if (log_size >= IOVA_RANGE_CACHE_MAX_SIZE || !iovad->rcaches)
> +	if (log_size >= IOVA_RANGE_CACHE_MAX_SIZE)
>   		return 0;
>   
>   	return __iova_rcache_get(&iovad->rcaches[log_size], limit_pfn - size);

      reply	other threads:[~2022-09-07 13:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07 13:02 [PATCH v3 0/3] iova: Some misc changes John Garry
2022-09-07 13:02 ` [PATCH v3 1/3] iova: Remove some magazine pointer NULL checks John Garry
2022-09-07 13:02 ` [PATCH v3 2/3] iova: Remove magazine BUG_ON() checks John Garry
2022-09-07 13:02 ` [PATCH v3 3/3] iova: Remove iovad->rcaches check in iova_rcache_get() John Garry
2022-09-07 13:22   ` Robin Murphy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=342eeb04-f240-b4a7-2994-8f69d4ca4087@arm.com \
    --to=robin.murphy@arm.com \
    --cc=haifeng.zhao@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=john.garry@huawei.com \
    --cc=joro@8bytes.org \
    --cc=jsnitsel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®