[PATCHv9 RFC 1/3] Break up monolithic iommu table/lock into finer graularity pools and lock

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Apr 5 22:26:01 AEST 2015


On Sun, 2015-04-05 at 07:49 -0400, Sowmini Varadhan wrote:
> +               if (likely(pass == 0)) {
> +                       /* First failure, rescan from the beginning.
> */
> +                       pool->hint = pool->start;
> +                       set_flush(iommu);
> +                       pass++;
> +                       goto again;
> +               } else if (!largealloc && pass <= iommu->nr_pools) {
> +                       spin_unlock(&(pool->lock));
> +                       pool_nr = (pool_nr + 1) & (iommu->nr_pools -
> 1);
> +                       pool = &(iommu->pools[pool_nr]);
> +                       spin_lock(&(pool->lock));
> +                       pool->hint = pool->start;
> +                       set_flush(iommu);
> +                       pass++;
> +                       goto again;

So you decided to keep the logic here that updates the hint instead of
just getting rid of need_flush alltogether ?

Out of curiosity, what's the rationale ? Did you find a reason why
resetting the hint in those two cases (rather than just setting "start"
appropriately) is actually useful ?

Cheers,
Ben.




More information about the Linuxppc-dev mailing list