Re: [PATCH v4] iommu/tegra-smmu: Add locking around mapping operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux