Linux IOMMU Development
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Ethan Zhao <haifeng.zhao@linux.intel.com>, <robin.murphy@arm.com>,
	<joro@8bytes.org>, <will@kernel.org>
Cc: <iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>
Subject: Re: [PATCH v2 1/2] iova: Remove some magazine pointer NULL checks
Date: Wed, 7 Sep 2022 10:53:39 +0100	[thread overview]
Message-ID: <d9cf492e-1236-8446-9651-dfe848a5932d@huawei.com> (raw)
In-Reply-To: <7c4383ac-0b0b-dd43-9958-dbd4abeea63f@linux.intel.com>

On 07/09/2022 10:33, Ethan Zhao wrote:

Hi Ethan,

>>> Do you mean iova_magazine_alloc() is impossible to fail ?
>>
>> No, iova_magazine_alloc() may fail and return NULL. But if it does 
>> then we set iovad rcache pointer = NULL in the error path and don't 
>> use the rcache.
> 
> Yup,  if iova_magazine_alloc() failed ,
> 
> iovad->rcaches = NULL;
> 
> was set by free_iova_rcaches()
> 
> in error path of iova_domain_init_rcache().
> 
> and checked in
> 
> alloc_iova_fast()->iova_rcache_get().
> 
> More comment in code would wipe off my curiosity.

As discussed with Robin, we will actually remove that check in 
iova_rcache_get() for now and in future make the IOVA domain init more 
robust.

As for the "loaded" and "prev" NULL checks removal in this specific 
patch, I will add more words in the commit message to make it clearer 
that failure in init was the only way in which they NULL previously.

thanks,
John

  reply	other threads:[~2022-09-07  9:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05  9:11 [PATCH v2 0/2] iova: Some misc changes John Garry
2022-09-05  9:11 ` [PATCH v2 1/2] iova: Remove some magazine pointer NULL checks John Garry
2022-09-05 15:06   ` Jerry Snitselaar
2022-09-06  9:28   ` Ethan Zhao
2022-09-06 10:50     ` John Garry
2022-09-06 13:37       ` Robin Murphy
2022-09-06 17:36         ` John Garry
2022-09-06 18:25           ` Robin Murphy
2022-09-07  8:46             ` John Garry
2022-09-07  9:05               ` Robin Murphy
2022-09-07  9:58               ` Ethan Zhao
2022-09-07 10:10                 ` John Garry
2022-09-07  9:33       ` Ethan Zhao
2022-09-07  9:53         ` John Garry [this message]
2022-09-05  9:11 ` [PATCH v2 2/2] iova: Remove magazine BUG_ON() checks John Garry
2022-09-05 15:06   ` Jerry Snitselaar

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=d9cf492e-1236-8446-9651-dfe848a5932d@huawei.com \
    --to=john.garry@huawei.com \
    --cc=haifeng.zhao@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=robin.murphy@arm.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