Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1734786

Re: [PATCH v2 3/4] iommu/iova: Extend rbtree node caching

From Robin Murphy <robin.murphy@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/4] iommu/iova: Extend rbtree node caching
Date 2017-09-19 12:10 +0200
Message-ID <urnDA-3YD-23@gated-at.bofh.it> (permalink)
References <u5EBr-4jK-9@gated-at.bofh.it> <u5EBr-4jK-7@gated-at.bofh.it> <u8r4Z-4Yt-1@gated-at.bofh.it> <u9hmV-5Mi-11@gated-at.bofh.it> <urnkd-39c-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 3/4] iommu/iova: Extend rbtree node caching "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com> - 2017-09-19 11:50 +0200
  Re: [PATCH v2 3/4] iommu/iova: Extend rbtree node caching Robin Murphy <robin.murphy@arm.com> - 2017-09-19 12:10 +0200

csiph-web