lkml.org 
[lkml]   [2017]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 3/4] iommu/iova: Extend rbtree node caching
From
Date
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.

\
 
 \ /
  Last update: 2017-09-19 12:07    [W:0.093 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site