01.09.2020 20:13, Dmitry Osipenko пишет:
...
> +     /*
> +      * In order to prevent exhaustion of the atomic memory pool, we
> +      * allocate page in a sleeping context if GFP flags permit. Hence
> +      * spinlock needs to be unlocked and re-locked after allocation.
> +      */
> +     if (!(gfp & GFP_NOWAIT))
> +             spin_unlock_irqrestore(&as->lock, *flags);
> +
> +     page = alloc_page(gfp | __GFP_DMA | __GFP_ZERO);
> +
> +     if (!(gfp & GFP_NOWAIT))
> +             spin_lock_irqsave(&as->lock, *flags);

I realized that GFP_NOWAIT is a wrong flag to check here once I saw
warnings about sleeping in atomic context. Apparently __GFP_ATOMIC
should be used instead, I'll make v5.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to