Skip to content

Commit 0409cc5

Browse files
committed
Merge tag 'dma-mapping-6.11-2024-08-10' of git://git.infradead.org/users/hch/dma-mapping
Pull dma-mapping fix from Christoph Hellwig: - avoid a deadlock with dma-debug and netconsole (Rik van Riel) * tag 'dma-mapping-6.11-2024-08-10' of git://git.infradead.org/users/hch/dma-mapping: dma-debug: avoid deadlock between dma debug vs printk and netconsole
2 parents 31b2444 + bd44ca3 commit 0409cc5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/dma/debug.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,11 @@ static unsigned long long phys_addr(struct dma_debug_entry *entry)
416416
* dma_active_cacheline entry to track per event. dma_map_sg(), on the
417417
* other hand, consumes a single dma_debug_entry, but inserts 'nents'
418418
* entries into the tree.
419+
*
420+
* Use __GFP_NOWARN because the printk from an OOM, to netconsole, could end
421+
* up right back in the DMA debugging code, leading to a deadlock.
419422
*/
420-
static RADIX_TREE(dma_active_cacheline, GFP_ATOMIC);
423+
static RADIX_TREE(dma_active_cacheline, GFP_ATOMIC | __GFP_NOWARN);
421424
static DEFINE_SPINLOCK(radix_lock);
422425
#define ACTIVE_CACHELINE_MAX_OVERLAP ((1 << RADIX_TREE_MAX_TAGS) - 1)
423426
#define CACHELINE_PER_PAGE_SHIFT (PAGE_SHIFT - L1_CACHE_SHIFT)

0 commit comments

Comments
 (0)