Merge tag 'vfio-v4.20-rc1.v2' of git://github.com/awilliam/linux-vfio
[linux-2.6-block.git] / mm / util.c
index 9e3ebd2ef65f8925b0a1f894567c0e3d98665b34..8bf08b5b576061bd68d62d7e5eb15c89f3e1c5ad 100644 (file)
--- a/mm/util.c
+++ b/mm/util.c
 #include <linux/vmalloc.h>
 #include <linux/userfaultfd_k.h>
 
-#include <asm/sections.h>
 #include <linux/uaccess.h>
 
 #include "internal.h"
 
-static inline int is_kernel_rodata(unsigned long addr)
-{
-       return addr >= (unsigned long)__start_rodata &&
-               addr < (unsigned long)__end_rodata;
-}
-
 /**
  * kfree_const - conditionally free memory
  * @x: pointer to the memory
@@ -442,7 +435,7 @@ EXPORT_SYMBOL(kvmalloc_node);
  * It is slightly more efficient to use kfree() or vfree() if you are certain
  * that you know which one to use.
  *
- * Context: Any context except NMI.
+ * Context: Either preemptible task context or not-NMI interrupt.
  */
 void kvfree(const void *addr)
 {
@@ -685,8 +678,7 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
                 * Part of the kernel memory, which can be released
                 * under memory pressure.
                 */
-               free += global_node_page_state(
-                       NR_INDIRECTLY_RECLAIMABLE_BYTES) >> PAGE_SHIFT;
+               free += global_node_page_state(NR_KERNEL_MISC_RECLAIMABLE);
 
                /*
                 * Leave reserved pages. The pages are not for anonymous pages.