History

Merge branch 'akpm' (patches from Andrew)

Merge updates from Andrew Morton: "Incoming: - a small number of updates to scripts/, ocfs2 and fs/buffer.c - most of MM I still have quite a lot of material (mostly not MM) staged after linux-next due to -next dependencies. I'll send those across next week as the preprequisites get merged up" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (135 commits) mm/page_io.c: annotate refault stalls from swap_readpage mm/Kconfig: fix trivial help text punctuation mm/Kconfig: fix indentation mm/memory_hotplug.c: remove __online_page_set_limits() mm: fix typos in comments when calling __SetPageUptodate() mm: fix struct member name in function comments mm/shmem.c: cast the type of unmap_start to u64 mm: shmem: use proper gfp flags for shmem_writepage() mm/shmem.c: make array 'values' static const, makes object smaller userfaultfd: require CAP_SYS_PTRACE for UFFD_FEATURE_EVENT_FORK fs/userfaultfd.c: wp: clear VM_UFFD_MISSING or VM_UFFD_WP during userfaultfd_register() userfaultfd: wrap the common dst_vma check into an inlined function userfaultfd: remove unnecessary WARN_ON() in __mcopy_atomic_hugetlb() userfaultfd: use vma_pagesize for all huge page size calculation mm/madvise.c: use PAGE_ALIGN[ED] for range checking mm/madvise.c: replace with page_size() in madvise_inject_error() mm/mmap.c: make vma_merge() comment more easy to understand mm/hwpoison-inject: use DEFINE_DEBUGFS_ATTRIBUTE to define debugfs fops autonuma: reduce cache footprint when scanning page tables autonuma: fix watermark checking in migrate_balanced_pgdat() ...

Linus Torvalds committed 6 years ago

Commit 596cf452 parents c3bfc5d 937790695 files · +2661 −1506Browse files

Showing the changes to include/linux (15 of 95 files). Show all

Unified · Split

15 files
  1. include/linux/fs.h +5 −1
  2. include/linux/gfp.h +2 −0
  3. include/linux/hugetlb.h +116 −24
  4. include/linux/kasan.h +31 −0
  5. include/linux/memblock.h +3 −0
  6. include/linux/memcontrol.h +22 −27
  7. include/linux/memory_hotplug.h +4 −7
  8. include/linux/mm.h +12 −22
  9. include/linux/mmzone.h +20 −14
  10. include/linux/moduleloader.h +1 −1
  11. include/linux/page-isolation.h +2 −2
  12. include/linux/slab.h +0 −20
  13. include/linux/string.h +2 −0
  14. include/linux/swap.h +1 −1
  15. include/linux/vmalloc.h +12 −0
