History

Merge branch 'akpm' (patches from Andrew)

Pull updates from Andrew Morton: "Most of -mm and quite a number of other subsystems: hotfixes, scripts, ocfs2, misc, lib, binfmt, init, reiserfs, exec, dma-mapping, kcov. MM is fairly quiet this time. Holidays, I assume" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (118 commits) kcov: ignore fault-inject and stacktrace include/linux/io-mapping.h-mapping: use PHYS_PFN() macro in io_mapping_map_atomic_wc() execve: warn if process starts with executable stack reiserfs: prevent NULL pointer dereference in reiserfs_insert_item() init/main.c: fix misleading "This architecture does not have kernel memory protection" message init/main.c: fix quoted value handling in unknown_bootoption init/main.c: remove unnecessary repair_env_string in do_initcall_level init/main.c: log arguments and environment passed to init fs/binfmt_elf.c: coredump: allow process with empty address space to coredump fs/binfmt_elf.c: coredump: delete duplicated overflow check fs/binfmt_elf.c: coredump: allocate core ELF header on stack fs/binfmt_elf.c: make BAD_ADDR() unlikely fs/binfmt_elf.c: better codegen around current->mm fs/binfmt_elf.c: don't copy ELF header around fs/binfmt_elf.c: fix ->start_code calculation fs/binfmt_elf.c: smaller code generation around auxv vector fill lib/find_bit.c: uninline helper _find_next_bit() lib/find_bit.c: join _find_next_bit{_le} uapi: rename ext2_swab() to swab() and share globally in swab.h lib/scatterlist.c: adjust indentation in __sg_alloc_table ...

Linus Torvalds committed 6 years ago

Commit 7eec11d2 parents ddaefe8 43e76af136 files · +2724 −1293Browse files

Showing the changes to include (18 of 136 files). Show all

Unified · Split

18 files
  1. include/linux/backing-dev.h +10 −0
  2. include/linux/bitops.h +1 −0
  3. include/linux/fs.h +5 −1
  4. include/linux/io-mapping.h +2 −3
  5. include/linux/memblock.h +3 −4
  6. include/linux/memory.h +0 −29
  7. include/linux/memory_hotplug.h +2 −1
  8. include/linux/mm.h +70 −34
  9. include/linux/mmzone.h +1 −1
  10. include/linux/page-isolation.h +2 −2
  11. include/linux/swab.h +1 −0
  12. include/linux/thermal.h +0 −11
  13. include/linux/units.h +84 −0
  14. include/linux/zlib.h +6 −0
  15. include/trace/events/kmem.h +2 −2
  16. include/trace/events/writeback.h +17 −20
  17. include/uapi/linux/swab.h +10 −0
  18. include/uapi/linux/sysctl.h +1 −1
