mm: make mmap_sem for write waits killable for mm syscalls
[cascardo/linux.git] / mm / internal.h
index ad9400d..bff7fd7 100644 (file)
 void free_pgtables(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
                unsigned long floor, unsigned long ceiling);
 
-static inline void set_page_count(struct page *page, int v)
-{
-       atomic_set(&page->_count, v);
-}
+void unmap_page_range(struct mmu_gather *tlb,
+                            struct vm_area_struct *vma,
+                            unsigned long addr, unsigned long end,
+                            struct zap_details *details);
 
 extern int __do_page_cache_readahead(struct address_space *mapping,
                struct file *filp, pgoff_t offset, unsigned long nr_to_read,
@@ -58,13 +58,13 @@ static inline unsigned long ra_submit(struct file_ra_state *ra,
 }
 
 /*
- * Turn a non-refcounted page (->_count == 0) into refcounted with
+ * Turn a non-refcounted page (->_refcount == 0) into refcounted with
  * a count of one.
  */
 static inline void set_page_refcounted(struct page *page)
 {
        VM_BUG_ON_PAGE(PageTail(page), page);
-       VM_BUG_ON_PAGE(atomic_read(&page->_count), page);
+       VM_BUG_ON_PAGE(page_ref_count(page), page);
        set_page_count(page, 1);
 }
 
@@ -102,13 +102,14 @@ extern pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address);
 struct alloc_context {
        struct zonelist *zonelist;
        nodemask_t *nodemask;
-       struct zone *preferred_zone;
-       int classzone_idx;
+       struct zoneref *preferred_zoneref;
        int migratetype;
        enum zone_type high_zoneidx;
        bool spread_dirty_pages;
 };
 
+#define ac_classzone_idx(ac) zonelist_zone_idx(ac->preferred_zoneref)
+
 /*
  * Locate the struct page for both the matching buddy in our
  * pair (buddy1) and the combined O(n+1) page they form (page).
@@ -148,9 +149,6 @@ extern int __isolate_free_page(struct page *page, unsigned int order);
 extern void __free_pages_bootmem(struct page *page, unsigned long pfn,
                                        unsigned int order);
 extern void prep_compound_page(struct page *page, unsigned int order);
-#ifdef CONFIG_MEMORY_FAILURE
-extern bool is_free_buddy_page(struct page *page);
-#endif
 extern int user_min_free_kbytes;
 
 #if defined CONFIG_COMPACTION || defined CONFIG_CMA
@@ -175,9 +173,11 @@ struct compact_control {
        unsigned long last_migrated_pfn;/* Not yet flushed page being freed */
        enum migrate_mode mode;         /* Async or sync migration mode */
        bool ignore_skip_hint;          /* Scan blocks even if marked skip */
+       bool direct_compaction;         /* False from kcompactd or /proc/... */
+       bool whole_zone;                /* Whole zone has been scanned */
        int order;                      /* order a direct compactor needs */
        const gfp_t gfp_mask;           /* gfp mask of a direct compactor */
-       const int alloc_flags;          /* alloc flags of a direct compactor */
+       const unsigned int alloc_flags; /* alloc flags of a direct compactor */
        const int classzone_idx;        /* zone index of a direct compactor */
        struct zone *zone;
        int contended;                  /* Signal need_sched() or lock
@@ -393,7 +393,7 @@ extern int mminit_loglevel;
 do { \
        if (level < mminit_loglevel) { \
                if (level <= MMINIT_WARNING) \
-                       printk(KERN_WARNING "mminit::" prefix " " fmt, ##arg); \
+                       pr_warn("mminit::" prefix " " fmt, ##arg);      \
                else \
                        printk(KERN_DEBUG "mminit::" prefix " " fmt, ##arg); \
        } \
@@ -442,9 +442,10 @@ extern u64 hwpoison_filter_flags_value;
 extern u64 hwpoison_filter_memcg;
 extern u32 hwpoison_filter_enable;
 
-extern unsigned long vm_mmap_pgoff(struct file *, unsigned long,
+extern unsigned long  __must_check vm_mmap_pgoff(struct file *, unsigned long,
+        unsigned long, unsigned long,
         unsigned long, unsigned long,
-        unsigned long, unsigned long);
+        bool);
 
 extern void set_pageblock_order(void);
 unsigned long reclaim_clean_pages_from_list(struct zone *zone,