include/linux/fs.h+5−1
@@ -3156,7 +3156,6 @@ enum { · 3155 unmodified lines
31563156 };
31573157
31583158 void dio_end_io(struct bio *bio);
3159−void dio_warn_stale_pagecache(struct file *filp);
31603159
31613160 ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
31623161 struct block_device *bdev, struct iov_iter *iter,
@@ -3201,6 +3200,11 @@ static inline void inode_dio_end(struct inode *inode) · 38 unmodified lines
32013200 wake_up_bit(&inode->i_state, __I_DIO_WAKEUP);
32023201 }
32033202
3203+/*
3204+ * Warn about a page cache invalidation failure diring a direct I/O write.
3205+ */
3206+void dio_warn_stale_pagecache(struct file *filp);
3207+
32043208 extern void inode_set_flags(struct inode *inode, unsigned int flags,
32053209 unsigned int mask);
32063210
include/linux/gfp.h+2−0
@@ -612,6 +612,8 @@ static inline bool pm_suspended_storage(void) · 611 unmodified lines
612612 /* The below functions must be run on a range from a single zone. */
613613 extern int alloc_contig_range(unsigned long start, unsigned long end,
614614 unsigned migratetype, gfp_t gfp_mask);
615+extern struct page *alloc_contig_pages(unsigned long nr_pages, gfp_t gfp_mask,
616+ int nid, nodemask_t *nodemask);
615617 #endif
616618 void free_contig_range(unsigned long pfn, unsigned int nr_pages);
617619
include/linux/hugetlb.h+116−24
@@ -105,8 +105,7 @@ void move_hugetlb_state(struct page *oldpage, struct page *newpage, int reason); · 104 unmodified lines
105105 void free_huge_page(struct page *page);
106106 void hugetlb_fix_reserve_counts(struct inode *inode);
107107 extern struct mutex *hugetlb_fault_mutex_table;
108−u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping,
109− pgoff_t idx, unsigned long address);
108+u32 hugetlb_fault_mutex_hash(struct address_space *mapping, pgoff_t idx);
110109
111110 pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud);
112111
@@ -164,38 +163,130 @@ static inline void adjust_range_if_pmd_sharing_possible( · 51 unmodified lines
164163 {
165164 }
166165
167−#define follow_hugetlb_page(m,v,p,vs,a,b,i,w,n) ({ BUG(); 0; })
168−#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)
169−#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
166+static inline long follow_hugetlb_page(struct mm_struct *mm,
167+ struct vm_area_struct *vma, struct page **pages,
168+ struct vm_area_struct **vmas, unsigned long *position,
169+ unsigned long *nr_pages, long i, unsigned int flags,
170+ int *nonblocking)
171+{
172+ BUG();
173+ return 0;
174+}
175+
176+static inline struct page *follow_huge_addr(struct mm_struct *mm,
177+ unsigned long address, int write)
178+{
179+ return ERR_PTR(-EINVAL);
180+}
181+
182+static inline int copy_hugetlb_page_range(struct mm_struct *dst,
183+ struct mm_struct *src, struct vm_area_struct *vma)
184+{
185+ BUG();
186+ return 0;
187+}
188+
170189 static inline void hugetlb_report_meminfo(struct seq_file *m)
171190 {
172191 }
173−#define hugetlb_report_node_meminfo(n, buf) 0
192+
193+static inline int hugetlb_report_node_meminfo(int nid, char *buf)
194+{
195+ return 0;
196+}
197+
174198 static inline void hugetlb_show_meminfo(void)
175199 {
176200 }
177−#define follow_huge_pd(vma, addr, hpd, flags, pdshift) NULL
178−#define follow_huge_pmd(mm, addr, pmd, flags) NULL
179−#define follow_huge_pud(mm, addr, pud, flags) NULL
180−#define follow_huge_pgd(mm, addr, pgd, flags) NULL
181−#define prepare_hugepage_range(file, addr, len) (-EINVAL)
182−#define pmd_huge(x) 0
183−#define pud_huge(x) 0
184−#define is_hugepage_only_range(mm, addr, len) 0
185−#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
186−#define hugetlb_mcopy_atomic_pte(dst_mm, dst_pte, dst_vma, dst_addr, \
187− src_addr, pagep) ({ BUG(); 0; })
188−#define huge_pte_offset(mm, address, sz) 0
201+
202+static inline struct page *follow_huge_pd(struct vm_area_struct *vma,
203+ unsigned long address, hugepd_t hpd, int flags,
204+ int pdshift)
205+{
206+ return NULL;
207+}
208+
209+static inline struct page *follow_huge_pmd(struct mm_struct *mm,
210+ unsigned long address, pmd_t *pmd, int flags)
211+{
212+ return NULL;
213+}
214+
215+static inline struct page *follow_huge_pud(struct mm_struct *mm,
216+ unsigned long address, pud_t *pud, int flags)
217+{
218+ return NULL;
219+}
220+
221+static inline struct page *follow_huge_pgd(struct mm_struct *mm,
222+ unsigned long address, pgd_t *pgd, int flags)
223+{
224+ return NULL;
225+}
226+
227+static inline int prepare_hugepage_range(struct file *file,
228+ unsigned long addr, unsigned long len)
229+{
230+ return -EINVAL;
231+}
232+
233+static inline int pmd_huge(pmd_t pmd)
234+{
235+ return 0;
236+}
237+
238+static inline int pud_huge(pud_t pud)
239+{
240+ return 0;
241+}
242+
243+static inline int is_hugepage_only_range(struct mm_struct *mm,
244+ unsigned long addr, unsigned long len)
245+{
246+ return 0;
247+}
248+
249+static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
250+ unsigned long addr, unsigned long end,
251+ unsigned long floor, unsigned long ceiling)
252+{
253+ BUG();
254+}
255+
256+static inline int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
257+ pte_t *dst_pte,
258+ struct vm_area_struct *dst_vma,
259+ unsigned long dst_addr,
260+ unsigned long src_addr,
261+ struct page **pagep)
262+{
263+ BUG();
264+ return 0;
265+}
266+
267+static inline pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr,
268+ unsigned long sz)
269+{
270+ return NULL;
271+}
189272
190273 static inline bool isolate_huge_page(struct page *page, struct list_head *list)
191274 {
192275 return false;
193276 }
194−#define putback_active_hugepage(p) do {} while (0)
195−#define move_hugetlb_state(old, new, reason) do {} while (0)
196277
197−static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
198− unsigned long address, unsigned long end, pgprot_t newprot)
278+static inline void putback_active_hugepage(struct page *page)
279+{
280+}
281+
282+static inline void move_hugetlb_state(struct page *oldpage,
283+ struct page *newpage, int reason)
284+{
285+}
286+
287+static inline unsigned long hugetlb_change_protection(
288+ struct vm_area_struct *vma, unsigned long address,
289+ unsigned long end, pgprot_t newprot)
199290 {
200291 return 0;
201292 }
@@ -213,9 +304,10 @@ static inline void __unmap_hugepage_range(struct mmu_gather *tlb, · 11 unmodified lines
213304 {
214305 BUG();
215306 }
307+
216308 static inline vm_fault_t hugetlb_fault(struct mm_struct *mm,
217− struct vm_area_struct *vma, unsigned long address,
218− unsigned int flags)
309+ struct vm_area_struct *vma, unsigned long address,
310+ unsigned int flags)
219311 {
220312 BUG();
221313 return 0;
include/linux/kasan.h+31−0
@@ -70,8 +70,18 @@ struct kasan_cache { · 69 unmodified lines
7070 int free_meta_offset;
7171 };
7272
73+/*
74+ * These functions provide a special case to support backing module
75+ * allocations with real shadow memory. With KASAN vmalloc, the special
76+ * case is unnecessary, as the work is handled in the generic case.
77+ */
78+#ifndef CONFIG_KASAN_VMALLOC
7379 int kasan_module_alloc(void *addr, size_t size);
7480 void kasan_free_shadow(const struct vm_struct *vm);
81+#else
82+static inline int kasan_module_alloc(void *addr, size_t size) { return 0; }
83+static inline void kasan_free_shadow(const struct vm_struct *vm) {}
84+#endif
7585
7686 int kasan_add_zero_shadow(void *start, unsigned long size);
7787 void kasan_remove_zero_shadow(void *start, unsigned long size);
@@ -194,4 +204,25 @@ static inline void *kasan_reset_tag(const void *addr) · 116 unmodified lines
194204
195205 #endif /* CONFIG_KASAN_SW_TAGS */
196206
207+#ifdef CONFIG_KASAN_VMALLOC
208+int kasan_populate_vmalloc(unsigned long requested_size,
209+ struct vm_struct *area);
210+void kasan_poison_vmalloc(void *start, unsigned long size);
211+void kasan_release_vmalloc(unsigned long start, unsigned long end,
212+ unsigned long free_region_start,
213+ unsigned long free_region_end);
214+#else
215+static inline int kasan_populate_vmalloc(unsigned long requested_size,
216+ struct vm_struct *area)
217+{
218+ return 0;
219+}
220+
221+static inline void kasan_poison_vmalloc(void *start, unsigned long size) {}
222+static inline void kasan_release_vmalloc(unsigned long start,
223+ unsigned long end,
224+ unsigned long free_region_start,
225+ unsigned long free_region_end) {}
226+#endif
227+
197228 #endif /* LINUX_KASAN_H */
include/linux/memblock.h+3−0
@@ -358,6 +358,9 @@ static inline phys_addr_t memblock_phys_alloc(phys_addr_t size, · 357 unmodified lines
358358 MEMBLOCK_ALLOC_ACCESSIBLE);
359359 }
360360
361+void *memblock_alloc_exact_nid_raw(phys_addr_t size, phys_addr_t align,
362+ phys_addr_t min_addr, phys_addr_t max_addr,
363+ int nid);
361364 void *memblock_alloc_try_nid_raw(phys_addr_t size, phys_addr_t align,
362365 phys_addr_t min_addr, phys_addr_t max_addr,
363366 int nid);
include/linux/memcontrol.h+22−27
@@ -58,7 +58,6 @@ enum mem_cgroup_protection { · 57 unmodified lines
5858
5959 struct mem_cgroup_reclaim_cookie {
6060 pg_data_t *pgdat;
61− int priority;
6261 unsigned int generation;
6362 };
6463
@@ -81,7 +80,6 @@ struct mem_cgroup_id { · 16 unmodified lines
8180 enum mem_cgroup_events_target {
8281 MEM_CGROUP_TARGET_THRESH,
8382 MEM_CGROUP_TARGET_SOFTLIMIT,
84− MEM_CGROUP_TARGET_NUMAINFO,
8583 MEM_CGROUP_NTARGETS,
8684 };
8785
@@ -112,7 +110,7 @@ struct memcg_shrinker_map { · 24 unmodified lines
112110 };
113111
114112 /*
115− * per-zone information in memory controller.
113+ * per-node information in memory controller.
116114 */
117115 struct mem_cgroup_per_node {
118116 struct lruvec lruvec;
@@ -126,7 +124,7 @@ struct mem_cgroup_per_node { · 7 unmodified lines
126124
127125 unsigned long lru_zone_size[MAX_NR_ZONES][NR_LRU_LISTS];
128126
129− struct mem_cgroup_reclaim_iter iter[DEF_PRIORITY + 1];
127+ struct mem_cgroup_reclaim_iter iter;
130128
131129 struct memcg_shrinker_map __rcu *shrinker_map;
132130
@@ -134,9 +132,6 @@ struct mem_cgroup_per_node { · 1 unmodified line
134132 unsigned long usage_in_excess;/* Set to the value by which */
135133 /* the soft limit is exceeded*/
136134 bool on_tree;
137− bool congested; /* memcg has many dirty pages */
138− /* backed by a congested BDI */
139−
140135 struct mem_cgroup *memcg; /* Back pointer, we cannot */
141136 /* use container_of */
142137 };
@@ -313,13 +308,6 @@ struct mem_cgroup { · 170 unmodified lines
313308 struct list_head kmem_caches;
314309 #endif
315310
316− int last_scanned_node;
317−#if MAX_NUMNODES > 1
318− nodemask_t scan_nodes;
319− atomic_t numainfo_events;
320− atomic_t numainfo_updating;
321−#endif
322−
323311 #ifdef CONFIG_CGROUP_WRITEBACK
324312 struct list_head cgwb_list;
325313 struct wb_domain cgwb_domain;
@@ -394,25 +382,27 @@ mem_cgroup_nodeinfo(struct mem_cgroup *memcg, int nid) · 68 unmodified lines
394382 }
395383
396384 /**
397− * mem_cgroup_lruvec - get the lru list vector for a node or a memcg zone
398− * @node: node of the wanted lruvec
385+ * mem_cgroup_lruvec - get the lru list vector for a memcg & node
399386 * @memcg: memcg of the wanted lruvec
400387 *
401− * Returns the lru list vector holding pages for a given @node or a given
402− * @memcg and @zone. This can be the node lruvec, if the memory controller
403− * is disabled.
388+ * Returns the lru list vector holding pages for a given @memcg &
389+ * @node combination. This can be the node lruvec, if the memory
390+ * controller is disabled.
404391 */
405−static inline struct lruvec *mem_cgroup_lruvec(struct pglist_data *pgdat,
406− struct mem_cgroup *memcg)
392+static inline struct lruvec *mem_cgroup_lruvec(struct mem_cgroup *memcg,
393+ struct pglist_data *pgdat)
407394 {
408395 struct mem_cgroup_per_node *mz;
409396 struct lruvec *lruvec;
410397
411398 if (mem_cgroup_disabled()) {
412− lruvec = node_lruvec(pgdat);
399+ lruvec = &pgdat->__lruvec;
413400 goto out;
414401 }
415402
403+ if (!memcg)
404+ memcg = root_mem_cgroup;
405+
416406 mz = mem_cgroup_nodeinfo(memcg, pgdat->node_id);
417407 lruvec = &mz->lruvec;
418408 out:
@@ -728,7 +718,7 @@ static inline void __mod_lruvec_page_state(struct page *page, · 309 unmodified lines
728718 return;
729719 }
730720
731− lruvec = mem_cgroup_lruvec(pgdat, page->mem_cgroup);
721+ lruvec = mem_cgroup_lruvec(page->mem_cgroup, pgdat);
732722 __mod_lruvec_state(lruvec, idx, val);
733723 }
734724
@@ -899,16 +889,21 @@ static inline void mem_cgroup_migrate(struct page *old, struct page *new) · 164 unmodified lines
899889 {
900890 }
901891
902−static inline struct lruvec *mem_cgroup_lruvec(struct pglist_data *pgdat,
903− struct mem_cgroup *memcg)
892+static inline struct lruvec *mem_cgroup_lruvec(struct mem_cgroup *memcg,
893+ struct pglist_data *pgdat)
904894 {
905− return node_lruvec(pgdat);
895+ return &pgdat->__lruvec;
906896 }
907897
908898 static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page,
909899 struct pglist_data *pgdat)
910900 {
911− return &pgdat->lruvec;
901+ return &pgdat->__lruvec;
902+}
903+
904+static inline struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg)
905+{
906+ return NULL;
912907 }
913908
914909 static inline bool mm_match_cgroup(struct mm_struct *mm,
include/linux/memory_hotplug.h+4−7
@@ -102,13 +102,10 @@ extern unsigned long __offline_isolated_pages(unsigned long start_pfn, · 101 unmodified lines
102102
103103 typedef void (*online_page_callback_t)(struct page *page, unsigned int order);
104104
105+extern void generic_online_page(struct page *page, unsigned int order);
105106 extern int set_online_page_callback(online_page_callback_t callback);
106107 extern int restore_online_page_callback(online_page_callback_t callback);
107108
108−extern void __online_page_set_limits(struct page *page);
109−extern void __online_page_increment_counters(struct page *page);
110−extern void __online_page_free(struct page *page);
111−
112109 extern int try_online_node(int nid);
113110
114111 extern int arch_add_memory(int nid, u64 start, u64 size,
@@ -229,9 +226,6 @@ void put_online_mems(void); · 114 unmodified lines
229226 void mem_hotplug_begin(void);
230227 void mem_hotplug_done(void);
231228
232−extern void set_zone_contiguous(struct zone *zone);
233−extern void clear_zone_contiguous(struct zone *zone);
234−
235229 #else /* ! CONFIG_MEMORY_HOTPLUG */
236230 #define pfn_to_online_page(pfn) \
237231 ({ \
@@ -339,6 +333,9 @@ static inline int remove_memory(int nid, u64 start, u64 size) · 101 unmodified lines
339333 static inline void __remove_memory(int nid, u64 start, u64 size) {}
340334 #endif /* CONFIG_MEMORY_HOTREMOVE */
341335
336+extern void set_zone_contiguous(struct zone *zone);
337+extern void clear_zone_contiguous(struct zone *zone);
338+
342339 extern void __ref free_area_init_core_hotplug(int nid);
343340 extern int __add_memory(int nid, u64 start, u64 size);
344341 extern int add_memory(int nid, u64 start, u64 size);
include/linux/mm.h+12−22
@@ -564,21 +564,6 @@ int vma_is_stack_for_current(struct vm_area_struct *vma); · 563 unmodified lines
564564 struct mmu_gather;
565565 struct inode;
566566
567−#if !defined(CONFIG_ARCH_HAS_PTE_DEVMAP) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
568−static inline int pmd_devmap(pmd_t pmd)
569−{
570− return 0;
571−}
572−static inline int pud_devmap(pud_t pud)
573−{
574− return 0;
575−}
576−static inline int pgd_devmap(pgd_t pgd)
577−{
578− return 0;
579−}
580−#endif
581−
582567 /*
583568 * FIXME: take this include out, include page-flags.h in
584569 * files which need it (119 of them)
@@ -1643,19 +1628,27 @@ static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) · 1058 unmodified lines
16431628 return (unsigned long)val;
16441629 }
16451630
1631+void mm_trace_rss_stat(struct mm_struct *mm, int member, long count);
1632+
16461633 static inline void add_mm_counter(struct mm_struct *mm, int member, long value)
16471634 {
1648− atomic_long_add(value, &mm->rss_stat.count[member]);
1635+ long count = atomic_long_add_return(value, &mm->rss_stat.count[member]);
1636+
1637+ mm_trace_rss_stat(mm, member, count);
16491638 }
16501639
16511640 static inline void inc_mm_counter(struct mm_struct *mm, int member)
16521641 {
1653− atomic_long_inc(&mm->rss_stat.count[member]);
1642+ long count = atomic_long_inc_return(&mm->rss_stat.count[member]);
1643+
1644+ mm_trace_rss_stat(mm, member, count);
16541645 }
16551646
16561647 static inline void dec_mm_counter(struct mm_struct *mm, int member)
16571648 {
1658− atomic_long_dec(&mm->rss_stat.count[member]);
1649+ long count = atomic_long_dec_return(&mm->rss_stat.count[member]);
1650+
1651+ mm_trace_rss_stat(mm, member, count);
16591652 }
16601653
16611654 /* Optimized variant when page is already known not to be PageAnon */
@@ -2214,9 +2207,6 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...); · 552 unmodified lines
22142207
22152208 extern void setup_per_cpu_pageset(void);
22162209
2217−extern void zone_pcp_update(struct zone *zone);
2218−extern void zone_pcp_reset(struct zone *zone);
2219−
22202210 /* page_alloc.c */
22212211 extern int min_free_kbytes;
22222212 extern int watermark_boost_factor;
@@ -2780,7 +2770,7 @@ extern int sysctl_memory_failure_early_kill; · 557 unmodified lines
27802770 extern int sysctl_memory_failure_recovery;
27812771 extern void shake_page(struct page *p, int access);
27822772 extern atomic_long_t num_poisoned_pages __read_mostly;
2783−extern int soft_offline_page(struct page *page, int flags);
2773+extern int soft_offline_page(unsigned long pfn, int flags);
27842774
27852775
27862776 /*
include/linux/mmzone.h+20−14
@@ -273,12 +273,12 @@ enum lru_list { · 272 unmodified lines
273273
274274 #define for_each_evictable_lru(lru) for (lru = 0; lru <= LRU_ACTIVE_FILE; lru++)
275275
276−static inline int is_file_lru(enum lru_list lru)
276+static inline bool is_file_lru(enum lru_list lru)
277277 {
278278 return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE);
279279 }
280280
281−static inline int is_active_lru(enum lru_list lru)
281+static inline bool is_active_lru(enum lru_list lru)
282282 {
283283 return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE);
284284 }
@@ -296,6 +296,12 @@ struct zone_reclaim_stat { · 11 unmodified lines
296296 unsigned long recent_scanned[2];
297297 };
298298
299+enum lruvec_flags {
300+ LRUVEC_CONGESTED, /* lruvec has many dirty pages
301+ * backed by a congested BDI
302+ */
303+};
304+
299305 struct lruvec {
300306 struct list_head lists[NR_LRU_LISTS];
301307 struct zone_reclaim_stat reclaim_stat;
@@ -303,12 +309,14 @@ struct lruvec { · 1 unmodified line
303309 atomic_long_t inactive_age;
304310 /* Refaults at the time of last reclaim cycle */
305311 unsigned long refaults;
312+ /* Various lruvec state flags (enum lruvec_flags) */
313+ unsigned long flags;
306314 #ifdef CONFIG_MEMCG
307315 struct pglist_data *pgdat;
308316 #endif
309317 };
310318
311−/* Isolate unmapped file */
319+/* Isolate unmapped pages */
312320 #define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x2)
313321 /* Isolate for asynchronous migration */
314322 #define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x4)
@@ -572,9 +580,6 @@ struct zone { · 257 unmodified lines
572580 } ____cacheline_internodealigned_in_smp;
573581
574582 enum pgdat_flags {
575− PGDAT_CONGESTED, /* pgdat has many dirty pages backed by
576− * a congested BDI
577− */
578583 PGDAT_DIRTY, /* reclaim scanning has recently found
579584 * many dirty file pages at the tail
580585 * of the LRU.
@@ -777,7 +782,13 @@ typedef struct pglist_data { · 196 unmodified lines
777782 #endif
778783
779784 /* Fields commonly accessed by the page reclaim scanner */
780− struct lruvec lruvec;
785+
786+ /*
787+ * NOTE: THIS IS UNUSED IF MEMCG IS ENABLED.
788+ *
789+ * Use mem_cgroup_lruvec() to look up lruvecs.
790+ */
791+ struct lruvec __lruvec;
781792
782793 unsigned long flags;
783794
@@ -800,11 +811,6 @@ typedef struct pglist_data { · 16 unmodified lines
800811 #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
801812 #define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid))
802813
803−static inline struct lruvec *node_lruvec(struct pglist_data *pgdat)
804−{
805− return &pgdat->lruvec;
806−}
807−
808814 static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat)
809815 {
810816 return pgdat->node_start_pfn + pgdat->node_spanned_pages;
@@ -842,7 +848,7 @@ static inline struct pglist_data *lruvec_pgdat(struct lruvec *lruvec) · 31 unmodified lines
842848 #ifdef CONFIG_MEMCG
843849 return lruvec->pgdat;
844850 #else
845− return container_of(lruvec, struct pglist_data, lruvec);
851+ return container_of(lruvec, struct pglist_data, __lruvec);
846852 #endif
847853 }
848854
@@ -1079,7 +1085,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, · 230 unmodified lines
10791085 /**
10801086 * for_each_zone_zonelist_nodemask - helper macro to iterate over valid zones in a zonelist at or below a given zone index and within a nodemask
10811087 * @zone - The current zone in the iterator
1082− * @z - The current pointer within zonelist->zones being iterated
1088+ * @z - The current pointer within zonelist->_zonerefs being iterated
10831089 * @zlist - The zonelist being iterated
10841090 * @highidx - The zone index of the highest zone to return
10851091 * @nodemask - Nodemask allowed by the allocator
include/linux/moduleloader.h+1−1
@@ -91,7 +91,7 @@ void module_arch_cleanup(struct module *mod); · 90 unmodified lines
9191 /* Any cleanup before freeing mod->module_init */
9292 void module_arch_freeing_init(struct module *mod);
9393
94−#ifdef CONFIG_KASAN
94+#if defined(CONFIG_KASAN) && !defined(CONFIG_KASAN_VMALLOC)
9595 #include <linux/kasan.h>
9696 #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT)
9797 #else
include/linux/page-isolation.h+2−2
@@ -30,7 +30,7 @@ static inline bool is_migrate_isolate(int migratetype) · 29 unmodified lines
3030 }
3131 #endif
3232
33−#define SKIP_HWPOISON 0x1
33+#define MEMORY_OFFLINE 0x1
3434 #define REPORT_FAILURE 0x2
3535
3636 bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
@@ -58,7 +58,7 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, · 21 unmodified lines
5858 * Test all pages in [start_pfn, end_pfn) are isolated or not.
5959 */
6060 int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
61− bool skip_hwpoisoned_pages);
61+ int isol_flags);
6262
6363 struct page *alloc_migrate_target(struct page *page, unsigned long private);
6464
include/linux/slab.h+0−20
@@ -561,26 +561,6 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) · 560 unmodified lines
561561 return __kmalloc(size, flags);
562562 }
563563
564−/*
565− * Determine size used for the nth kmalloc cache.
566− * return size or 0 if a kmalloc cache for that
567− * size does not exist
568− */
569−static __always_inline unsigned int kmalloc_size(unsigned int n)
570−{
571−#ifndef CONFIG_SLOB
572− if (n > 2)
573− return 1U << n;
574−
575− if (n == 1 && KMALLOC_MIN_SIZE <= 32)
576− return 96;
577−
578− if (n == 2 && KMALLOC_MIN_SIZE <= 64)
579− return 192;
580−#endif
581− return 0;
582−}
583−
584564 static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
585565 {
586566 #ifndef CONFIG_SLOB
include/linux/string.h+2−0
@@ -216,6 +216,8 @@ int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __printf(3, 4); · 215 unmodified lines
216216 extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
217217 const void *from, size_t available);
218218
219+int ptr_to_hashval(const void *ptr, unsigned long *hashval_out);
220+
219221 /**
220222 * strstarts - does @str start with @prefix?
221223 * @str: string to examine
include/linux/swap.h+1−1
@@ -307,7 +307,7 @@ struct vma_swap_readahead { · 306 unmodified lines
307307 };
308308
309309 /* linux/mm/workingset.c */
310−void *workingset_eviction(struct page *page);
310+void *workingset_eviction(struct page *page, struct mem_cgroup *target_memcg);
311311 void workingset_refault(struct page *page, void *shadow);
312312 void workingset_activation(struct page *page);
313313
include/linux/vmalloc.h+12−0
@@ -22,6 +22,18 @@ struct notifier_block; /* in notifier.h */ · 21 unmodified lines
2222 #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */
2323 #define VM_NO_GUARD 0x00000040 /* don't add guard page */
2424 #define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */
25+
26+/*
27+ * VM_KASAN is used slighly differently depending on CONFIG_KASAN_VMALLOC.
28+ *
29+ * If IS_ENABLED(CONFIG_KASAN_VMALLOC), VM_KASAN is set on a vm_struct after
30+ * shadow memory has been mapped. It's used to handle allocation errors so that
31+ * we don't try to poision shadow on free if it was never allocated.
32+ *
33+ * Otherwise, VM_KASAN is set for kasan_module_alloc() allocations and used to
34+ * determine which allocations need the module shadow freed.
35+ */
36+
2537 /*
2638 * Memory with VM_FLUSH_RESET_PERMS cannot be freed in an interrupt or with
2739 * vfree_atomic().

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t