include/linux/backing-dev.h+10−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
13#include <linux/fs.h>13#include <linux/fs.h>
14#include <linux/sched.h>14#include <linux/sched.h>
15#include <linux/blkdev.h>15#include <linux/blkdev.h>
16#include <linux/device.h>
16#include <linux/writeback.h>17#include <linux/writeback.h>
17#include <linux/blk-cgroup.h>18#include <linux/blk-cgroup.h>
18#include <linux/backing-dev-defs.h>19#include <linux/backing-dev-defs.h>
@@ -504,4 +505,13 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) · 485 unmodified lines
504 (1 << WB_async_congested));505 (1 << WB_async_congested));
505}506}
506 507
508extern const char *bdi_unknown_name;
509
510static inline const char *bdi_dev_name(struct backing_dev_info *bdi)
511{
512 if (!bdi || !bdi->dev)
513 return bdi_unknown_name;
514 return dev_name(bdi->dev);
515}
516
507#endif /* _LINUX_BACKING_DEV_H */517#endif /* _LINUX_BACKING_DEV_H */
include/linux/bitops.h+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
13 13
14#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE)14#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE)
15#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(long))15#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(long))
16#define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_TYPE(char))
16 17
17extern unsigned int __sw_hweight8(unsigned int w);18extern unsigned int __sw_hweight8(unsigned int w);
18extern unsigned int __sw_hweight16(unsigned int w);19extern unsigned int __sw_hweight16(unsigned int w);
include/linux/fs.h+5−1
@@ -2737,7 +2737,6 @@ static inline int filemap_fdatawait(struct address_space *mapping) · 2736 unmodified lines
2737 2737
2738extern bool filemap_range_has_page(struct address_space *, loff_t lstart,2738extern bool filemap_range_has_page(struct address_space *, loff_t lstart,
2739 loff_t lend);2739 loff_t lend);
2740extern int filemap_write_and_wait(struct address_space *mapping);
2741extern int filemap_write_and_wait_range(struct address_space *mapping,2740extern int filemap_write_and_wait_range(struct address_space *mapping,
2742 loff_t lstart, loff_t lend);2741 loff_t lstart, loff_t lend);
2743extern int __filemap_fdatawrite_range(struct address_space *mapping,2742extern int __filemap_fdatawrite_range(struct address_space *mapping,
@@ -2747,6 +2746,11 @@ extern int filemap_fdatawrite_range(struct address_space *mapping, · 3 unmodified lines
2747extern int filemap_check_errors(struct address_space *mapping);2746extern int filemap_check_errors(struct address_space *mapping);
2748extern void __filemap_set_wb_err(struct address_space *mapping, int err);2747extern void __filemap_set_wb_err(struct address_space *mapping, int err);
2749 2748
2749static inline int filemap_write_and_wait(struct address_space *mapping)
2750{
2751 return filemap_write_and_wait_range(mapping, 0, LLONG_MAX);
2752}
2753
2750extern int __must_check file_fdatawait_range(struct file *file, loff_t lstart,2754extern int __must_check file_fdatawait_range(struct file *file, loff_t lstart,
2751 loff_t lend);2755 loff_t lend);
2752extern int __must_check file_check_and_advance_wb_err(struct file *file);2756extern int __must_check file_check_and_advance_wb_err(struct file *file);
include/linux/io-mapping.h+2−3
@@ -28,6 +28,7 @@ struct io_mapping { · 27 unmodified lines
28 28
29#ifdef CONFIG_HAVE_ATOMIC_IOMAP29#ifdef CONFIG_HAVE_ATOMIC_IOMAP
30 30
31#include <linux/pfn.h>
31#include <asm/iomap.h>32#include <asm/iomap.h>
32/*33/*
33 * For small address space machines, mapping large objects34 * For small address space machines, mapping large objects
@@ -64,12 +65,10 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, · 30 unmodified lines
64 unsigned long offset)65 unsigned long offset)
65{66{
66 resource_size_t phys_addr;67 resource_size_t phys_addr;
67 unsigned long pfn;
68 68
69 BUG_ON(offset >= mapping->size);69 BUG_ON(offset >= mapping->size);
70 phys_addr = mapping->base + offset;70 phys_addr = mapping->base + offset;
71 pfn = (unsigned long) (phys_addr >> PAGE_SHIFT);71 return iomap_atomic_prot_pfn(PHYS_PFN(phys_addr), mapping->prot);
72 return iomap_atomic_prot_pfn(pfn, mapping->prot);
73}72}
74 73
75static inline void74static inline void
include/linux/memblock.h+3−4
@@ -113,6 +113,9 @@ int memblock_add(phys_addr_t base, phys_addr_t size); · 112 unmodified lines
113int memblock_remove(phys_addr_t base, phys_addr_t size);113int memblock_remove(phys_addr_t base, phys_addr_t size);
114int memblock_free(phys_addr_t base, phys_addr_t size);114int memblock_free(phys_addr_t base, phys_addr_t size);
115int memblock_reserve(phys_addr_t base, phys_addr_t size);115int memblock_reserve(phys_addr_t base, phys_addr_t size);
116#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
117int memblock_physmem_add(phys_addr_t base, phys_addr_t size);
118#endif
116void memblock_trim_memory(phys_addr_t align);119void memblock_trim_memory(phys_addr_t align);
117bool memblock_overlaps_region(struct memblock_type *type,120bool memblock_overlaps_region(struct memblock_type *type,
118 phys_addr_t base, phys_addr_t size);121 phys_addr_t base, phys_addr_t size);
@@ -127,10 +130,6 @@ void reset_node_managed_pages(pg_data_t *pgdat); · 8 unmodified lines
127void reset_all_zones_managed_pages(void);130void reset_all_zones_managed_pages(void);
128 131
129/* Low level functions */132/* Low level functions */
130int memblock_add_range(struct memblock_type *type,
131 phys_addr_t base, phys_addr_t size,
132 int nid, enum memblock_flags flags);
133
134void __next_mem_range(u64 *idx, int nid, enum memblock_flags flags,133void __next_mem_range(u64 *idx, int nid, enum memblock_flags flags,
135 struct memblock_type *type_a,134 struct memblock_type *type_a,
136 struct memblock_type *type_b, phys_addr_t *out_start,135 struct memblock_type *type_b, phys_addr_t *out_start,
include/linux/memory.h+0−29
@@ -29,8 +29,6 @@ struct memory_block { · 28 unmodified lines
29 int section_count; /* serialized by mem_sysfs_mutex */29 int section_count; /* serialized by mem_sysfs_mutex */
30 int online_type; /* for passing data to online routine */30 int online_type; /* for passing data to online routine */
31 int phys_device; /* to which fru does this belong? */31 int phys_device; /* to which fru does this belong? */
32 void *hw; /* optional pointer to fw/hw data */
33 int (*phys_callback)(struct memory_block *);
34 struct device dev;32 struct device dev;
35 int nid; /* NID for this memory block */33 int nid; /* NID for this memory block */
36};34};
@@ -55,19 +53,6 @@ struct memory_notify { · 18 unmodified lines
55 int status_change_nid;53 int status_change_nid;
56};54};
57 55
58/*
59 * During pageblock isolation, count the number of pages within the
60 * range [start_pfn, start_pfn + nr_pages) which are owned by code
61 * in the notifier chain.
62 */
63#define MEM_ISOLATE_COUNT (1<<0)
64
65struct memory_isolate_notify {
66 unsigned long start_pfn; /* Start of range to check */
67 unsigned int nr_pages; /* # pages in range to check */
68 unsigned int pages_found; /* # pages owned found by callbacks */
69};
70
71struct notifier_block;56struct notifier_block;
72struct mem_section;57struct mem_section;
73 58
@@ -94,27 +79,13 @@ static inline int memory_notify(unsigned long val, void *v) · 20 unmodified lines
94{79{
95 return 0;80 return 0;
96}81}
97static inline int register_memory_isolate_notifier(struct notifier_block *nb)
98{
99 return 0;
100}
101static inline void unregister_memory_isolate_notifier(struct notifier_block *nb)
102{
103}
104static inline int memory_isolate_notify(unsigned long val, void *v)
105{
106 return 0;
107}
108#else82#else
109extern int register_memory_notifier(struct notifier_block *nb);83extern int register_memory_notifier(struct notifier_block *nb);
110extern void unregister_memory_notifier(struct notifier_block *nb);84extern void unregister_memory_notifier(struct notifier_block *nb);
111extern int register_memory_isolate_notifier(struct notifier_block *nb);
112extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
113int create_memory_block_devices(unsigned long start, unsigned long size);85int create_memory_block_devices(unsigned long start, unsigned long size);
114void remove_memory_block_devices(unsigned long start, unsigned long size);86void remove_memory_block_devices(unsigned long start, unsigned long size);
115extern void memory_dev_init(void);87extern void memory_dev_init(void);
116extern int memory_notify(unsigned long val, void *v);88extern int memory_notify(unsigned long val, void *v);
117extern int memory_isolate_notify(unsigned long val, void *v);
118extern struct memory_block *find_memory_block(struct mem_section *);89extern struct memory_block *find_memory_block(struct mem_section *);
119typedef int (*walk_memory_blocks_func_t)(struct memory_block *, void *);90typedef int (*walk_memory_blocks_func_t)(struct memory_block *, void *);
120extern int walk_memory_blocks(unsigned long start, unsigned long size,91extern int walk_memory_blocks(unsigned long start, unsigned long size,
include/linux/memory_hotplug.h+2−1
@@ -94,7 +94,8 @@ extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages); · 93 unmodified lines
94extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);94extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
95extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);95extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
96/* VM interface that may be used by firmware interface */96/* VM interface that may be used by firmware interface */
97extern int online_pages(unsigned long, unsigned long, int);97extern int online_pages(unsigned long pfn, unsigned long nr_pages,
98 int online_type, int nid);
98extern int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn,99extern int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn,
99 unsigned long *valid_start, unsigned long *valid_end);100 unsigned long *valid_start, unsigned long *valid_end);
100extern unsigned long __offline_isolated_pages(unsigned long start_pfn,101extern unsigned long __offline_isolated_pages(unsigned long start_pfn,
include/linux/mm.h+70−34
@@ -70,11 +70,6 @@ static inline void totalram_pages_add(long count) · 69 unmodified lines
70 atomic_long_add(count, &_totalram_pages);70 atomic_long_add(count, &_totalram_pages);
71}71}
72 72
73static inline void totalram_pages_set(long val)
74{
75 atomic_long_set(&_totalram_pages, val);
76}
77
78extern void * high_memory;73extern void * high_memory;
79extern int page_cluster;74extern int page_cluster;
80 75
@@ -916,10 +911,6 @@ vm_fault_t finish_mkwrite_fault(struct vm_fault *vmf); · 835 unmodified lines
916 911
917#define ZONEID_PGSHIFT (ZONEID_PGOFF * (ZONEID_SHIFT != 0))912#define ZONEID_PGSHIFT (ZONEID_PGOFF * (ZONEID_SHIFT != 0))
918 913
919#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
920#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
921#endif
922
923#define ZONES_MASK ((1UL << ZONES_WIDTH) - 1)914#define ZONES_MASK ((1UL << ZONES_WIDTH) - 1)
924#define NODES_MASK ((1UL << NODES_WIDTH) - 1)915#define NODES_MASK ((1UL << NODES_WIDTH) - 1)
925#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)916#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
@@ -947,9 +938,10 @@ static inline bool is_zone_device_page(const struct page *page) · 21 unmodified lines
947#endif938#endif
948 939
949#ifdef CONFIG_DEV_PAGEMAP_OPS940#ifdef CONFIG_DEV_PAGEMAP_OPS
950void __put_devmap_managed_page(struct page *page);941void free_devmap_managed_page(struct page *page);
951DECLARE_STATIC_KEY_FALSE(devmap_managed_key);942DECLARE_STATIC_KEY_FALSE(devmap_managed_key);
952static inline bool put_devmap_managed_page(struct page *page)943
944static inline bool page_is_devmap_managed(struct page *page)
953{945{
954 if (!static_branch_unlikely(&devmap_managed_key))946 if (!static_branch_unlikely(&devmap_managed_key))
955 return false;947 return false;
@@ -958,7 +950,6 @@ static inline bool put_devmap_managed_page(struct page *page) · 2 unmodified lines
958 switch (page->pgmap->type) {950 switch (page->pgmap->type) {
959 case MEMORY_DEVICE_PRIVATE:951 case MEMORY_DEVICE_PRIVATE:
960 case MEMORY_DEVICE_FS_DAX:952 case MEMORY_DEVICE_FS_DAX:
961 __put_devmap_managed_page(page);
962 return true;953 return true;
963 default:954 default:
964 break;955 break;
@@ -966,11 +957,17 @@ static inline bool put_devmap_managed_page(struct page *page) · 1 unmodified line
966 return false;957 return false;
967}958}
968 959
960void put_devmap_managed_page(struct page *page);
961
969#else /* CONFIG_DEV_PAGEMAP_OPS */962#else /* CONFIG_DEV_PAGEMAP_OPS */
970static inline bool put_devmap_managed_page(struct page *page)963static inline bool page_is_devmap_managed(struct page *page)
971{964{
972 return false;965 return false;
973}966}
967
968static inline void put_devmap_managed_page(struct page *page)
969{
970}
974#endif /* CONFIG_DEV_PAGEMAP_OPS */971#endif /* CONFIG_DEV_PAGEMAP_OPS */
975 972
976static inline bool is_device_private_page(const struct page *page)973static inline bool is_device_private_page(const struct page *page)
@@ -1023,37 +1020,37 @@ static inline void put_page(struct page *page) · 46 unmodified lines
1023 * need to inform the device driver through callback. See1020 * need to inform the device driver through callback. See
1024 * include/linux/memremap.h and HMM for details.1021 * include/linux/memremap.h and HMM for details.
1025 */1022 */
1026 if (put_devmap_managed_page(page))1023 if (page_is_devmap_managed(page)) {
1024 put_devmap_managed_page(page);
1027 return;1025 return;
1026 }
1028 1027
1029 if (put_page_testzero(page))1028 if (put_page_testzero(page))
1030 __put_page(page);1029 __put_page(page);
1031}1030}
1032 1031
1033/**1032/**
1034 * put_user_page() - release a gup-pinned page1033 * unpin_user_page() - release a gup-pinned page
1035 * @page: pointer to page to be released1034 * @page: pointer to page to be released
1036 *1035 *
1037 * Pages that were pinned via get_user_pages*() must be released via1036 * Pages that were pinned via pin_user_pages*() must be released via either
1038 * either put_user_page(), or one of the put_user_pages*() routines1037 * unpin_user_page(), or one of the unpin_user_pages*() routines. This is so
1039 * below. This is so that eventually, pages that are pinned via1038 * that eventually such pages can be separately tracked and uniquely handled. In
1040 * get_user_pages*() can be separately tracked and uniquely handled. In1039 * particular, interactions with RDMA and filesystems need special handling.
1041 * particular, interactions with RDMA and filesystems need special
1042 * handling.
1043 *1040 *
1044 * put_user_page() and put_page() are not interchangeable, despite this early1041 * unpin_user_page() and put_page() are not interchangeable, despite this early
1045 * implementation that makes them look the same. put_user_page() calls must1042 * implementation that makes them look the same. unpin_user_page() calls must
1046 * be perfectly matched up with get_user_page() calls.1043 * be perfectly matched up with pin*() calls.
1047 */1044 */
1048static inline void put_user_page(struct page *page)1045static inline void unpin_user_page(struct page *page)
1049{1046{
1050 put_page(page);1047 put_page(page);
1051}1048}
1052 1049
1053void put_user_pages_dirty_lock(struct page **pages, unsigned long npages,1050void unpin_user_pages_dirty_lock(struct page **pages, unsigned long npages,
1054 bool make_dirty);1051 bool make_dirty);
1055 1052
1056void put_user_pages(struct page **pages, unsigned long npages);1053void unpin_user_pages(struct page **pages, unsigned long npages);
1057 1054
1058#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)1055#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
1059#define SECTION_IN_PAGE_FLAGS1056#define SECTION_IN_PAGE_FLAGS
@@ -1501,9 +1498,16 @@ long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, · 441 unmodified lines
1501 unsigned long start, unsigned long nr_pages,1498 unsigned long start, unsigned long nr_pages,
1502 unsigned int gup_flags, struct page **pages,1499 unsigned int gup_flags, struct page **pages,
1503 struct vm_area_struct **vmas, int *locked);1500 struct vm_area_struct **vmas, int *locked);
1501long pin_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
1502 unsigned long start, unsigned long nr_pages,
1503 unsigned int gup_flags, struct page **pages,
1504 struct vm_area_struct **vmas, int *locked);
1504long get_user_pages(unsigned long start, unsigned long nr_pages,1505long get_user_pages(unsigned long start, unsigned long nr_pages,
1505 unsigned int gup_flags, struct page **pages,1506 unsigned int gup_flags, struct page **pages,
1506 struct vm_area_struct **vmas);1507 struct vm_area_struct **vmas);
1508long pin_user_pages(unsigned long start, unsigned long nr_pages,
1509 unsigned int gup_flags, struct page **pages,
1510 struct vm_area_struct **vmas);
1507long get_user_pages_locked(unsigned long start, unsigned long nr_pages,1511long get_user_pages_locked(unsigned long start, unsigned long nr_pages,
1508 unsigned int gup_flags, struct page **pages, int *locked);1512 unsigned int gup_flags, struct page **pages, int *locked);
1509long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,1513long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
@@ -1511,6 +1515,8 @@ long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, · 1 unmodified line
1511 1515
1512int get_user_pages_fast(unsigned long start, int nr_pages,1516int get_user_pages_fast(unsigned long start, int nr_pages,
1513 unsigned int gup_flags, struct page **pages);1517 unsigned int gup_flags, struct page **pages);
1518int pin_user_pages_fast(unsigned long start, int nr_pages,
1519 unsigned int gup_flags, struct page **pages);
1514 1520
1515int account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc);1521int account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc);
1516int __account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc,1522int __account_locked_vm(struct mm_struct *mm, unsigned long pages, bool inc,
@@ -2575,13 +2581,15 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, · 1058 unmodified lines
2575#define FOLL_ANON 0x8000 /* don't do file mappings */2581#define FOLL_ANON 0x8000 /* don't do file mappings */
2576#define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite: see below */2582#define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite: see below */
2577#define FOLL_SPLIT_PMD 0x20000 /* split huge pmd before returning */2583#define FOLL_SPLIT_PMD 0x20000 /* split huge pmd before returning */
2584#define FOLL_PIN 0x40000 /* pages must be released via unpin_user_page */
2578 2585
2579/*2586/*
2580 * NOTE on FOLL_LONGTERM:2587 * FOLL_PIN and FOLL_LONGTERM may be used in various combinations with each
2588 * other. Here is what they mean, and how to use them:
2581 *2589 *
2582 * FOLL_LONGTERM indicates that the page will be held for an indefinite time2590 * FOLL_LONGTERM indicates that the page will be held for an indefinite time
2583 * period _often_ under userspace control. This is contrasted with2591 * period _often_ under userspace control. This is in contrast to
2584 * iov_iter_get_pages() where usages which are transient.2592 * iov_iter_get_pages(), whose usages are transient.
2585 *2593 *
2586 * FIXME: For pages which are part of a filesystem, mappings are subject to the2594 * FIXME: For pages which are part of a filesystem, mappings are subject to the
2587 * lifetime enforced by the filesystem and we need guarantees that longterm2595 * lifetime enforced by the filesystem and we need guarantees that longterm
@@ -2596,11 +2604,39 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, · 8 unmodified lines
2596 * Currently only get_user_pages() and get_user_pages_fast() support this flag2604 * Currently only get_user_pages() and get_user_pages_fast() support this flag
2597 * and calls to get_user_pages_[un]locked are specifically not allowed. This2605 * and calls to get_user_pages_[un]locked are specifically not allowed. This
2598 * is due to an incompatibility with the FS DAX check and2606 * is due to an incompatibility with the FS DAX check and
2599 * FAULT_FLAG_ALLOW_RETRY2607 * FAULT_FLAG_ALLOW_RETRY.
2600 *2608 *
2601 * In the CMA case: longterm pins in a CMA region would unnecessarily fragment2609 * In the CMA case: long term pins in a CMA region would unnecessarily fragment
2602 * that region. And so CMA attempts to migrate the page before pinning when2610 * that region. And so, CMA attempts to migrate the page before pinning, when
2603 * FOLL_LONGTERM is specified.2611 * FOLL_LONGTERM is specified.
2612 *
2613 * FOLL_PIN indicates that a special kind of tracking (not just page->_refcount,
2614 * but an additional pin counting system) will be invoked. This is intended for
2615 * anything that gets a page reference and then touches page data (for example,
2616 * Direct IO). This lets the filesystem know that some non-file-system entity is
2617 * potentially changing the pages' data. In contrast to FOLL_GET (whose pages
2618 * are released via put_page()), FOLL_PIN pages must be released, ultimately, by
2619 * a call to unpin_user_page().
2620 *
2621 * FOLL_PIN is similar to FOLL_GET: both of these pin pages. They use different
2622 * and separate refcounting mechanisms, however, and that means that each has
2623 * its own acquire and release mechanisms:
2624 *
2625 * FOLL_GET: get_user_pages*() to acquire, and put_page() to release.
2626 *
2627 * FOLL_PIN: pin_user_pages*() to acquire, and unpin_user_pages to release.
2628 *
2629 * FOLL_PIN and FOLL_GET are mutually exclusive for a given function call.
2630 * (The underlying pages may experience both FOLL_GET-based and FOLL_PIN-based
2631 * calls applied to them, and that's perfectly OK. This is a constraint on the
2632 * callers, not on the pages.)
2633 *
2634 * FOLL_PIN should be set internally by the pin_user_pages*() APIs, never
2635 * directly by the caller. That's in order to help avoid mismatches when
2636 * releasing pages: get_user_pages*() pages must be released via put_page(),
2637 * while pin_user_pages*() pages must be released via unpin_user_page().
2638 *
2639 * Please see Documentation/vm/pin_user_pages.rst for more information.
2604 */2640 */
2605 2641
2606static inline int vm_fault_to_errno(vm_fault_t vm_fault, int foll_flags)2642static inline int vm_fault_to_errno(vm_fault_t vm_fault, int foll_flags)
include/linux/mmzone.h+1−1
@@ -758,7 +758,7 @@ typedef struct pglist_data { · 757 unmodified lines
758 758
759#ifdef CONFIG_NUMA759#ifdef CONFIG_NUMA
760 /*760 /*
761 * zone reclaim becomes active if more unmapped pages exist.761 * node reclaim becomes active if more unmapped pages exist.
762 */762 */
763 unsigned long min_unmapped_pages;763 unsigned long min_unmapped_pages;
764 unsigned long min_slab_pages;764 unsigned long min_slab_pages;
include/linux/page-isolation.h+2−2
@@ -33,8 +33,8 @@ static inline bool is_migrate_isolate(int migratetype) · 32 unmodified lines
33#define MEMORY_OFFLINE 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,36struct page *has_unmovable_pages(struct zone *zone, struct page *page,
37 int migratetype, int flags);37 int migratetype, int flags);
38void set_pageblock_migratetype(struct page *page, int migratetype);38void set_pageblock_migratetype(struct page *page, int migratetype);
39int move_freepages_block(struct zone *zone, struct page *page,39int move_freepages_block(struct zone *zone, struct page *page,
40 int migratetype, int *num_movable);40 int migratetype, int *num_movable);
include/linux/swab.h+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
7# define swab16 __swab167# define swab16 __swab16
8# define swab32 __swab328# define swab32 __swab32
9# define swab64 __swab649# define swab64 __swab64
10# define swab __swab
10# define swahw32 __swahw3211# define swahw32 __swahw32
11# define swahb32 __swahb3212# define swahb32 __swahb32
12# define swab16p __swab16p13# define swab16p __swab16p
include/linux/thermal.h+0−11
@@ -32,17 +32,6 @@ · 31 unmodified lines
32/* use value, which < 0K, to indicate an invalid/uninitialized temperature */32/* use value, which < 0K, to indicate an invalid/uninitialized temperature */
33#define THERMAL_TEMP_INVALID -27400033#define THERMAL_TEMP_INVALID -274000
34 34
35/* Unit conversion macros */
36#define DECI_KELVIN_TO_CELSIUS(t) ({ \
37 long _t = (t); \
38 ((_t-2732 >= 0) ? (_t-2732+5)/10 : (_t-2732-5)/10); \
39})
40#define CELSIUS_TO_DECI_KELVIN(t) ((t)*10+2732)
41#define DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, off) (((t) - (off)) * 100)
42#define DECI_KELVIN_TO_MILLICELSIUS(t) DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(t, 2732)
43#define MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, off) (((t) / 100) + (off))
44#define MILLICELSIUS_TO_DECI_KELVIN(t) MILLICELSIUS_TO_DECI_KELVIN_WITH_OFFSET(t, 2732)
45
46/* Default Thermal Governor */35/* Default Thermal Governor */
47#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE)36#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE)
48#define DEFAULT_THERMAL_GOVERNOR "step_wise"37#define DEFAULT_THERMAL_GOVERNOR "step_wise"
include/linux/units.h+84−0
@@ -0,0 +1,84 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_UNITS_H
3#define _LINUX_UNITS_H
4
5#include <linux/kernel.h>
6
7#define ABSOLUTE_ZERO_MILLICELSIUS -273150
8
9static inline long milli_kelvin_to_millicelsius(long t)
10{
11 return t + ABSOLUTE_ZERO_MILLICELSIUS;
12}
13
14static inline long millicelsius_to_milli_kelvin(long t)
15{
16 return t - ABSOLUTE_ZERO_MILLICELSIUS;
17}
18
19#define MILLIDEGREE_PER_DEGREE 1000
20#define MILLIDEGREE_PER_DECIDEGREE 100
21
22static inline long kelvin_to_millicelsius(long t)
23{
24 return milli_kelvin_to_millicelsius(t * MILLIDEGREE_PER_DEGREE);
25}
26
27static inline long millicelsius_to_kelvin(long t)
28{
29 t = millicelsius_to_milli_kelvin(t);
30
31 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DEGREE);
32}
33
34static inline long deci_kelvin_to_celsius(long t)
35{
36 t = milli_kelvin_to_millicelsius(t * MILLIDEGREE_PER_DECIDEGREE);
37
38 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DEGREE);
39}
40
41static inline long celsius_to_deci_kelvin(long t)
42{
43 t = millicelsius_to_milli_kelvin(t * MILLIDEGREE_PER_DEGREE);
44
45 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DECIDEGREE);
46}
47
48/**
49 * deci_kelvin_to_millicelsius_with_offset - convert Kelvin to Celsius
50 * @t: temperature value in decidegrees Kelvin
51 * @offset: difference between Kelvin and Celsius in millidegrees
52 *
53 * Return: temperature value in millidegrees Celsius
54 */
55static inline long deci_kelvin_to_millicelsius_with_offset(long t, long offset)
56{
57 return t * MILLIDEGREE_PER_DECIDEGREE - offset;
58}
59
60static inline long deci_kelvin_to_millicelsius(long t)
61{
62 return milli_kelvin_to_millicelsius(t * MILLIDEGREE_PER_DECIDEGREE);
63}
64
65static inline long millicelsius_to_deci_kelvin(long t)
66{
67 t = millicelsius_to_milli_kelvin(t);
68
69 return DIV_ROUND_CLOSEST(t, MILLIDEGREE_PER_DECIDEGREE);
70}
71
72static inline long kelvin_to_celsius(long t)
73{
74 return t + DIV_ROUND_CLOSEST(ABSOLUTE_ZERO_MILLICELSIUS,
75 MILLIDEGREE_PER_DEGREE);
76}
77
78static inline long celsius_to_kelvin(long t)
79{
80 return t - DIV_ROUND_CLOSEST(ABSOLUTE_ZERO_MILLICELSIUS,
81 MILLIDEGREE_PER_DEGREE);
82}
83
84#endif /* _LINUX_UNITS_H */
include/linux/zlib.h+6−0
@@ -191,6 +191,12 @@ extern int zlib_deflate_workspacesize (int windowBits, int memLevel); · 190 unmodified lines
191 exceed those passed here.191 exceed those passed here.
192*/192*/
193 193
194extern int zlib_deflate_dfltcc_enabled (void);
195/*
196 Returns 1 if Deflate-Conversion facility is installed and enabled,
197 otherwise 0.
198*/
199
194/* 200/*
195extern int deflateInit (z_streamp strm, int level);201extern int deflateInit (z_streamp strm, int level);
196 202
include/trace/events/kmem.h+2−2
@@ -88,8 +88,8 @@ DECLARE_EVENT_CLASS(kmem_alloc_node, · 87 unmodified lines
88 __entry->node = node;88 __entry->node = node;
89 ),89 ),
90 90
91 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d",91 TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d",
92 __entry->call_site,92 (void *)__entry->call_site,
93 __entry->ptr,93 __entry->ptr,
94 __entry->bytes_req,94 __entry->bytes_req,
95 __entry->bytes_alloc,95 __entry->bytes_alloc,
include/trace/events/writeback.h+17−20
@@ -67,8 +67,8 @@ DECLARE_EVENT_CLASS(writeback_page_template, · 66 unmodified lines
67 67
68 TP_fast_assign(68 TP_fast_assign(
69 strscpy_pad(__entry->name,69 strscpy_pad(__entry->name,
70 mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)",70 bdi_dev_name(mapping ? inode_to_bdi(mapping->host) :
71 32);71 NULL), 32);
72 __entry->ino = mapping ? mapping->host->i_ino : 0;72 __entry->ino = mapping ? mapping->host->i_ino : 0;
73 __entry->index = page->index;73 __entry->index = page->index;
74 ),74 ),
@@ -111,8 +111,7 @@ DECLARE_EVENT_CLASS(writeback_dirty_inode_template, · 36 unmodified lines
111 struct backing_dev_info *bdi = inode_to_bdi(inode);111 struct backing_dev_info *bdi = inode_to_bdi(inode);
112 112
113 /* may be called for files on pseudo FSes w/ unregistered bdi */113 /* may be called for files on pseudo FSes w/ unregistered bdi */
114 strscpy_pad(__entry->name,114 strscpy_pad(__entry->name, bdi_dev_name(bdi), 32);
115 bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32);
116 __entry->ino = inode->i_ino;115 __entry->ino = inode->i_ino;
117 __entry->state = inode->i_state;116 __entry->state = inode->i_state;
118 __entry->flags = flags;117 __entry->flags = flags;
@@ -193,7 +192,7 @@ TRACE_EVENT(inode_foreign_history, · 74 unmodified lines
193 ),192 ),
194 193
195 TP_fast_assign(194 TP_fast_assign(
196 strncpy(__entry->name, dev_name(inode_to_bdi(inode)->dev), 32);195 strncpy(__entry->name, bdi_dev_name(inode_to_bdi(inode)), 32);
197 __entry->ino = inode->i_ino;196 __entry->ino = inode->i_ino;
198 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);197 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
199 __entry->history = history;198 __entry->history = history;
@@ -222,7 +221,7 @@ TRACE_EVENT(inode_switch_wbs, · 22 unmodified lines
222 ),221 ),
223 222
224 TP_fast_assign(223 TP_fast_assign(
225 strncpy(__entry->name, dev_name(old_wb->bdi->dev), 32);224 strncpy(__entry->name, bdi_dev_name(old_wb->bdi), 32);
226 __entry->ino = inode->i_ino;225 __entry->ino = inode->i_ino;
227 __entry->old_cgroup_ino = __trace_wb_assign_cgroup(old_wb);226 __entry->old_cgroup_ino = __trace_wb_assign_cgroup(old_wb);
228 __entry->new_cgroup_ino = __trace_wb_assign_cgroup(new_wb);227 __entry->new_cgroup_ino = __trace_wb_assign_cgroup(new_wb);
@@ -255,7 +254,7 @@ TRACE_EVENT(track_foreign_dirty, · 26 unmodified lines
255 struct address_space *mapping = page_mapping(page);254 struct address_space *mapping = page_mapping(page);
256 struct inode *inode = mapping ? mapping->host : NULL;255 struct inode *inode = mapping ? mapping->host : NULL;
257 256
258 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);257 strncpy(__entry->name, bdi_dev_name(wb->bdi), 32);
259 __entry->bdi_id = wb->bdi->id;258 __entry->bdi_id = wb->bdi->id;
260 __entry->ino = inode ? inode->i_ino : 0;259 __entry->ino = inode ? inode->i_ino : 0;
261 __entry->memcg_id = wb->memcg_css->id;260 __entry->memcg_id = wb->memcg_css->id;
@@ -288,7 +287,7 @@ TRACE_EVENT(flush_foreign, · 26 unmodified lines
288 ),287 ),
289 288
290 TP_fast_assign(289 TP_fast_assign(
291 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);290 strncpy(__entry->name, bdi_dev_name(wb->bdi), 32);
292 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);291 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
293 __entry->frn_bdi_id = frn_bdi_id;292 __entry->frn_bdi_id = frn_bdi_id;
294 __entry->frn_memcg_id = frn_memcg_id;293 __entry->frn_memcg_id = frn_memcg_id;
@@ -318,7 +317,7 @@ DECLARE_EVENT_CLASS(writeback_write_inode_template, · 23 unmodified lines
318 317
319 TP_fast_assign(318 TP_fast_assign(
320 strscpy_pad(__entry->name,319 strscpy_pad(__entry->name,
321 dev_name(inode_to_bdi(inode)->dev), 32);320 bdi_dev_name(inode_to_bdi(inode)), 32);
322 __entry->ino = inode->i_ino;321 __entry->ino = inode->i_ino;
323 __entry->sync_mode = wbc->sync_mode;322 __entry->sync_mode = wbc->sync_mode;
324 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);323 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
@@ -361,9 +360,7 @@ DECLARE_EVENT_CLASS(writeback_work_class, · 36 unmodified lines
361 __field(ino_t, cgroup_ino)360 __field(ino_t, cgroup_ino)
362 ),361 ),
363 TP_fast_assign(362 TP_fast_assign(
364 strscpy_pad(__entry->name,363 strscpy_pad(__entry->name, bdi_dev_name(wb->bdi), 32);
365 wb->bdi->dev ? dev_name(wb->bdi->dev) :
366 "(unknown)", 32);
367 __entry->nr_pages = work->nr_pages;364 __entry->nr_pages = work->nr_pages;
368 __entry->sb_dev = work->sb ? work->sb->s_dev : 0;365 __entry->sb_dev = work->sb ? work->sb->s_dev : 0;
369 __entry->sync_mode = work->sync_mode;366 __entry->sync_mode = work->sync_mode;
@@ -416,7 +413,7 @@ DECLARE_EVENT_CLASS(writeback_class, · 46 unmodified lines
416 __field(ino_t, cgroup_ino)413 __field(ino_t, cgroup_ino)
417 ),414 ),
418 TP_fast_assign(415 TP_fast_assign(
419 strscpy_pad(__entry->name, dev_name(wb->bdi->dev), 32);416 strscpy_pad(__entry->name, bdi_dev_name(wb->bdi), 32);
420 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);417 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
421 ),418 ),
422 TP_printk("bdi %s: cgroup_ino=%lu",419 TP_printk("bdi %s: cgroup_ino=%lu",
@@ -438,7 +435,7 @@ TRACE_EVENT(writeback_bdi_register, · 15 unmodified lines
438 __array(char, name, 32)435 __array(char, name, 32)
439 ),436 ),
440 TP_fast_assign(437 TP_fast_assign(
441 strscpy_pad(__entry->name, dev_name(bdi->dev), 32);438 strscpy_pad(__entry->name, bdi_dev_name(bdi), 32);
442 ),439 ),
443 TP_printk("bdi %s",440 TP_printk("bdi %s",
444 __entry->name441 __entry->name
@@ -463,7 +460,7 @@ DECLARE_EVENT_CLASS(wbc_class, · 18 unmodified lines
463 ),460 ),
464 461
465 TP_fast_assign(462 TP_fast_assign(
466 strscpy_pad(__entry->name, dev_name(bdi->dev), 32);463 strscpy_pad(__entry->name, bdi_dev_name(bdi), 32);
467 __entry->nr_to_write = wbc->nr_to_write;464 __entry->nr_to_write = wbc->nr_to_write;
468 __entry->pages_skipped = wbc->pages_skipped;465 __entry->pages_skipped = wbc->pages_skipped;
469 __entry->sync_mode = wbc->sync_mode;466 __entry->sync_mode = wbc->sync_mode;
@@ -514,7 +511,7 @@ TRACE_EVENT(writeback_queue_io, · 44 unmodified lines
514 ),511 ),
515 TP_fast_assign(512 TP_fast_assign(
516 unsigned long *older_than_this = work->older_than_this;513 unsigned long *older_than_this = work->older_than_this;
517 strscpy_pad(__entry->name, dev_name(wb->bdi->dev), 32);514 strscpy_pad(__entry->name, bdi_dev_name(wb->bdi), 32);
518 __entry->older = older_than_this ? *older_than_this : 0;515 __entry->older = older_than_this ? *older_than_this : 0;
519 __entry->age = older_than_this ?516 __entry->age = older_than_this ?
520 (jiffies - *older_than_this) * 1000 / HZ : -1;517 (jiffies - *older_than_this) * 1000 / HZ : -1;
@@ -600,7 +597,7 @@ TRACE_EVENT(bdi_dirty_ratelimit, · 79 unmodified lines
600 ),597 ),
601 598
602 TP_fast_assign(599 TP_fast_assign(
603 strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32);600 strscpy_pad(__entry->bdi, bdi_dev_name(wb->bdi), 32);
604 __entry->write_bw = KBps(wb->write_bandwidth);601 __entry->write_bw = KBps(wb->write_bandwidth);
605 __entry->avg_write_bw = KBps(wb->avg_write_bandwidth);602 __entry->avg_write_bw = KBps(wb->avg_write_bandwidth);
606 __entry->dirty_rate = KBps(dirty_rate);603 __entry->dirty_rate = KBps(dirty_rate);
@@ -665,7 +662,7 @@ TRACE_EVENT(balance_dirty_pages, · 58 unmodified lines
665 662
666 TP_fast_assign(663 TP_fast_assign(
667 unsigned long freerun = (thresh + bg_thresh) / 2;664 unsigned long freerun = (thresh + bg_thresh) / 2;
668 strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32);665 strscpy_pad(__entry->bdi, bdi_dev_name(wb->bdi), 32);
669 666
670 __entry->limit = global_wb_domain.dirty_limit;667 __entry->limit = global_wb_domain.dirty_limit;
671 __entry->setpoint = (global_wb_domain.dirty_limit +668 __entry->setpoint = (global_wb_domain.dirty_limit +
@@ -726,7 +723,7 @@ TRACE_EVENT(writeback_sb_inodes_requeue, · 54 unmodified lines
726 723
727 TP_fast_assign(724 TP_fast_assign(
728 strscpy_pad(__entry->name,725 strscpy_pad(__entry->name,
729 dev_name(inode_to_bdi(inode)->dev), 32);726 bdi_dev_name(inode_to_bdi(inode)), 32);
730 __entry->ino = inode->i_ino;727 __entry->ino = inode->i_ino;
731 __entry->state = inode->i_state;728 __entry->state = inode->i_state;
732 __entry->dirtied_when = inode->dirtied_when;729 __entry->dirtied_when = inode->dirtied_when;
@@ -800,7 +797,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, · 67 unmodified lines
800 797
801 TP_fast_assign(798 TP_fast_assign(
802 strscpy_pad(__entry->name,799 strscpy_pad(__entry->name,
803 dev_name(inode_to_bdi(inode)->dev), 32);800 bdi_dev_name(inode_to_bdi(inode)), 32);
804 __entry->ino = inode->i_ino;801 __entry->ino = inode->i_ino;
805 __entry->state = inode->i_state;802 __entry->state = inode->i_state;
806 __entry->dirtied_when = inode->dirtied_when;803 __entry->dirtied_when = inode->dirtied_when;
include/uapi/linux/swab.h+10−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
4 4
5#include <linux/types.h>5#include <linux/types.h>
6#include <linux/compiler.h>6#include <linux/compiler.h>
7#include <asm/bitsperlong.h>
7#include <asm/swab.h>8#include <asm/swab.h>
8 9
9/*10/*
@@ -132,6 +133,15 @@ static inline __attribute_const__ __u32 __fswahb32(__u32 val) · 122 unmodified lines
132 __fswab64(x))133 __fswab64(x))
133#endif134#endif
134 135
136static __always_inline unsigned long __swab(const unsigned long y)
137{
138#if BITS_PER_LONG == 64
139 return __swab64(y);
140#else /* BITS_PER_LONG == 32 */
141 return __swab32(y);
142#endif
143}
144
135/**145/**
136 * __swahw32 - return a word-swapped 32-bit value146 * __swahw32 - return a word-swapped 32-bit value
137 * @x: value to wordswap147 * @x: value to wordswap
include/uapi/linux/sysctl.h+1−1
@@ -195,7 +195,7 @@ enum · 194 unmodified lines
195 VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */195 VM_MIN_UNMAPPED=32, /* Set min percent of unmapped pages */
196 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */196 VM_PANIC_ON_OOM=33, /* panic at out-of-memory */
197 VM_VDSO_ENABLED=34, /* map VDSO into new processes? */197 VM_VDSO_ENABLED=34, /* map VDSO into new processes? */
198 VM_MIN_SLAB=35, /* Percent pages ignored by zone reclaim */198 VM_MIN_SLAB=35, /* Percent pages ignored by node reclaim */
199};199};
200 200
201 201