+static u64 perf_get_page_size(unsigned long addr)When I tested on my kernel, it panicked because I suspect
+{
+ unsigned long flags;
+ u64 size;
+
+ if (!addr)
+ return 0;
+
+ /*
+ * Software page-table walkers must disable IRQs,
+ * which prevents any tear down of the page tables.
+ */
+ local_irq_save(flags);
+
+ size = __perf_get_page_size(current->active_mm, addr);
+
current->active_mm could be NULL. Adding a check for NULL avoided the
problem. But I suspect this is not the correct solution.