Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1701274
| From | kan.liang@intel.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] mm: allow page_cache_get_speculative in interrupt context |
| Date | 2017-08-01 19:50 +0200 |
| Message-ID | <u9JsS-71o-9@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
From: Kan Liang <kan.liang@intel.com>
Kernel panic when calling the IRQ-safe __get_user_pages_fast in NMI
handler.
The bug was introduced by commit:
2947ba054a4d ("x86/mm/gup: Switch GUP to the generic
get_user_page_fast() implementation")
The original x86 __get_user_page_fast used plain get_page() or
page_ref_add(). However, the generic __get_user_page_fast uses
page_cache_get_speculative(), which has VM_BUG_ON(in_interrupt()).
There is no reason to prevent page_cache_get_speculative from using in
interrupt context. According to the author, putting a BUG_ON there is
just because the code is not verifying correctness of interrupt races.
I did some tests in interrupt context. There is no issue found.
Removing VM_BUG_ON(in_interrupt()) for page_cache_get_speculative().
Signed-off-by: Kan Liang <kan.liang@intel.com>
---
include/linux/pagemap.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index baa9344..79b36f5 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -163,8 +163,6 @@ void release_pages(struct page **pages, int nr, bool cold);
*/
static inline int page_cache_get_speculative(struct page *page)
{
- VM_BUG_ON(in_interrupt());
-
#ifdef CONFIG_TINY_RCU
# ifdef CONFIG_PREEMPT_COUNT
VM_BUG_ON(!in_atomic() && !irqs_disabled());
--
2.4.3
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] mm: allow page_cache_get_speculative in interrupt context kan.liang@intel.com - 2017-08-01 19:50 +0200
Re: [PATCH] mm: allow page_cache_get_speculative in interrupt context Andrew Morton <akpm@linux-foundation.org> - 2017-08-01 21:50 +0200
RE: [PATCH] mm: allow page_cache_get_speculative in interrupt context "Liang, Kan" <kan.liang@intel.com> - 2017-08-01 22:40 +0200
Re: [PATCH] mm: allow page_cache_get_speculative in interrupt context "Kirill A. Shutemov" <kirill@shutemov.name> - 2017-08-01 23:00 +0200
csiph-web