History

Merge branch 'akpm' (patches from Andrew)

Merge misc updates from Andrew Morton: - a few misc things - ocfs2 updates - most of MM * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (159 commits) tools/testing/selftests/proc/proc-self-syscall.c: remove duplicate include proc: more robust bulk read test proc: test /proc/*/maps, smaps, smaps_rollup, statm proc: use seq_puts() everywhere proc: read kernel cpu stat pointer once proc: remove unused argument in proc_pid_lookup() fs/proc/thread_self.c: code cleanup for proc_setup_thread_self() fs/proc/self.c: code cleanup for proc_setup_self() proc: return exit code 4 for skipped tests mm,mremap: bail out earlier in mremap_to under map pressure mm/sparse: fix a bad comparison mm/memory.c: do_fault: avoid usage of stale vm_area_struct writeback: fix inode cgroup switching comment mm/huge_memory.c: fix "orig_pud" set but not used mm/hotplug: fix an imbalance with DEBUG_PAGEALLOC mm/memcontrol.c: fix bad line in comment mm/cma.c: cma_declare_contiguous: correct err handling mm/page_ext.c: fix an imbalance with kmemleak mm/compaction: pass pgdat to too_many_isolated() instead of zone mm: remove zone_lru_lock() function, access ->lru_lock directly ...

Linus Torvalds committed 7 years ago

Commit 8dcd1752 parents afe6fe7 fff0490213 files · +4918 −2315Browse files

Showing the changes to include/linux (27 of 213 files). Show all

Unified · Split

27 files
  1. include/linux/backing-dev.h +1 −1
  2. include/linux/balloon_compaction.h +13 −21
  3. include/linux/cgroup-defs.h +4 −0
  4. include/linux/compaction.h +3 −4
  5. include/linux/device.h +1 −1
  6. include/linux/frontswap.h +7 −0
  7. include/linux/fs.h +1 −1
  8. include/linux/gfp.h +15 −15
  9. include/linux/hugetlb.h +67 −3
  10. include/linux/kasan-checks.h +1 −1
  11. include/linux/kernfs.h +6 −0
  12. include/linux/ksm.h +7 −0
  13. include/linux/list.h +11 −0
  14. include/linux/memcontrol.h +43 −4
  15. include/linux/memory_hotplug.h +1 −1
  16. include/linux/mm.h +2 −1
  17. include/linux/mm_types.h +1 −1
  18. include/linux/mmzone.h +3 −5
  19. include/linux/nodemask.h +4 −4
  20. include/linux/page-flags.h +38 −6
  21. include/linux/pagemap.h +9 −22
  22. include/linux/poison.h +1 −1
  23. include/linux/sched.h +5 −0
  24. include/linux/sched/mm.h +40 −8
  25. include/linux/shmem_fs.h +2 −1
  26. include/linux/slub_def.h +6 −6
  27. include/linux/swap.h +2 −2
include/linux/backing-dev.h+1−1
@@ -365,7 +365,7 @@ unlocked_inode_to_wb_begin(struct inode *inode, struct wb_lock_cookie *cookie) · 364 unmodified lines
365 rcu_read_lock();365 rcu_read_lock();
366 366
367 /*367 /*
368 * Paired with store_release in inode_switch_wb_work_fn() and368 * Paired with store_release in inode_switch_wbs_work_fn() and
369 * ensures that we see the new wb if we see cleared I_WB_SWITCH.369 * ensures that we see the new wb if we see cleared I_WB_SWITCH.
370 */370 */
371 cookie->locked = smp_load_acquire(&inode->i_state) & I_WB_SWITCH;371 cookie->locked = smp_load_acquire(&inode->i_state) & I_WB_SWITCH;
include/linux/balloon_compaction.h+13−21
@@ -4,15 +4,18 @@ · 3 unmodified lines
4 *4 *
5 * Common interface definitions for making balloon pages movable by compaction.5 * Common interface definitions for making balloon pages movable by compaction.
6 *6 *
7 * Despite being perfectly possible to perform ballooned pages migration, they7 * Balloon page migration makes use of the general non-lru movable page
8 * make a special corner case to compaction scans because balloon pages are not8 * feature.
9 * enlisted at any LRU list like the other pages we do compact / migrate.9 *
10 * page->private is used to reference the responsible balloon device.
11 * page->mapping is used in context of non-lru page migration to reference
12 * the address space operations for page isolation/migration/compaction.
10 *13 *
11 * As the page isolation scanning step a compaction thread does is a lockless14 * As the page isolation scanning step a compaction thread does is a lockless
12 * procedure (from a page standpoint), it might bring some racy situations while15 * procedure (from a page standpoint), it might bring some racy situations while
13 * performing balloon page compaction. In order to sort out these racy scenarios16 * performing balloon page compaction. In order to sort out these racy scenarios
14 * and safely perform balloon's page compaction and migration we must, always,17 * and safely perform balloon's page compaction and migration we must, always,
15 * ensure following these three simple rules:18 * ensure following these simple rules:
16 *19 *
17 * i. when updating a balloon's page ->mapping element, strictly do it under20 * i. when updating a balloon's page ->mapping element, strictly do it under
18 * the following lock order, independently of the far superior21 * the following lock order, independently of the far superior
@@ -21,19 +24,8 @@ · 2 unmodified lines
21 * +--spin_lock_irq(&b_dev_info->pages_lock);24 * +--spin_lock_irq(&b_dev_info->pages_lock);
22 * ... page->mapping updates here ...25 * ... page->mapping updates here ...
23 *26 *
24 * ii. before isolating or dequeueing a balloon page from the balloon device27 * ii. isolation or dequeueing procedure must remove the page from balloon
25 * pages list, the page reference counter must be raised by one and the28 * device page list under b_dev_info->pages_lock.
26 * extra refcount must be dropped when the page is enqueued back into
27 * the balloon device page list, thus a balloon page keeps its reference
28 * counter raised only while it is under our special handling;
29 *
30 * iii. after the lockless scan step have selected a potential balloon page for
31 * isolation, re-test the PageBalloon mark and the PagePrivate flag
32 * under the proper page lock, to ensure isolating a valid balloon page
33 * (not yet isolated, nor under release procedure)
34 *
35 * iv. isolation or dequeueing procedure must clear PagePrivate flag under
36 * page lock together with removing page from balloon device page list.
37 *29 *
38 * The functions provided by this interface are placed to help on coping with30 * The functions provided by this interface are placed to help on coping with
39 * the aforementioned balloon page corner case, as well as to ensure the simple31 * the aforementioned balloon page corner case, as well as to ensure the simple
@@ -103,7 +95,7 @@ extern int balloon_page_migrate(struct address_space *mapping, · 63 unmodified lines
103static inline void balloon_page_insert(struct balloon_dev_info *balloon,95static inline void balloon_page_insert(struct balloon_dev_info *balloon,
104 struct page *page)96 struct page *page)
105{97{
106 __SetPageBalloon(page);98 __SetPageOffline(page);
107 __SetPageMovable(page, balloon->inode->i_mapping);99 __SetPageMovable(page, balloon->inode->i_mapping);
108 set_page_private(page, (unsigned long)balloon);100 set_page_private(page, (unsigned long)balloon);
109 list_add(&page->lru, &balloon->pages);101 list_add(&page->lru, &balloon->pages);
@@ -119,7 +111,7 @@ static inline void balloon_page_insert(struct balloon_dev_info *balloon, · 9 unmodified lines
119 */111 */
120static inline void balloon_page_delete(struct page *page)112static inline void balloon_page_delete(struct page *page)
121{113{
122 __ClearPageBalloon(page);114 __ClearPageOffline(page);
123 __ClearPageMovable(page);115 __ClearPageMovable(page);
124 set_page_private(page, 0);116 set_page_private(page, 0);
125 /*117 /*
@@ -149,13 +141,13 @@ static inline gfp_t balloon_mapping_gfp_mask(void) · 23 unmodified lines
149static inline void balloon_page_insert(struct balloon_dev_info *balloon,141static inline void balloon_page_insert(struct balloon_dev_info *balloon,
150 struct page *page)142 struct page *page)
151{143{
152 __SetPageBalloon(page);144 __SetPageOffline(page);
153 list_add(&page->lru, &balloon->pages);145 list_add(&page->lru, &balloon->pages);
154}146}
155 147
156static inline void balloon_page_delete(struct page *page)148static inline void balloon_page_delete(struct page *page)
157{149{
158 __ClearPageBalloon(page);150 __ClearPageOffline(page);
159 list_del(&page->lru);151 list_del(&page->lru);
160}152}
161 153
include/linux/cgroup-defs.h+4−0
@@ -32,6 +32,7 @@ struct kernfs_node; · 31 unmodified lines
32struct kernfs_ops;32struct kernfs_ops;
33struct kernfs_open_file;33struct kernfs_open_file;
34struct seq_file;34struct seq_file;
35struct poll_table_struct;
35 36
36#define MAX_CGROUP_TYPE_NAMELEN 3237#define MAX_CGROUP_TYPE_NAMELEN 32
37#define MAX_CGROUP_ROOT_NAMELEN 6438#define MAX_CGROUP_ROOT_NAMELEN 64
@@ -574,6 +575,9 @@ struct cftype { · 536 unmodified lines
574 ssize_t (*write)(struct kernfs_open_file *of,575 ssize_t (*write)(struct kernfs_open_file *of,
575 char *buf, size_t nbytes, loff_t off);576 char *buf, size_t nbytes, loff_t off);
576 577
578 __poll_t (*poll)(struct kernfs_open_file *of,
579 struct poll_table_struct *pt);
580
577#ifdef CONFIG_DEBUG_LOCK_ALLOC581#ifdef CONFIG_DEBUG_LOCK_ALLOC
578 struct lock_class_key lockdep_key;582 struct lock_class_key lockdep_key;
579#endif583#endif
include/linux/compaction.h+3−4
@@ -88,14 +88,13 @@ extern int sysctl_compact_memory; · 87 unmodified lines
88extern int sysctl_compaction_handler(struct ctl_table *table, int write,88extern int sysctl_compaction_handler(struct ctl_table *table, int write,
89 void __user *buffer, size_t *length, loff_t *ppos);89 void __user *buffer, size_t *length, loff_t *ppos);
90extern int sysctl_extfrag_threshold;90extern int sysctl_extfrag_threshold;
91extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
92 void __user *buffer, size_t *length, loff_t *ppos);
93extern int sysctl_compact_unevictable_allowed;91extern int sysctl_compact_unevictable_allowed;
94 92
95extern int fragmentation_index(struct zone *zone, unsigned int order);93extern int fragmentation_index(struct zone *zone, unsigned int order);
96extern enum compact_result try_to_compact_pages(gfp_t gfp_mask,94extern enum compact_result try_to_compact_pages(gfp_t gfp_mask,
97 unsigned int order, unsigned int alloc_flags,95 unsigned int order, unsigned int alloc_flags,
98 const struct alloc_context *ac, enum compact_priority prio);96 const struct alloc_context *ac, enum compact_priority prio,
97 struct page **page);
99extern void reset_isolation_suitable(pg_data_t *pgdat);98extern void reset_isolation_suitable(pg_data_t *pgdat);
100extern enum compact_result compaction_suitable(struct zone *zone, int order,99extern enum compact_result compaction_suitable(struct zone *zone, int order,
101 unsigned int alloc_flags, int classzone_idx);100 unsigned int alloc_flags, int classzone_idx);
@@ -227,8 +226,8 @@ static inline void wakeup_kcompactd(pg_data_t *pgdat, int order, int classzone_i · 125 unmodified lines
227 226
228#endif /* CONFIG_COMPACTION */227#endif /* CONFIG_COMPACTION */
229 228
230#if defined(CONFIG_COMPACTION) && defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)
231struct node;229struct node;
230#if defined(CONFIG_COMPACTION) && defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)
232extern int compaction_register_node(struct node *node);231extern int compaction_register_node(struct node *node);
233extern void compaction_unregister_node(struct node *node);232extern void compaction_unregister_node(struct node *node);
234 233
include/linux/device.h+1−1
@@ -1095,7 +1095,7 @@ static inline void set_dev_node(struct device *dev, int node) · 1094 unmodified lines
1095#else1095#else
1096static inline int dev_to_node(struct device *dev)1096static inline int dev_to_node(struct device *dev)
1097{1097{
1098 return -1;1098 return NUMA_NO_NODE;
1099}1099}
1100static inline void set_dev_node(struct device *dev, int node)1100static inline void set_dev_node(struct device *dev, int node)
1101{1101{
include/linux/frontswap.h+7−0
@@ -7,6 +7,13 @@ · 6 unmodified lines
7#include <linux/bitops.h>7#include <linux/bitops.h>
8#include <linux/jump_label.h>8#include <linux/jump_label.h>
9 9
10/*
11 * Return code to denote that requested number of
12 * frontswap pages are unused(moved to page cache).
13 * Used in in shmem_unuse and try_to_unuse.
14 */
15#define FRONTSWAP_PAGES_UNUSED 2
16
10struct frontswap_ops {17struct frontswap_ops {
11 void (*init)(unsigned); /* this swap type was just swapon'ed */18 void (*init)(unsigned); /* this swap type was just swapon'ed */
12 int (*store)(unsigned, pgoff_t, struct page *); /* store a page */19 int (*store)(unsigned, pgoff_t, struct page *); /* store a page */
include/linux/fs.h+1−1
@@ -2091,7 +2091,7 @@ static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) · 2090 unmodified lines
2091 * I_WB_SWITCH Cgroup bdi_writeback switching in progress. Used to2091 * I_WB_SWITCH Cgroup bdi_writeback switching in progress. Used to
2092 * synchronize competing switching instances and to tell2092 * synchronize competing switching instances and to tell
2093 * wb stat updates to grab the i_pages lock. See2093 * wb stat updates to grab the i_pages lock. See
2094 * inode_switch_wb_work_fn() for details.2094 * inode_switch_wbs_work_fn() for details.
2095 *2095 *
2096 * I_OVL_INUSE Used by overlayfs to get exclusive ownership on upper2096 * I_OVL_INUSE Used by overlayfs to get exclusive ownership on upper
2097 * and work dirs among overlayfs mounts.2097 * and work dirs among overlayfs mounts.
include/linux/gfp.h+15−15
@@ -24,21 +24,21 @@ struct vm_area_struct; · 23 unmodified lines
24#define ___GFP_HIGH 0x20u24#define ___GFP_HIGH 0x20u
25#define ___GFP_IO 0x40u25#define ___GFP_IO 0x40u
26#define ___GFP_FS 0x80u26#define ___GFP_FS 0x80u
27#define ___GFP_WRITE 0x100u27#define ___GFP_ZERO 0x100u
28#define ___GFP_NOWARN 0x200u28#define ___GFP_ATOMIC 0x200u
29#define ___GFP_RETRY_MAYFAIL 0x400u29#define ___GFP_DIRECT_RECLAIM 0x400u
30#define ___GFP_NOFAIL 0x800u30#define ___GFP_KSWAPD_RECLAIM 0x800u
31#define ___GFP_NORETRY 0x1000u31#define ___GFP_WRITE 0x1000u
32#define ___GFP_MEMALLOC 0x2000u32#define ___GFP_NOWARN 0x2000u
33#define ___GFP_COMP 0x4000u33#define ___GFP_RETRY_MAYFAIL 0x4000u
34#define ___GFP_ZERO 0x8000u34#define ___GFP_NOFAIL 0x8000u
35#define ___GFP_NOMEMALLOC 0x10000u35#define ___GFP_NORETRY 0x10000u
36#define ___GFP_HARDWALL 0x20000u36#define ___GFP_MEMALLOC 0x20000u
37#define ___GFP_THISNODE 0x40000u37#define ___GFP_COMP 0x40000u
38#define ___GFP_ATOMIC 0x80000u38#define ___GFP_NOMEMALLOC 0x80000u
39#define ___GFP_ACCOUNT 0x100000u39#define ___GFP_HARDWALL 0x100000u
40#define ___GFP_DIRECT_RECLAIM 0x200000u40#define ___GFP_THISNODE 0x200000u
41#define ___GFP_KSWAPD_RECLAIM 0x400000u41#define ___GFP_ACCOUNT 0x400000u
42#ifdef CONFIG_LOCKDEP42#ifdef CONFIG_LOCKDEP
43#define ___GFP_NOLOCKDEP 0x800000u43#define ___GFP_NOLOCKDEP 0x800000u
44#else44#else
include/linux/hugetlb.h+67−3
@@ -371,6 +371,8 @@ struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, · 370 unmodified lines
371 nodemask_t *nmask);371 nodemask_t *nmask);
372struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma,372struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma,
373 unsigned long address);373 unsigned long address);
374struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask,
375 int nid, nodemask_t *nmask);
374int huge_add_to_page_cache(struct page *page, struct address_space *mapping,376int huge_add_to_page_cache(struct page *page, struct address_space *mapping,
375 pgoff_t idx);377 pgoff_t idx);
376 378
@@ -493,17 +495,54 @@ static inline pgoff_t basepage_index(struct page *page) · 116 unmodified lines
493extern int dissolve_free_huge_page(struct page *page);495extern int dissolve_free_huge_page(struct page *page);
494extern int dissolve_free_huge_pages(unsigned long start_pfn,496extern int dissolve_free_huge_pages(unsigned long start_pfn,
495 unsigned long end_pfn);497 unsigned long end_pfn);
496static inline bool hugepage_migration_supported(struct hstate *h)498
497{
498#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION499#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
500#ifndef arch_hugetlb_migration_supported
501static inline bool arch_hugetlb_migration_supported(struct hstate *h)
502{
499 if ((huge_page_shift(h) == PMD_SHIFT) ||503 if ((huge_page_shift(h) == PMD_SHIFT) ||
500 (huge_page_shift(h) == PGDIR_SHIFT))504 (huge_page_shift(h) == PUD_SHIFT) ||
505 (huge_page_shift(h) == PGDIR_SHIFT))
501 return true;506 return true;
502 else507 else
503 return false;508 return false;
509}
510#endif
504#else511#else
512static inline bool arch_hugetlb_migration_supported(struct hstate *h)
513{
505 return false;514 return false;
515}
506#endif516#endif
517
518static inline bool hugepage_migration_supported(struct hstate *h)
519{
520 return arch_hugetlb_migration_supported(h);
521}
522
523/*
524 * Movability check is different as compared to migration check.
525 * It determines whether or not a huge page should be placed on
526 * movable zone or not. Movability of any huge page should be
527 * required only if huge page size is supported for migration.
528 * There wont be any reason for the huge page to be movable if
529 * it is not migratable to start with. Also the size of the huge
530 * page should be large enough to be placed under a movable zone
531 * and still feasible enough to be migratable. Just the presence
532 * in movable zone does not make the migration feasible.
533 *
534 * So even though large huge page sizes like the gigantic ones
535 * are migratable they should not be movable because its not
536 * feasible to migrate them from movable zone.
537 */
538static inline bool hugepage_movable_supported(struct hstate *h)
539{
540 if (!hugepage_migration_supported(h))
541 return false;
542
543 if (hstate_is_gigantic(h))
544 return false;
545 return true;
507}546}
508 547
509static inline spinlock_t *huge_pte_lockptr(struct hstate *h,548static inline spinlock_t *huge_pte_lockptr(struct hstate *h,
@@ -543,6 +582,26 @@ static inline void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr · 33 unmodified lines
543 set_huge_pte_at(mm, addr, ptep, pte);582 set_huge_pte_at(mm, addr, ptep, pte);
544}583}
545#endif584#endif
585
586#ifndef huge_ptep_modify_prot_start
587#define huge_ptep_modify_prot_start huge_ptep_modify_prot_start
588static inline pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma,
589 unsigned long addr, pte_t *ptep)
590{
591 return huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
592}
593#endif
594
595#ifndef huge_ptep_modify_prot_commit
596#define huge_ptep_modify_prot_commit huge_ptep_modify_prot_commit
597static inline void huge_ptep_modify_prot_commit(struct vm_area_struct *vma,
598 unsigned long addr, pte_t *ptep,
599 pte_t old_pte, pte_t pte)
600{
601 set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
602}
603#endif
604
546#else /* CONFIG_HUGETLB_PAGE */605#else /* CONFIG_HUGETLB_PAGE */
547struct hstate {};606struct hstate {};
548#define alloc_huge_page(v, a, r) NULL607#define alloc_huge_page(v, a, r) NULL
@@ -602,6 +661,11 @@ static inline bool hugepage_migration_supported(struct hstate *h) · 53 unmodified lines
602 return false;661 return false;
603}662}
604 663
664static inline bool hugepage_movable_supported(struct hstate *h)
665{
666 return false;
667}
668
605static inline spinlock_t *huge_pte_lockptr(struct hstate *h,669static inline spinlock_t *huge_pte_lockptr(struct hstate *h,
606 struct mm_struct *mm, pte_t *pte)670 struct mm_struct *mm, pte_t *pte)
607{671{
include/linux/kasan-checks.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2#ifndef _LINUX_KASAN_CHECKS_H2#ifndef _LINUX_KASAN_CHECKS_H
3#define _LINUX_KASAN_CHECKS_H3#define _LINUX_KASAN_CHECKS_H
4 4
5#ifdef CONFIG_KASAN5#if defined(__SANITIZE_ADDRESS__) || defined(__KASAN_INTERNAL)
6void kasan_check_read(const volatile void *p, unsigned int size);6void kasan_check_read(const volatile void *p, unsigned int size);
7void kasan_check_write(const volatile void *p, unsigned int size);7void kasan_check_write(const volatile void *p, unsigned int size);
8#else8#else
include/linux/kernfs.h+6−0
@@ -25,6 +25,7 @@ struct seq_file; · 24 unmodified lines
25struct vm_area_struct;25struct vm_area_struct;
26struct super_block;26struct super_block;
27struct file_system_type;27struct file_system_type;
28struct poll_table_struct;
28 29
29struct kernfs_open_node;30struct kernfs_open_node;
30struct kernfs_iattrs;31struct kernfs_iattrs;
@@ -261,6 +262,9 @@ struct kernfs_ops { · 230 unmodified lines
261 ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes,262 ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes,
262 loff_t off);263 loff_t off);
263 264
265 __poll_t (*poll)(struct kernfs_open_file *of,
266 struct poll_table_struct *pt);
267
264 int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma);268 int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma);
265 269
266#ifdef CONFIG_DEBUG_LOCK_ALLOC270#ifdef CONFIG_DEBUG_LOCK_ALLOC
@@ -350,6 +354,8 @@ int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name, · 83 unmodified lines
350int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,354int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,
351 const char *new_name, const void *new_ns);355 const char *new_name, const void *new_ns);
352int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr);356int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr);
357__poll_t kernfs_generic_poll(struct kernfs_open_file *of,
358 struct poll_table_struct *pt);
353void kernfs_notify(struct kernfs_node *kn);359void kernfs_notify(struct kernfs_node *kn);
354 360
355const void *kernfs_super_ns(struct super_block *sb);361const void *kernfs_super_ns(struct super_block *sb);
include/linux/ksm.h+7−0
@@ -53,6 +53,8 @@ struct page *ksm_might_need_to_copy(struct page *page, · 52 unmodified lines
53 53
54void rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc);54void rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc);
55void ksm_migrate_page(struct page *newpage, struct page *oldpage);55void ksm_migrate_page(struct page *newpage, struct page *oldpage);
56bool reuse_ksm_page(struct page *page,
57 struct vm_area_struct *vma, unsigned long address);
56 58
57#else /* !CONFIG_KSM */59#else /* !CONFIG_KSM */
58 60
@@ -86,6 +88,11 @@ static inline void rmap_walk_ksm(struct page *page, · 27 unmodified lines
86static inline void ksm_migrate_page(struct page *newpage, struct page *oldpage)88static inline void ksm_migrate_page(struct page *newpage, struct page *oldpage)
87{89{
88}90}
91static inline bool reuse_ksm_page(struct page *page,
92 struct vm_area_struct *vma, unsigned long address)
93{
94 return false;
95}
89#endif /* CONFIG_MMU */96#endif /* CONFIG_MMU */
90#endif /* !CONFIG_KSM */97#endif /* !CONFIG_KSM */
91 98
include/linux/list.h+11−0
@@ -206,6 +206,17 @@ static inline void list_bulk_move_tail(struct list_head *head, · 205 unmodified lines
206 head->prev = last;206 head->prev = last;
207}207}
208 208
209/**
210 * list_is_first -- tests whether @ list is the first entry in list @head
211 * @list: the entry to test
212 * @head: the head of the list
213 */
214static inline int list_is_first(const struct list_head *list,
215 const struct list_head *head)
216{
217 return list->prev == head;
218}
219
209/**220/**
210 * list_is_last - tests whether @list is the last entry in list @head221 * list_is_last - tests whether @list is the last entry in list @head
211 * @list: the entry to test222 * @list: the entry to test
include/linux/memcontrol.h+43−4
@@ -429,6 +429,11 @@ static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg) · 428 unmodified lines
429}429}
430struct mem_cgroup *mem_cgroup_from_id(unsigned short id);430struct mem_cgroup *mem_cgroup_from_id(unsigned short id);
431 431
432static inline struct mem_cgroup *mem_cgroup_from_seq(struct seq_file *m)
433{
434 return mem_cgroup_from_css(seq_css(m));
435}
436
432static inline struct mem_cgroup *lruvec_memcg(struct lruvec *lruvec)437static inline struct mem_cgroup *lruvec_memcg(struct lruvec *lruvec)
433{438{
434 struct mem_cgroup_per_node *mz;439 struct mem_cgroup_per_node *mz;
@@ -937,6 +942,11 @@ static inline struct mem_cgroup *mem_cgroup_from_id(unsigned short id) · 502 unmodified lines
937 return NULL;942 return NULL;
938}943}
939 944
945static inline struct mem_cgroup *mem_cgroup_from_seq(struct seq_file *m)
946{
947 return NULL;
948}
949
940static inline struct mem_cgroup *lruvec_memcg(struct lruvec *lruvec)950static inline struct mem_cgroup *lruvec_memcg(struct lruvec *lruvec)
941{951{
942 return NULL;952 return NULL;
@@ -1273,12 +1283,12 @@ static inline bool mem_cgroup_under_socket_pressure(struct mem_cgroup *memcg) · 330 unmodified lines
1273 1283
1274struct kmem_cache *memcg_kmem_get_cache(struct kmem_cache *cachep);1284struct kmem_cache *memcg_kmem_get_cache(struct kmem_cache *cachep);
1275void memcg_kmem_put_cache(struct kmem_cache *cachep);1285void memcg_kmem_put_cache(struct kmem_cache *cachep);
1276int memcg_kmem_charge_memcg(struct page *page, gfp_t gfp, int order,
1277 struct mem_cgroup *memcg);
1278 1286
1279#ifdef CONFIG_MEMCG_KMEM1287#ifdef CONFIG_MEMCG_KMEM
1280int memcg_kmem_charge(struct page *page, gfp_t gfp, int order);1288int __memcg_kmem_charge(struct page *page, gfp_t gfp, int order);
1281void memcg_kmem_uncharge(struct page *page, int order);1289void __memcg_kmem_uncharge(struct page *page, int order);
1290int __memcg_kmem_charge_memcg(struct page *page, gfp_t gfp, int order,
1291 struct mem_cgroup *memcg);
1282 1292
1283extern struct static_key_false memcg_kmem_enabled_key;1293extern struct static_key_false memcg_kmem_enabled_key;
1284extern struct workqueue_struct *memcg_kmem_cache_wq;1294extern struct workqueue_struct *memcg_kmem_cache_wq;
@@ -1300,6 +1310,26 @@ static inline bool memcg_kmem_enabled(void) · 15 unmodified lines
1300 return static_branch_unlikely(&memcg_kmem_enabled_key);1310 return static_branch_unlikely(&memcg_kmem_enabled_key);
1301}1311}
1302 1312
1313static inline int memcg_kmem_charge(struct page *page, gfp_t gfp, int order)
1314{
1315 if (memcg_kmem_enabled())
1316 return __memcg_kmem_charge(page, gfp, order);
1317 return 0;
1318}
1319
1320static inline void memcg_kmem_uncharge(struct page *page, int order)
1321{
1322 if (memcg_kmem_enabled())
1323 __memcg_kmem_uncharge(page, order);
1324}
1325
1326static inline int memcg_kmem_charge_memcg(struct page *page, gfp_t gfp,
1327 int order, struct mem_cgroup *memcg)
1328{
1329 if (memcg_kmem_enabled())
1330 return __memcg_kmem_charge_memcg(page, gfp, order, memcg);
1331 return 0;
1332}
1303/*1333/*
1304 * helper for accessing a memcg's index. It will be used as an index in the1334 * helper for accessing a memcg's index. It will be used as an index in the
1305 * child cache array in kmem_cache, and also to derive its name. This function1335 * child cache array in kmem_cache, and also to derive its name. This function
@@ -1325,6 +1355,15 @@ static inline void memcg_kmem_uncharge(struct page *page, int order) · 19 unmodified lines
1325{1355{
1326}1356}
1327 1357
1358static inline int __memcg_kmem_charge(struct page *page, gfp_t gfp, int order)
1359{
1360 return 0;
1361}
1362
1363static inline void __memcg_kmem_uncharge(struct page *page, int order)
1364{
1365}
1366
1328#define for_each_memcg_cache_index(_idx) \1367#define for_each_memcg_cache_index(_idx) \
1329 for (; NULL; )1368 for (; NULL; )
1330 1369
include/linux/memory_hotplug.h+1−1
@@ -89,7 +89,7 @@ extern int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn, · 88 unmodified lines
89 unsigned long *valid_start, unsigned long *valid_end);89 unsigned long *valid_start, unsigned long *valid_end);
90extern void __offline_isolated_pages(unsigned long, unsigned long);90extern void __offline_isolated_pages(unsigned long, unsigned long);
91 91
92typedef void (*online_page_callback_t)(struct page *page);92typedef void (*online_page_callback_t)(struct page *page, unsigned int order);
93 93
94extern int set_online_page_callback(online_page_callback_t callback);94extern int set_online_page_callback(online_page_callback_t callback);
95extern int restore_online_page_callback(online_page_callback_t callback);95extern int restore_online_page_callback(online_page_callback_t callback);
include/linux/mm.h+2−1
@@ -1536,7 +1536,8 @@ long get_user_pages_locked(unsigned long start, unsigned long nr_pages, · 1535 unmodified lines
1536 unsigned int gup_flags, struct page **pages, int *locked);1536 unsigned int gup_flags, struct page **pages, int *locked);
1537long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,1537long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
1538 struct page **pages, unsigned int gup_flags);1538 struct page **pages, unsigned int gup_flags);
1539#ifdef CONFIG_FS_DAX1539
1540#if defined(CONFIG_FS_DAX) || defined(CONFIG_CMA)
1540long get_user_pages_longterm(unsigned long start, unsigned long nr_pages,1541long get_user_pages_longterm(unsigned long start, unsigned long nr_pages,
1541 unsigned int gup_flags, struct page **pages,1542 unsigned int gup_flags, struct page **pages,
1542 struct vm_area_struct **vmas);1543 struct vm_area_struct **vmas);
include/linux/mm_types.h+1−1
@@ -80,7 +80,7 @@ struct page { · 79 unmodified lines
80 struct { /* Page cache and anonymous pages */80 struct { /* Page cache and anonymous pages */
81 /**81 /**
82 * @lru: Pageout list, eg. active_list protected by82 * @lru: Pageout list, eg. active_list protected by
83 * zone_lru_lock. Sometimes used as a generic list83 * pgdat->lru_lock. Sometimes used as a generic list
84 * by the page owner.84 * by the page owner.
85 */85 */
86 struct list_head lru;86 struct list_head lru;
include/linux/mmzone.h+3−5
@@ -480,6 +480,8 @@ struct zone { · 479 unmodified lines
480 unsigned long compact_cached_free_pfn;480 unsigned long compact_cached_free_pfn;
481 /* pfn where async and sync compaction migration scanner should start */481 /* pfn where async and sync compaction migration scanner should start */
482 unsigned long compact_cached_migrate_pfn[2];482 unsigned long compact_cached_migrate_pfn[2];
483 unsigned long compact_init_migrate_pfn;
484 unsigned long compact_init_free_pfn;
483#endif485#endif
484 486
485#ifdef CONFIG_COMPACTION487#ifdef CONFIG_COMPACTION
@@ -728,10 +730,6 @@ typedef struct pglist_data { · 242 unmodified lines
728 730
729#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)731#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
730#define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid))732#define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid))
731static inline spinlock_t *zone_lru_lock(struct zone *zone)
732{
733 return &zone->zone_pgdat->lru_lock;
734}
735 733
736static inline struct lruvec *node_lruvec(struct pglist_data *pgdat)734static inline struct lruvec *node_lruvec(struct pglist_data *pgdat)
737{735{
@@ -1299,7 +1297,7 @@ void memory_present(int nid, unsigned long start, unsigned long end); · 561 unmodified lines
1299 1297
1300/*1298/*
1301 * If it is possible to have holes within a MAX_ORDER_NR_PAGES, then we1299 * If it is possible to have holes within a MAX_ORDER_NR_PAGES, then we
1302 * need to check pfn validility within that MAX_ORDER_NR_PAGES block.1300 * need to check pfn validity within that MAX_ORDER_NR_PAGES block.
1303 * pfn_valid_within() should be used in this case; we optimise this away1301 * pfn_valid_within() should be used in this case; we optimise this away
1304 * when we have no holes within a MAX_ORDER_NR_PAGES block.1302 * when we have no holes within a MAX_ORDER_NR_PAGES block.
1305 */1303 */
include/linux/nodemask.h+4−4
@@ -444,8 +444,8 @@ static inline int next_memory_node(int nid) · 443 unmodified lines
444 return next_node(nid, node_states[N_MEMORY]);444 return next_node(nid, node_states[N_MEMORY]);
445}445}
446 446
447extern int nr_node_ids;447extern unsigned int nr_node_ids;
448extern int nr_online_nodes;448extern unsigned int nr_online_nodes;
449 449
450static inline void node_set_online(int nid)450static inline void node_set_online(int nid)
451{451{
@@ -485,8 +485,8 @@ static inline int num_node_state(enum node_states state) · 33 unmodified lines
485#define first_online_node 0485#define first_online_node 0
486#define first_memory_node 0486#define first_memory_node 0
487#define next_online_node(nid) (MAX_NUMNODES)487#define next_online_node(nid) (MAX_NUMNODES)
488#define nr_node_ids 1488#define nr_node_ids 1U
489#define nr_online_nodes 1489#define nr_online_nodes 1U
490 490
491#define node_set_online(node) node_set_state((node), N_ONLINE)491#define node_set_online(node) node_set_state((node), N_ONLINE)
492#define node_set_offline(node) node_clear_state((node), N_ONLINE)492#define node_set_offline(node) node_clear_state((node), N_ONLINE)
include/linux/page-flags.h+38−6
@@ -17,8 +17,37 @@ · 16 unmodified lines
17/*17/*
18 * Various page->flags bits:18 * Various page->flags bits:
19 *19 *
20 * PG_reserved is set for special pages, which can never be swapped out. Some20 * PG_reserved is set for special pages. The "struct page" of such a page
21 * of them might not even exist...21 * should in general not be touched (e.g. set dirty) except by its owner.
22 * Pages marked as PG_reserved include:
23 * - Pages part of the kernel image (including vDSO) and similar (e.g. BIOS,
24 * initrd, HW tables)
25 * - Pages reserved or allocated early during boot (before the page allocator
26 * was initialized). This includes (depending on the architecture) the
27 * initial vmemmap, initial page tables, crashkernel, elfcorehdr, and much
28 * much more. Once (if ever) freed, PG_reserved is cleared and they will
29 * be given to the page allocator.
30 * - Pages falling into physical memory gaps - not IORESOURCE_SYSRAM. Trying
31 * to read/write these pages might end badly. Don't touch!
32 * - The zero page(s)
33 * - Pages not added to the page allocator when onlining a section because
34 * they were excluded via the online_page_callback() or because they are
35 * PG_hwpoison.
36 * - Pages allocated in the context of kexec/kdump (loaded kernel image,
37 * control pages, vmcoreinfo)
38 * - MMIO/DMA pages. Some architectures don't allow to ioremap pages that are
39 * not marked PG_reserved (as they might be in use by somebody else who does
40 * not respect the caching strategy).
41 * - Pages part of an offline section (struct pages of offline sections should
42 * not be trusted as they will be initialized when first onlined).
43 * - MCA pages on ia64
44 * - Pages holding CPU notes for POWER Firmware Assisted Dump
45 * - Device memory (e.g. PMEM, DAX, HMM)
46 * Some PG_reserved pages will be excluded from the hibernation image.
47 * PG_reserved does in general not hinder anybody from dumping or swapping
48 * and is no longer required for remap_pfn_range(). ioremap might require it.
49 * Consequently, PG_reserved for a page mapped into user space can indicate
50 * the zero page, the vDSO, MMIO pages or device memory.
22 *51 *
23 * The PG_private bitflag is set on pagecache pages if they contain filesystem52 * The PG_private bitflag is set on pagecache pages if they contain filesystem
24 * specific data (which is normally at page->private). It can be used by53 * specific data (which is normally at page->private). It can be used by
@@ -671,7 +700,7 @@ PAGEFLAG_FALSE(DoubleMap) · 646 unmodified lines
671/* Reserve 0x0000007f to catch underflows of page_mapcount */700/* Reserve 0x0000007f to catch underflows of page_mapcount */
672#define PAGE_MAPCOUNT_RESERVE -128701#define PAGE_MAPCOUNT_RESERVE -128
673#define PG_buddy 0x00000080702#define PG_buddy 0x00000080
674#define PG_balloon 0x00000100703#define PG_offline 0x00000100
675#define PG_kmemcg 0x00000200704#define PG_kmemcg 0x00000200
676#define PG_table 0x00000400705#define PG_table 0x00000400
677 706
@@ -706,10 +735,13 @@ static __always_inline void __ClearPage##uname(struct page *page) \ · 28 unmodified lines
706PAGE_TYPE_OPS(Buddy, buddy)735PAGE_TYPE_OPS(Buddy, buddy)
707 736
708/*737/*
709 * PageBalloon() is true for pages that are on the balloon page list738 * PageOffline() indicates that the page is logically offline although the
710 * (see mm/balloon_compaction.c).739 * containing section is online. (e.g. inflated in a balloon driver or
740 * not onlined when onlining the section).
741 * The content of these pages is effectively stale. Such pages should not
742 * be touched (read/write/dump/save) except by their owner.
711 */743 */
712PAGE_TYPE_OPS(Balloon, balloon)744PAGE_TYPE_OPS(Offline, offline)
713 745
714/*746/*
715 * If kmemcg is enabled, the buddy allocator will set PageKmemcg() on747 * If kmemcg is enabled, the buddy allocator will set PageKmemcg() on
include/linux/pagemap.h+9−22
@@ -164,7 +164,7 @@ void release_pages(struct page **pages, int nr); · 163 unmodified lines
164 * will find the page or it will not. Likewise, the old find_get_page could run164 * will find the page or it will not. Likewise, the old find_get_page could run
165 * either before the insertion or afterwards, depending on timing.165 * either before the insertion or afterwards, depending on timing.
166 */166 */
167static inline int page_cache_get_speculative(struct page *page)167static inline int __page_cache_add_speculative(struct page *page, int count)
168{168{
169#ifdef CONFIG_TINY_RCU169#ifdef CONFIG_TINY_RCU
170# ifdef CONFIG_PREEMPT_COUNT170# ifdef CONFIG_PREEMPT_COUNT
@@ -180,10 +180,10 @@ static inline int page_cache_get_speculative(struct page *page) · 9 unmodified lines
180 * SMP requires.180 * SMP requires.
181 */181 */
182 VM_BUG_ON_PAGE(page_count(page) == 0, page);182 VM_BUG_ON_PAGE(page_count(page) == 0, page);
183 page_ref_inc(page);183 page_ref_add(page, count);
184 184
185#else185#else
186 if (unlikely(!get_page_unless_zero(page))) {186 if (unlikely(!page_ref_add_unless(page, count, 0))) {
187 /*187 /*
188 * Either the page has been freed, or will be freed.188 * Either the page has been freed, or will be freed.
189 * In either case, retry here and the caller should189 * In either case, retry here and the caller should
@@ -197,27 +197,14 @@ static inline int page_cache_get_speculative(struct page *page) · 7 unmodified lines
197 return 1;197 return 1;
198}198}
199 199
200/*200static inline int page_cache_get_speculative(struct page *page)
201 * Same as above, but add instead of inc (could just be merged)
202 */
203static inline int page_cache_add_speculative(struct page *page, int count)
204{201{
205 VM_BUG_ON(in_interrupt());202 return __page_cache_add_speculative(page, 1);
206 203}
207#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU)
208# ifdef CONFIG_PREEMPT_COUNT
209 VM_BUG_ON(!in_atomic() && !irqs_disabled());
210# endif
211 VM_BUG_ON_PAGE(page_count(page) == 0, page);
212 page_ref_add(page, count);
213
214#else
215 if (unlikely(!page_ref_add_unless(page, count, 0)))
216 return 0;
217#endif
218 VM_BUG_ON_PAGE(PageCompound(page) && page != compound_head(page), page);
219 204
220 return 1;205static inline int page_cache_add_speculative(struct page *page, int count)
206{
207 return __page_cache_add_speculative(page, count);
221}208}
222 209
223#ifdef CONFIG_NUMA210#ifdef CONFIG_NUMA
include/linux/poison.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30 */30 */
31#define TIMER_ENTRY_STATIC ((void *) 0x300 + POISON_POINTER_DELTA)31#define TIMER_ENTRY_STATIC ((void *) 0x300 + POISON_POINTER_DELTA)
32 32
33/********** mm/debug-pagealloc.c **********/33/********** mm/page_poison.c **********/
34#ifdef CONFIG_PAGE_POISONING_ZERO34#ifdef CONFIG_PAGE_POISONING_ZERO
35#define PAGE_POISON 0x0035#define PAGE_POISON 0x00
36#else36#else
include/linux/sched.h+5−0
@@ -48,6 +48,7 @@ struct pid_namespace; · 47 unmodified lines
48struct pipe_inode_info;48struct pipe_inode_info;
49struct rcu_node;49struct rcu_node;
50struct reclaim_state;50struct reclaim_state;
51struct capture_control;
51struct robust_list_head;52struct robust_list_head;
52struct sched_attr;53struct sched_attr;
53struct sched_param;54struct sched_param;
@@ -950,6 +951,9 @@ struct task_struct { · 896 unmodified lines
950 951
951 struct io_context *io_context;952 struct io_context *io_context;
952 953
954#ifdef CONFIG_COMPACTION
955 struct capture_control *capture_control;
956#endif
953 /* Ptrace state: */957 /* Ptrace state: */
954 unsigned long ptrace_message;958 unsigned long ptrace_message;
955 kernel_siginfo_t *last_siginfo;959 kernel_siginfo_t *last_siginfo;
@@ -1395,6 +1399,7 @@ extern struct pid *cad_pid; · 439 unmodified lines
1395#define PF_UMH 0x02000000 /* I'm an Usermodehelper process */1399#define PF_UMH 0x02000000 /* I'm an Usermodehelper process */
1396#define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */1400#define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */
1397#define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */1401#define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */
1402#define PF_MEMALLOC_NOCMA 0x10000000 /* All allocation request will have _GFP_MOVABLE cleared */
1398#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */1403#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */
1399#define PF_SUSPEND_TASK 0x80000000 /* This thread called freeze_processes() and should not be frozen */1404#define PF_SUSPEND_TASK 0x80000000 /* This thread called freeze_processes() and should not be frozen */
1400 1405
include/linux/sched/mm.h+40−8
@@ -148,17 +148,25 @@ static inline bool in_vfork(struct task_struct *tsk) · 147 unmodified lines
148 * Applies per-task gfp context to the given allocation flags.148 * Applies per-task gfp context to the given allocation flags.
149 * PF_MEMALLOC_NOIO implies GFP_NOIO149 * PF_MEMALLOC_NOIO implies GFP_NOIO
150 * PF_MEMALLOC_NOFS implies GFP_NOFS150 * PF_MEMALLOC_NOFS implies GFP_NOFS
151 * PF_MEMALLOC_NOCMA implies no allocation from CMA region.
151 */152 */
152static inline gfp_t current_gfp_context(gfp_t flags)153static inline gfp_t current_gfp_context(gfp_t flags)
153{154{
154 /*155 if (unlikely(current->flags &
155 * NOIO implies both NOIO and NOFS and it is a weaker context156 (PF_MEMALLOC_NOIO | PF_MEMALLOC_NOFS | PF_MEMALLOC_NOCMA))) {
156 * so always make sure it makes precedence157 /*
157 */158 * NOIO implies both NOIO and NOFS and it is a weaker context
158 if (unlikely(current->flags & PF_MEMALLOC_NOIO))159 * so always make sure it makes precedence
159 flags &= ~(__GFP_IO | __GFP_FS);160 */
160 else if (unlikely(current->flags & PF_MEMALLOC_NOFS))161 if (current->flags & PF_MEMALLOC_NOIO)
161 flags &= ~__GFP_FS;162 flags &= ~(__GFP_IO | __GFP_FS);
163 else if (current->flags & PF_MEMALLOC_NOFS)
164 flags &= ~__GFP_FS;
165#ifdef CONFIG_CMA
166 if (current->flags & PF_MEMALLOC_NOCMA)
167 flags &= ~__GFP_MOVABLE;
168#endif
169 }
162 return flags;170 return flags;
163}171}
164 172
@@ -248,6 +256,30 @@ static inline void memalloc_noreclaim_restore(unsigned int flags) · 83 unmodified lines
248 current->flags = (current->flags & ~PF_MEMALLOC) | flags;256 current->flags = (current->flags & ~PF_MEMALLOC) | flags;
249}257}
250 258
259#ifdef CONFIG_CMA
260static inline unsigned int memalloc_nocma_save(void)
261{
262 unsigned int flags = current->flags & PF_MEMALLOC_NOCMA;
263
264 current->flags |= PF_MEMALLOC_NOCMA;
265 return flags;
266}
267
268static inline void memalloc_nocma_restore(unsigned int flags)
269{
270 current->flags = (current->flags & ~PF_MEMALLOC_NOCMA) | flags;
271}
272#else
273static inline unsigned int memalloc_nocma_save(void)
274{
275 return 0;
276}
277
278static inline void memalloc_nocma_restore(unsigned int flags)
279{
280}
281#endif
282
251#ifdef CONFIG_MEMCG283#ifdef CONFIG_MEMCG
252/**284/**
253 * memalloc_use_memcg - Starts the remote memcg charging scope.285 * memalloc_use_memcg - Starts the remote memcg charging scope.
include/linux/shmem_fs.h+2−1
@@ -72,7 +72,8 @@ extern void shmem_unlock_mapping(struct address_space *mapping); · 71 unmodified lines
72extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,72extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
73 pgoff_t index, gfp_t gfp_mask);73 pgoff_t index, gfp_t gfp_mask);
74extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end);74extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end);
75extern int shmem_unuse(swp_entry_t entry, struct page *page);75extern int shmem_unuse(unsigned int type, bool frontswap,
76 unsigned long *fs_pages_to_unuse);
76 77
77extern unsigned long shmem_swap_usage(struct vm_area_struct *vma);78extern unsigned long shmem_swap_usage(struct vm_area_struct *vma);
78extern unsigned long shmem_partial_swap_usage(struct address_space *mapping,79extern unsigned long shmem_partial_swap_usage(struct address_space *mapping,
include/linux/slub_def.h+6−6
@@ -81,12 +81,12 @@ struct kmem_cache_order_objects { · 80 unmodified lines
81 */81 */
82struct kmem_cache {82struct kmem_cache {
83 struct kmem_cache_cpu __percpu *cpu_slab;83 struct kmem_cache_cpu __percpu *cpu_slab;
84 /* Used for retriving partial slabs etc */84 /* Used for retrieving partial slabs, etc. */
85 slab_flags_t flags;85 slab_flags_t flags;
86 unsigned long min_partial;86 unsigned long min_partial;
87 unsigned int size; /* The size of an object including meta data */87 unsigned int size; /* The size of an object including metadata */
88 unsigned int object_size;/* The size of an object without meta data */88 unsigned int object_size;/* The size of an object without metadata */
89 unsigned int offset; /* Free pointer offset. */89 unsigned int offset; /* Free pointer offset */
90#ifdef CONFIG_SLUB_CPU_PARTIAL90#ifdef CONFIG_SLUB_CPU_PARTIAL
91 /* Number of per cpu partial objects to keep around */91 /* Number of per cpu partial objects to keep around */
92 unsigned int cpu_partial;92 unsigned int cpu_partial;
@@ -110,7 +110,7 @@ struct kmem_cache { · 17 unmodified lines
110#endif110#endif
111#ifdef CONFIG_MEMCG111#ifdef CONFIG_MEMCG
112 struct memcg_cache_params memcg_params;112 struct memcg_cache_params memcg_params;
113 /* for propagation, maximum size of a stored attr */113 /* For propagation, maximum size of a stored attr */
114 unsigned int max_attr_size;114 unsigned int max_attr_size;
115#ifdef CONFIG_SYSFS115#ifdef CONFIG_SYSFS
116 struct kset *memcg_kset;116 struct kset *memcg_kset;
@@ -151,7 +151,7 @@ struct kmem_cache { · 34 unmodified lines
151#else151#else
152#define slub_cpu_partial(s) (0)152#define slub_cpu_partial(s) (0)
153#define slub_set_cpu_partial(s, n)153#define slub_set_cpu_partial(s, n)
154#endif // CONFIG_SLUB_CPU_PARTIAL154#endif /* CONFIG_SLUB_CPU_PARTIAL */
155 155
156#ifdef CONFIG_SYSFS156#ifdef CONFIG_SYSFS
157#define SLAB_SUPPORTS_SYSFS157#define SLAB_SUPPORTS_SYSFS
include/linux/swap.h+2−2
@@ -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 address_space *mapping, struct page *page);310void *workingset_eviction(struct page *page);
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
@@ -625,7 +625,7 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) · 311 unmodified lines
625 return vm_swappiness;625 return vm_swappiness;
626 626
627 /* root ? */627 /* root ? */
628 if (mem_cgroup_disabled() || !memcg->css.parent)628 if (mem_cgroup_disabled() || mem_cgroup_is_root(memcg))
629 return vm_swappiness;629 return vm_swappiness;
630 630
631 return memcg->swappiness;631 return memcg->swappiness;

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