Thread (20 messages) read the whole thread 20 messages, 5 authors, 2022-10-18

Re: [PATCH] MM: discard __GFP_ATOMIC

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-11-17 13:18:33
Also in: lkml

On Wed, Nov 17, 2021 at 03:39:30PM +1100, NeilBrown wrote:
quoted hunk ↗ jump to hunk
+++ b/drivers/iommu/tegra-smmu.c
@@ -676,12 +676,12 @@ static struct page *as_get_pde_page(struct tegra_smmu_as *as,
 	 * allocate page in a sleeping context if GFP flags permit. Hence
 	 * spinlock needs to be unlocked and re-locked after allocation.
 	 */
-	if (!(gfp & __GFP_ATOMIC))
+	if (gfp & __GFP_DIRECT_RECLAIM)
 		spin_unlock_irqrestore(&as->lock, *flags);
 
 	page = alloc_page(gfp | __GFP_DMA | __GFP_ZERO);
 
-	if (!(gfp & __GFP_ATOMIC))
+	if (gfp & __GFP_DIRECT_RECLAIM)
 		spin_lock_irqsave(&as->lock, *flags);
 
 	/*
Surely this should be gfpflags_allow_blocking() instead of poking about
in the innards of gfp flags?

This patch seems like a good simplification to me.

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help