mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>,
	Nate Watterson <nwatters@codeaurora.org>,
	joro@8bytes.org
Cc: iommu@lists.linux-foundation.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, dwmw2@infradead.org,
	lorenzo.pieralisi@arm.com, ard.biesheuvel@linaro.org,
	Jonathan.Cameron@huawei.com, ray.jui@broadcom.com
Subject: Re: [PATCH v2 3/4] iommu/iova: Extend rbtree node caching
Date: Tue, 19 Sep 2017 11:07:05 +0100	[thread overview]
Message-ID: <d9945e6a-b605-a531-cefb-6ba13bd45f1f@arm.com> (raw)
In-Reply-To: <59C0E694.6080508@huawei.com>

On 19/09/17 10:42, Leizhen (ThunderTown) wrote:
[...]
>>>>     static void
>>>>   __cached_rbnode_delete_update(struct iova_domain *iovad, struct iova
>>>> *free)
>>>>   {
>>>>       struct iova *cached_iova;
>>>> -    struct rb_node *curr;
>>>> +    struct rb_node **curr = NULL;
>>>>   -    if (!iovad->cached32_node)
>>>> -        return;
>>>> -    curr = iovad->cached32_node;
>>>> -    cached_iova = rb_entry(curr, struct iova, node);
> 
> -----------------------------
>>>> +    if (free->pfn_hi < iovad->dma_32bit_pfn)
>>>> +        curr = &iovad->cached32_node;
>>>> +    if (!curr)
>>>> +        curr = &iovad->cached_node;
>>
>> +	if (!*curr)
>> +		return;
> Is it necessary for us to try the following adjustment?
> +	if (free->pfn_hi < iovad->dma_32bit_pfn)
> +		curr = &iovad->cached32_node;
> +	else
> +		curr = &iovad->cached_node;
> +
> +	if (!*curr) {
> +		*curr = rb_next(&free->node);
> +		return;
> +	}

Yeah, I spotted that this looked a bit wonky after I posted it. It's
already cleaned up in v3, which I'll be posting shortly after I write up
some cover letters.

Thanks,
Robin.

  reply	other threads:[~2017-09-19 10:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21 11:41 [PATCH v2 0/4] Optimise 64-bit IOVA allocations Robin Murphy
2017-07-21 11:41 ` [PATCH v2 1/4] iommu/iova: Optimise rbtree searching Robin Murphy
2017-07-21 11:41 ` [PATCH v2 2/4] iommu/iova: Optimise the padding calculation Robin Murphy
2017-07-21 11:42 ` [PATCH v2 3/4] iommu/iova: Extend rbtree node caching Robin Murphy
2017-07-29  3:57   ` Nate Watterson
2017-07-31 11:42     ` Robin Murphy
2017-08-03 19:41       ` Nate Watterson
2017-08-31  9:46         ` Leizhen (ThunderTown)
2017-09-19  9:42       ` Leizhen (ThunderTown)
2017-09-19 10:07         ` Robin Murphy [this message]
2017-07-21 11:42 ` [PATCH v2 4/4] iommu/iova: Make dma_32bit_pfn implicit Robin Murphy
2017-07-26 11:08 ` [PATCH v2 0/4] Optimise 64-bit IOVA allocations Joerg Roedel
2017-07-26 11:17   ` Leizhen (ThunderTown)
2017-08-08 12:03     ` Ganapatrao Kulkarni
2017-08-09  1:42       ` Leizhen (ThunderTown)
2017-08-09  3:24         ` Ganapatrao Kulkarni
2017-08-09  4:09           ` Leizhen (ThunderTown)

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=d9945e6a-b605-a531-cefb-6ba13bd45f1f@arm.com \
    --to=robin.murphy@arm.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nwatters@codeaurora.org \
    --cc=ray.jui@broadcom.com \
    --cc=thunder.leizhen@huawei.com \
    /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®