Message ID | 1724083806-21956-1-git-send-email-zhang.chuna@h3c.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v3] mm: Give kmap_lock before call flush_tlb_kernel_rang,avoid kmap_high deadlock. | expand |
Very sorry to disturb! Just a friendly ping!
Very sorry to disturb! Just a friendly ping! This deadlock bug needs to fixed! If any additional info needs, please contact me. Long for your reply!
Very sorry to disturb! Just a friendly ping! This deadlock bug is necessary to fix! If any additional info needs, please contact me. Long for your reply!
diff --git a/mm/highmem.c b/mm/highmem.c index ef3189b..07f2c67 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -231,8 +231,18 @@ static void flush_all_zero_pkmaps(void) set_page_address(page, NULL); need_flush = 1; } - if (need_flush) + if (need_flush) { + /* + * In multi-core system one CPU holds the kmap_lock, waiting + * for other CPUs respond to IPI. But other CPUS has disabled + * irqs, waiting for kmap_lock, cannot answer the IPI. Release + * kmap_lock before call flush_tlb_kernel_range, avoid kmap_lock + * deadlock. + */ + unlock_kmap(); flush_tlb_kernel_range(PKMAP_ADDR(0), PKMAP_ADDR(LAST_PKMAP)); + lock_kmap(); + } } void __kmap_flush_unused(void)