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
3156};3156};
3157 3157
3158void dio_end_io(struct bio *bio);3158void dio_end_io(struct bio *bio);
3159void dio_warn_stale_pagecache(struct file *filp);
3160 3159
3161ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,3160ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
3162 struct block_device *bdev, struct iov_iter *iter,3161 struct block_device *bdev, struct iov_iter *iter,
@@ -3201,6 +3200,11 @@ static inline void inode_dio_end(struct inode *inode) · 38 unmodified lines
3201 wake_up_bit(&inode->i_state, __I_DIO_WAKEUP);3200 wake_up_bit(&inode->i_state, __I_DIO_WAKEUP);
3202}3201}
3203 3202
3203/*
3204 * Warn about a page cache invalidation failure diring a direct I/O write.
3205 */
3206void dio_warn_stale_pagecache(struct file *filp);
3207
3204extern void inode_set_flags(struct inode *inode, unsigned int flags,3208extern void inode_set_flags(struct inode *inode, unsigned int flags,
3205 unsigned int mask);3209 unsigned int mask);
3206 3210
include/linux/gfp.h+2−0
@@ -612,6 +612,8 @@ static inline bool pm_suspended_storage(void) · 611 unmodified lines
612/* The below functions must be run on a range from a single zone. */612/* The below functions must be run on a range from a single zone. */
613extern int alloc_contig_range(unsigned long start, unsigned long end,613extern int alloc_contig_range(unsigned long start, unsigned long end,
614 unsigned migratetype, gfp_t gfp_mask);614 unsigned migratetype, gfp_t gfp_mask);
615extern struct page *alloc_contig_pages(unsigned long nr_pages, gfp_t gfp_mask,
616 int nid, nodemask_t *nodemask);
615#endif617#endif
616void free_contig_range(unsigned long pfn, unsigned int nr_pages);618void free_contig_range(unsigned long pfn, unsigned int nr_pages);
617 619
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
105void free_huge_page(struct page *page);105void free_huge_page(struct page *page);
106void hugetlb_fix_reserve_counts(struct inode *inode);106void hugetlb_fix_reserve_counts(struct inode *inode);
107extern struct mutex *hugetlb_fault_mutex_table;107extern struct mutex *hugetlb_fault_mutex_table;
108u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping,108u32 hugetlb_fault_mutex_hash(struct address_space *mapping, pgoff_t idx);
109 pgoff_t idx, unsigned long address);
110 109
111pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud);110pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud);
112 111
@@ -164,38 +163,130 @@ static inline void adjust_range_if_pmd_sharing_possible( · 51 unmodified lines
164{163{
165}164}
166 165
167#define follow_hugetlb_page(m,v,p,vs,a,b,i,w,n) ({ BUG(); 0; })166static inline long follow_hugetlb_page(struct mm_struct *mm,
168#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)167 struct vm_area_struct *vma, struct page **pages,
169#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })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
176static inline struct page *follow_huge_addr(struct mm_struct *mm,
177 unsigned long address, int write)
178{
179 return ERR_PTR(-EINVAL);
180}
181
182static 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
170static inline void hugetlb_report_meminfo(struct seq_file *m)189static inline void hugetlb_report_meminfo(struct seq_file *m)
171{190{
172}191}
173#define hugetlb_report_node_meminfo(n, buf) 0192
193static inline int hugetlb_report_node_meminfo(int nid, char *buf)
194{
195 return 0;
196}
197
174static inline void hugetlb_show_meminfo(void)198static inline void hugetlb_show_meminfo(void)
175{199{
176}200}
177#define follow_huge_pd(vma, addr, hpd, flags, pdshift) NULL201
178#define follow_huge_pmd(mm, addr, pmd, flags) NULL202static inline struct page *follow_huge_pd(struct vm_area_struct *vma,
179#define follow_huge_pud(mm, addr, pud, flags) NULL203 unsigned long address, hugepd_t hpd, int flags,
180#define follow_huge_pgd(mm, addr, pgd, flags) NULL204 int pdshift)
181#define prepare_hugepage_range(file, addr, len) (-EINVAL)205{
182#define pmd_huge(x) 0206 return NULL;
183#define pud_huge(x) 0207}
184#define is_hugepage_only_range(mm, addr, len) 0208
185#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })209static inline struct page *follow_huge_pmd(struct mm_struct *mm,
186#define hugetlb_mcopy_atomic_pte(dst_mm, dst_pte, dst_vma, dst_addr, \210 unsigned long address, pmd_t *pmd, int flags)
187 src_addr, pagep) ({ BUG(); 0; })211{
188#define huge_pte_offset(mm, address, sz) 0212 return NULL;
213}
214
215static 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
221static 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
227static inline int prepare_hugepage_range(struct file *file,
228 unsigned long addr, unsigned long len)
229{
230 return -EINVAL;
231}
232
233static inline int pmd_huge(pmd_t pmd)
234{
235 return 0;
236}
237
238static inline int pud_huge(pud_t pud)
239{
240 return 0;
241}
242
243static inline int is_hugepage_only_range(struct mm_struct *mm,
244 unsigned long addr, unsigned long len)
245{
246 return 0;
247}
248
249static 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
256static 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
267static inline pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr,
268 unsigned long sz)
269{
270 return NULL;
271}
189 272
190static inline bool isolate_huge_page(struct page *page, struct list_head *list)273static inline bool isolate_huge_page(struct page *page, struct list_head *list)
191{274{
192 return false;275 return false;
193}276}
194#define putback_active_hugepage(p) do {} while (0)
195#define move_hugetlb_state(old, new, reason) do {} while (0)
196 277
197static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma,278static inline void putback_active_hugepage(struct page *page)
198 unsigned long address, unsigned long end, pgprot_t newprot)279{
280}
281
282static inline void move_hugetlb_state(struct page *oldpage,
283 struct page *newpage, int reason)
284{
285}
286
287static inline unsigned long hugetlb_change_protection(
288 struct vm_area_struct *vma, unsigned long address,
289 unsigned long end, pgprot_t newprot)
199{290{
200 return 0;291 return 0;
201}292}
@@ -213,9 +304,10 @@ static inline void __unmap_hugepage_range(struct mmu_gather *tlb, · 11 unmodified lines
213{304{
214 BUG();305 BUG();
215}306}
307
216static inline vm_fault_t hugetlb_fault(struct mm_struct *mm,308static inline vm_fault_t hugetlb_fault(struct mm_struct *mm,
217 struct vm_area_struct *vma, unsigned long address,309 struct vm_area_struct *vma, unsigned long address,
218 unsigned int flags)310 unsigned int flags)
219{311{
220 BUG();312 BUG();
221 return 0;313 return 0;
include/linux/kasan.h+31−0
@@ -70,8 +70,18 @@ struct kasan_cache { · 69 unmodified lines
70 int free_meta_offset;70 int free_meta_offset;
71};71};
72 72
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
73int kasan_module_alloc(void *addr, size_t size);79int kasan_module_alloc(void *addr, size_t size);
74void kasan_free_shadow(const struct vm_struct *vm);80void kasan_free_shadow(const struct vm_struct *vm);
81#else
82static inline int kasan_module_alloc(void *addr, size_t size) { return 0; }
83static inline void kasan_free_shadow(const struct vm_struct *vm) {}
84#endif
75 85
76int kasan_add_zero_shadow(void *start, unsigned long size);86int kasan_add_zero_shadow(void *start, unsigned long size);
77void kasan_remove_zero_shadow(void *start, unsigned long size);87void 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
194 204
195#endif /* CONFIG_KASAN_SW_TAGS */205#endif /* CONFIG_KASAN_SW_TAGS */
196 206
207#ifdef CONFIG_KASAN_VMALLOC
208int kasan_populate_vmalloc(unsigned long requested_size,
209 struct vm_struct *area);
210void kasan_poison_vmalloc(void *start, unsigned long size);
211void kasan_release_vmalloc(unsigned long start, unsigned long end,
212 unsigned long free_region_start,
213 unsigned long free_region_end);
214#else
215static inline int kasan_populate_vmalloc(unsigned long requested_size,
216 struct vm_struct *area)
217{
218 return 0;
219}
220
221static inline void kasan_poison_vmalloc(void *start, unsigned long size) {}
222static 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
197#endif /* LINUX_KASAN_H */228#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
358 MEMBLOCK_ALLOC_ACCESSIBLE);358 MEMBLOCK_ALLOC_ACCESSIBLE);
359}359}
360 360
361void *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);
361void *memblock_alloc_try_nid_raw(phys_addr_t size, phys_addr_t align,364void *memblock_alloc_try_nid_raw(phys_addr_t size, phys_addr_t align,
362 phys_addr_t min_addr, phys_addr_t max_addr,365 phys_addr_t min_addr, phys_addr_t max_addr,
363 int nid);366 int nid);
include/linux/memcontrol.h+22−27
@@ -58,7 +58,6 @@ enum mem_cgroup_protection { · 57 unmodified lines
58 58
59struct mem_cgroup_reclaim_cookie {59struct mem_cgroup_reclaim_cookie {
60 pg_data_t *pgdat;60 pg_data_t *pgdat;
61 int priority;
62 unsigned int generation;61 unsigned int generation;
63};62};
64 63
@@ -81,7 +80,6 @@ struct mem_cgroup_id { · 16 unmodified lines
81enum mem_cgroup_events_target {80enum mem_cgroup_events_target {
82 MEM_CGROUP_TARGET_THRESH,81 MEM_CGROUP_TARGET_THRESH,
83 MEM_CGROUP_TARGET_SOFTLIMIT,82 MEM_CGROUP_TARGET_SOFTLIMIT,
84 MEM_CGROUP_TARGET_NUMAINFO,
85 MEM_CGROUP_NTARGETS,83 MEM_CGROUP_NTARGETS,
86};84};
87 85
@@ -112,7 +110,7 @@ struct memcg_shrinker_map { · 24 unmodified lines
112};110};
113 111
114/*112/*
115 * per-zone information in memory controller.113 * per-node information in memory controller.
116 */114 */
117struct mem_cgroup_per_node {115struct mem_cgroup_per_node {
118 struct lruvec lruvec;116 struct lruvec lruvec;
@@ -126,7 +124,7 @@ struct mem_cgroup_per_node { · 7 unmodified lines
126 124
127 unsigned long lru_zone_size[MAX_NR_ZONES][NR_LRU_LISTS];125 unsigned long lru_zone_size[MAX_NR_ZONES][NR_LRU_LISTS];
128 126
129 struct mem_cgroup_reclaim_iter iter[DEF_PRIORITY + 1];127 struct mem_cgroup_reclaim_iter iter;
130 128
131 struct memcg_shrinker_map __rcu *shrinker_map;129 struct memcg_shrinker_map __rcu *shrinker_map;
132 130
@@ -134,9 +132,6 @@ struct mem_cgroup_per_node { · 1 unmodified line
134 unsigned long usage_in_excess;/* Set to the value by which */132 unsigned long usage_in_excess;/* Set to the value by which */
135 /* the soft limit is exceeded*/133 /* the soft limit is exceeded*/
136 bool on_tree;134 bool on_tree;
137 bool congested; /* memcg has many dirty pages */
138 /* backed by a congested BDI */
139
140 struct mem_cgroup *memcg; /* Back pointer, we cannot */135 struct mem_cgroup *memcg; /* Back pointer, we cannot */
141 /* use container_of */136 /* use container_of */
142};137};
@@ -313,13 +308,6 @@ struct mem_cgroup { · 170 unmodified lines
313 struct list_head kmem_caches;308 struct list_head kmem_caches;
314#endif309#endif
315 310
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
323#ifdef CONFIG_CGROUP_WRITEBACK311#ifdef CONFIG_CGROUP_WRITEBACK
324 struct list_head cgwb_list;312 struct list_head cgwb_list;
325 struct wb_domain cgwb_domain;313 struct wb_domain cgwb_domain;
@@ -394,25 +382,27 @@ mem_cgroup_nodeinfo(struct mem_cgroup *memcg, int nid) · 68 unmodified lines
394}382}
395 383
396/**384/**
397 * mem_cgroup_lruvec - get the lru list vector for a node or a memcg zone385 * mem_cgroup_lruvec - get the lru list vector for a memcg & node
398 * @node: node of the wanted lruvec
399 * @memcg: memcg of the wanted lruvec386 * @memcg: memcg of the wanted lruvec
400 *387 *
401 * Returns the lru list vector holding pages for a given @node or a given388 * Returns the lru list vector holding pages for a given @memcg &
402 * @memcg and @zone. This can be the node lruvec, if the memory controller389 * @node combination. This can be the node lruvec, if the memory
403 * is disabled.390 * controller is disabled.
404 */391 */
405static inline struct lruvec *mem_cgroup_lruvec(struct pglist_data *pgdat,392static inline struct lruvec *mem_cgroup_lruvec(struct mem_cgroup *memcg,
406 struct mem_cgroup *memcg)393 struct pglist_data *pgdat)
407{394{
408 struct mem_cgroup_per_node *mz;395 struct mem_cgroup_per_node *mz;
409 struct lruvec *lruvec;396 struct lruvec *lruvec;
410 397
411 if (mem_cgroup_disabled()) {398 if (mem_cgroup_disabled()) {
412 lruvec = node_lruvec(pgdat);399 lruvec = &pgdat->__lruvec;
413 goto out;400 goto out;
414 }401 }
415 402
403 if (!memcg)
404 memcg = root_mem_cgroup;
405
416 mz = mem_cgroup_nodeinfo(memcg, pgdat->node_id);406 mz = mem_cgroup_nodeinfo(memcg, pgdat->node_id);
417 lruvec = &mz->lruvec;407 lruvec = &mz->lruvec;
418out:408out:
@@ -728,7 +718,7 @@ static inline void __mod_lruvec_page_state(struct page *page, · 309 unmodified lines
728 return;718 return;
729 }719 }
730 720
731 lruvec = mem_cgroup_lruvec(pgdat, page->mem_cgroup);721 lruvec = mem_cgroup_lruvec(page->mem_cgroup, pgdat);
732 __mod_lruvec_state(lruvec, idx, val);722 __mod_lruvec_state(lruvec, idx, val);
733}723}
734 724
@@ -899,16 +889,21 @@ static inline void mem_cgroup_migrate(struct page *old, struct page *new) · 164 unmodified lines
899{889{
900}890}
901 891
902static inline struct lruvec *mem_cgroup_lruvec(struct pglist_data *pgdat,892static inline struct lruvec *mem_cgroup_lruvec(struct mem_cgroup *memcg,
903 struct mem_cgroup *memcg)893 struct pglist_data *pgdat)
904{894{
905 return node_lruvec(pgdat);895 return &pgdat->__lruvec;
906}896}
907 897
908static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page,898static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page,
909 struct pglist_data *pgdat)899 struct pglist_data *pgdat)
910{900{
911 return &pgdat->lruvec;901 return &pgdat->__lruvec;
902}
903
904static inline struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg)
905{
906 return NULL;
912}907}
913 908
914static inline bool mm_match_cgroup(struct mm_struct *mm,909static 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
102 102
103typedef void (*online_page_callback_t)(struct page *page, unsigned int order);103typedef void (*online_page_callback_t)(struct page *page, unsigned int order);
104 104
105extern void generic_online_page(struct page *page, unsigned int order);
105extern int set_online_page_callback(online_page_callback_t callback);106extern int set_online_page_callback(online_page_callback_t callback);
106extern int restore_online_page_callback(online_page_callback_t callback);107extern int restore_online_page_callback(online_page_callback_t callback);
107 108
108extern void __online_page_set_limits(struct page *page);
109extern void __online_page_increment_counters(struct page *page);
110extern void __online_page_free(struct page *page);
111
112extern int try_online_node(int nid);109extern int try_online_node(int nid);
113 110
114extern int arch_add_memory(int nid, u64 start, u64 size,111extern int arch_add_memory(int nid, u64 start, u64 size,
@@ -229,9 +226,6 @@ void put_online_mems(void); · 114 unmodified lines
229void mem_hotplug_begin(void);226void mem_hotplug_begin(void);
230void mem_hotplug_done(void);227void mem_hotplug_done(void);
231 228
232extern void set_zone_contiguous(struct zone *zone);
233extern void clear_zone_contiguous(struct zone *zone);
234
235#else /* ! CONFIG_MEMORY_HOTPLUG */229#else /* ! CONFIG_MEMORY_HOTPLUG */
236#define pfn_to_online_page(pfn) \230#define pfn_to_online_page(pfn) \
237({ \231({ \
@@ -339,6 +333,9 @@ static inline int remove_memory(int nid, u64 start, u64 size) · 101 unmodified lines
339static inline void __remove_memory(int nid, u64 start, u64 size) {}333static inline void __remove_memory(int nid, u64 start, u64 size) {}
340#endif /* CONFIG_MEMORY_HOTREMOVE */334#endif /* CONFIG_MEMORY_HOTREMOVE */
341 335
336extern void set_zone_contiguous(struct zone *zone);
337extern void clear_zone_contiguous(struct zone *zone);
338
342extern void __ref free_area_init_core_hotplug(int nid);339extern void __ref free_area_init_core_hotplug(int nid);
343extern int __add_memory(int nid, u64 start, u64 size);340extern int __add_memory(int nid, u64 start, u64 size);
344extern int add_memory(int nid, u64 start, u64 size);341extern 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
564struct mmu_gather;564struct mmu_gather;
565struct inode;565struct inode;
566 566
567#if !defined(CONFIG_ARCH_HAS_PTE_DEVMAP) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
568static inline int pmd_devmap(pmd_t pmd)
569{
570 return 0;
571}
572static inline int pud_devmap(pud_t pud)
573{
574 return 0;
575}
576static inline int pgd_devmap(pgd_t pgd)
577{
578 return 0;
579}
580#endif
581
582/*567/*
583 * FIXME: take this include out, include page-flags.h in568 * FIXME: take this include out, include page-flags.h in
584 * files which need it (119 of them)569 * 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
1643 return (unsigned long)val;1628 return (unsigned long)val;
1644}1629}
1645 1630
1631void mm_trace_rss_stat(struct mm_struct *mm, int member, long count);
1632
1646static inline void add_mm_counter(struct mm_struct *mm, int member, long value)1633static inline void add_mm_counter(struct mm_struct *mm, int member, long value)
1647{1634{
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);
1649}1638}
1650 1639
1651static inline void inc_mm_counter(struct mm_struct *mm, int member)1640static inline void inc_mm_counter(struct mm_struct *mm, int member)
1652{1641{
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);
1654}1645}
1655 1646
1656static inline void dec_mm_counter(struct mm_struct *mm, int member)1647static inline void dec_mm_counter(struct mm_struct *mm, int member)
1657{1648{
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);
1659}1652}
1660 1653
1661/* Optimized variant when page is already known not to be PageAnon */1654/* 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
2214 2207
2215extern void setup_per_cpu_pageset(void);2208extern void setup_per_cpu_pageset(void);
2216 2209
2217extern void zone_pcp_update(struct zone *zone);
2218extern void zone_pcp_reset(struct zone *zone);
2219
2220/* page_alloc.c */2210/* page_alloc.c */
2221extern int min_free_kbytes;2211extern int min_free_kbytes;
2222extern int watermark_boost_factor;2212extern int watermark_boost_factor;
@@ -2780,7 +2770,7 @@ extern int sysctl_memory_failure_early_kill; · 557 unmodified lines
2780extern int sysctl_memory_failure_recovery;2770extern int sysctl_memory_failure_recovery;
2781extern void shake_page(struct page *p, int access);2771extern void shake_page(struct page *p, int access);
2782extern atomic_long_t num_poisoned_pages __read_mostly;2772extern atomic_long_t num_poisoned_pages __read_mostly;
2783extern int soft_offline_page(struct page *page, int flags);2773extern int soft_offline_page(unsigned long pfn, int flags);
2784 2774
2785 2775
2786/*2776/*
include/linux/mmzone.h+20−14
@@ -273,12 +273,12 @@ enum lru_list { · 272 unmodified lines
273 273
274#define for_each_evictable_lru(lru) for (lru = 0; lru <= LRU_ACTIVE_FILE; lru++)274#define for_each_evictable_lru(lru) for (lru = 0; lru <= LRU_ACTIVE_FILE; lru++)
275 275
276static inline int is_file_lru(enum lru_list lru)276static inline bool is_file_lru(enum lru_list lru)
277{277{
278 return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE);278 return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE);
279}279}
280 280
281static inline int is_active_lru(enum lru_list lru)281static inline bool is_active_lru(enum lru_list lru)
282{282{
283 return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE);283 return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE);
284}284}
@@ -296,6 +296,12 @@ struct zone_reclaim_stat { · 11 unmodified lines
296 unsigned long recent_scanned[2];296 unsigned long recent_scanned[2];
297};297};
298 298
299enum lruvec_flags {
300 LRUVEC_CONGESTED, /* lruvec has many dirty pages
301 * backed by a congested BDI
302 */
303};
304
299struct lruvec {305struct lruvec {
300 struct list_head lists[NR_LRU_LISTS];306 struct list_head lists[NR_LRU_LISTS];
301 struct zone_reclaim_stat reclaim_stat;307 struct zone_reclaim_stat reclaim_stat;
@@ -303,12 +309,14 @@ struct lruvec { · 1 unmodified line
303 atomic_long_t inactive_age;309 atomic_long_t inactive_age;
304 /* Refaults at the time of last reclaim cycle */310 /* Refaults at the time of last reclaim cycle */
305 unsigned long refaults;311 unsigned long refaults;
312 /* Various lruvec state flags (enum lruvec_flags) */
313 unsigned long flags;
306#ifdef CONFIG_MEMCG314#ifdef CONFIG_MEMCG
307 struct pglist_data *pgdat;315 struct pglist_data *pgdat;
308#endif316#endif
309};317};
310 318
311/* Isolate unmapped file */319/* Isolate unmapped pages */
312#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x2)320#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x2)
313/* Isolate for asynchronous migration */321/* Isolate for asynchronous migration */
314#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x4)322#define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x4)
@@ -572,9 +580,6 @@ struct zone { · 257 unmodified lines
572} ____cacheline_internodealigned_in_smp;580} ____cacheline_internodealigned_in_smp;
573 581
574enum pgdat_flags {582enum pgdat_flags {
575 PGDAT_CONGESTED, /* pgdat has many dirty pages backed by
576 * a congested BDI
577 */
578 PGDAT_DIRTY, /* reclaim scanning has recently found583 PGDAT_DIRTY, /* reclaim scanning has recently found
579 * many dirty file pages at the tail584 * many dirty file pages at the tail
580 * of the LRU.585 * of the LRU.
@@ -777,7 +782,13 @@ typedef struct pglist_data { · 196 unmodified lines
777#endif782#endif
778 783
779 /* Fields commonly accessed by the page reclaim scanner */784 /* 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;
781 792
782 unsigned long flags;793 unsigned long flags;
783 794
@@ -800,11 +811,6 @@ typedef struct pglist_data { · 16 unmodified lines
800#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)811#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
801#define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid))812#define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid))
802 813
803static inline struct lruvec *node_lruvec(struct pglist_data *pgdat)
804{
805 return &pgdat->lruvec;
806}
807
808static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat)814static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat)
809{815{
810 return pgdat->node_start_pfn + pgdat->node_spanned_pages;816 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
842#ifdef CONFIG_MEMCG848#ifdef CONFIG_MEMCG
843 return lruvec->pgdat;849 return lruvec->pgdat;
844#else850#else
845 return container_of(lruvec, struct pglist_data, lruvec);851 return container_of(lruvec, struct pglist_data, __lruvec);
846#endif852#endif
847}853}
848 854
@@ -1079,7 +1085,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, · 230 unmodified lines
1079/**1085/**
1080 * 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 nodemask1086 * 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
1081 * @zone - The current zone in the iterator1087 * @zone - The current zone in the iterator
1082 * @z - The current pointer within zonelist->zones being iterated1088 * @z - The current pointer within zonelist->_zonerefs being iterated
1083 * @zlist - The zonelist being iterated1089 * @zlist - The zonelist being iterated
1084 * @highidx - The zone index of the highest zone to return1090 * @highidx - The zone index of the highest zone to return
1085 * @nodemask - Nodemask allowed by the allocator1091 * @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
91/* Any cleanup before freeing mod->module_init */91/* Any cleanup before freeing mod->module_init */
92void module_arch_freeing_init(struct module *mod);92void module_arch_freeing_init(struct module *mod);
93 93
94#ifdef CONFIG_KASAN94#if defined(CONFIG_KASAN) && !defined(CONFIG_KASAN_VMALLOC)
95#include <linux/kasan.h>95#include <linux/kasan.h>
96#define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT)96#define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT)
97#else97#else
include/linux/page-isolation.h+2−2
@@ -30,7 +30,7 @@ static inline bool is_migrate_isolate(int migratetype) · 29 unmodified lines
30}30}
31#endif31#endif
32 32
33#define SKIP_HWPOISON 0x133#define MEMORY_OFFLINE 0x1
34#define REPORT_FAILURE 0x234#define REPORT_FAILURE 0x2
35 35
36bool has_unmovable_pages(struct zone *zone, struct page *page, int count,36bool 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
58 * Test all pages in [start_pfn, end_pfn) are isolated or not.58 * Test all pages in [start_pfn, end_pfn) are isolated or not.
59 */59 */
60int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,60int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
61 bool skip_hwpoisoned_pages);61 int isol_flags);
62 62
63struct page *alloc_migrate_target(struct page *page, unsigned long private);63struct page *alloc_migrate_target(struct page *page, unsigned long private);
64 64
include/linux/slab.h+0−20
@@ -561,26 +561,6 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) · 560 unmodified lines
561 return __kmalloc(size, flags);561 return __kmalloc(size, flags);
562}562}
563 563
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 */
569static __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
584static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)564static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
585{565{
586#ifndef CONFIG_SLOB566#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
216extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,216extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
217 const void *from, size_t available);217 const void *from, size_t available);
218 218
219int ptr_to_hashval(const void *ptr, unsigned long *hashval_out);
220
219/**221/**
220 * strstarts - does @str start with @prefix?222 * strstarts - does @str start with @prefix?
221 * @str: string to examine223 * @str: string to examine
include/linux/swap.h+1−1
@@ -307,7 +307,7 @@ struct vma_swap_readahead { · 306 unmodified lines
307};307};
308 308
309/* linux/mm/workingset.c */309/* linux/mm/workingset.c */
310void *workingset_eviction(struct page *page);310void *workingset_eviction(struct page *page, struct mem_cgroup *target_memcg);
311void workingset_refault(struct page *page, void *shadow);311void workingset_refault(struct page *page, void *shadow);
312void workingset_activation(struct page *page);312void workingset_activation(struct page *page);
313 313
include/linux/vmalloc.h+12−0
@@ -22,6 +22,18 @@ struct notifier_block; /* in notifier.h */ · 21 unmodified lines
22#define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */22#define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */
23#define VM_NO_GUARD 0x00000040 /* don't add guard page */23#define VM_NO_GUARD 0x00000040 /* don't add guard page */
24#define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */24#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
25/*37/*
26 * Memory with VM_FLUSH_RESET_PERMS cannot be freed in an interrupt or with38 * Memory with VM_FLUSH_RESET_PERMS cannot be freed in an interrupt or with
27 * vfree_atomic().39 * 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