Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: - a few misc things and hotfixes - ocfs2 - almost all of MM * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (139 commits) kernel/memremap.c: remove the unused device_private_entry_fault() export mm: delete find_get_entries_tag mm/huge_memory.c: make __thp_get_unmapped_area static mm/mprotect.c: fix compilation warning because of unused 'mm' variable mm/page-writeback: introduce tracepoint for wait_on_page_writeback() mm/vmscan: simplify trace_reclaim_flags and trace_shrink_flags mm/Kconfig: update "Memory Model" help text mm/vmscan.c: don't disable irq again when count pgrefill for memcg mm: memblock: make keeping memblock memory opt-in rather than opt-out hugetlbfs: always use address space in inode for resv_map pointer mm/z3fold.c: support page migration mm/z3fold.c: add structure for buddy handles mm/z3fold.c: improve compression by extending search mm/z3fold.c: introduce helper functions mm/page_alloc.c: remove unnecessary parameter in rmqueue_pcplist mm/hmm: add ARCH_HAS_HMM_MIRROR ARCH_HAS_HMM_DEVICE Kconfig mm/vmscan.c: simplify shrink_inactive_list() fs/sync.c: sync_file_range(2) may use WB_SYNC_ALL writeback xen/privcmd-buf.c: convert to use vm_map_pages_zero() xen/gntdev.c: convert to use vm_map_pages() ...
This commit is contained in:
@@ -161,7 +161,8 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
|
||||
struct mmu_notifier_range range;
|
||||
struct mem_cgroup *memcg;
|
||||
|
||||
mmu_notifier_range_init(&range, mm, addr, addr + PAGE_SIZE);
|
||||
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, mm, addr,
|
||||
addr + PAGE_SIZE);
|
||||
|
||||
VM_BUG_ON_PAGE(PageTransHuge(old_page), old_page);
|
||||
|
||||
|
@@ -543,7 +543,7 @@ again:
|
||||
if (unlikely(should_fail_futex(fshared)))
|
||||
return -EFAULT;
|
||||
|
||||
err = get_user_pages_fast(address, 1, 1, &page);
|
||||
err = get_user_pages_fast(address, 1, FOLL_WRITE, &page);
|
||||
/*
|
||||
* If write access is not required (eg. FUTEX_WAIT), try
|
||||
* and get read-only access.
|
||||
|
@@ -500,13 +500,7 @@ static int locate_mem_hole_callback(struct resource *res, void *arg)
|
||||
return locate_mem_hole_bottom_up(start, end, kbuf);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
|
||||
static int kexec_walk_memblock(struct kexec_buf *kbuf,
|
||||
int (*func)(struct resource *, void *))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#ifdef CONFIG_ARCH_KEEP_MEMBLOCK
|
||||
static int kexec_walk_memblock(struct kexec_buf *kbuf,
|
||||
int (*func)(struct resource *, void *))
|
||||
{
|
||||
@@ -550,6 +544,12 @@ static int kexec_walk_memblock(struct kexec_buf *kbuf,
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
static int kexec_walk_memblock(struct kexec_buf *kbuf,
|
||||
int (*func)(struct resource *, void *))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -589,7 +589,7 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf)
|
||||
if (kbuf->mem != KEXEC_BUF_MEM_UNKNOWN)
|
||||
return 0;
|
||||
|
||||
if (IS_ENABLED(CONFIG_ARCH_DISCARD_MEMBLOCK))
|
||||
if (!IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK))
|
||||
ret = kexec_walk_resources(kbuf, locate_mem_hole_callback);
|
||||
else
|
||||
ret = kexec_walk_memblock(kbuf, locate_mem_hole_callback);
|
||||
|
@@ -45,7 +45,6 @@ vm_fault_t device_private_entry_fault(struct vm_area_struct *vma,
|
||||
*/
|
||||
return devmem->page_fault(vma, addr, page, flags, pmdp);
|
||||
}
|
||||
EXPORT_SYMBOL(device_private_entry_fault);
|
||||
#endif /* CONFIG_DEVICE_PRIVATE */
|
||||
|
||||
static void pgmap_array_delete(struct resource *res)
|
||||
@@ -148,6 +147,12 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
|
||||
&pgmap->altmap : NULL;
|
||||
struct resource *res = &pgmap->res;
|
||||
struct dev_pagemap *conflict_pgmap;
|
||||
struct mhp_restrictions restrictions = {
|
||||
/*
|
||||
* We do not want any optional features only our own memmap
|
||||
*/
|
||||
.altmap = altmap,
|
||||
};
|
||||
pgprot_t pgprot = PAGE_KERNEL;
|
||||
int error, nid, is_ram;
|
||||
|
||||
@@ -214,7 +219,7 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
|
||||
*/
|
||||
if (pgmap->type == MEMORY_DEVICE_PRIVATE) {
|
||||
error = add_pages(nid, align_start >> PAGE_SHIFT,
|
||||
align_size >> PAGE_SHIFT, NULL, false);
|
||||
align_size >> PAGE_SHIFT, &restrictions);
|
||||
} else {
|
||||
error = kasan_add_zero_shadow(__va(align_start), align_size);
|
||||
if (error) {
|
||||
@@ -222,8 +227,8 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
|
||||
goto err_kasan;
|
||||
}
|
||||
|
||||
error = arch_add_memory(nid, align_start, align_size, altmap,
|
||||
false);
|
||||
error = arch_add_memory(nid, align_start, align_size,
|
||||
&restrictions);
|
||||
}
|
||||
|
||||
if (!error) {
|
||||
|
@@ -1924,7 +1924,7 @@ static int validate_prctl_map(struct prctl_mm_map *prctl_map)
|
||||
((unsigned long)prctl_map->__m1 __op \
|
||||
(unsigned long)prctl_map->__m2) ? 0 : -EINVAL
|
||||
error = __prctl_check_order(start_code, <, end_code);
|
||||
error |= __prctl_check_order(start_data, <, end_data);
|
||||
error |= __prctl_check_order(start_data,<=, end_data);
|
||||
error |= __prctl_check_order(start_brk, <=, brk);
|
||||
error |= __prctl_check_order(arg_start, <=, arg_end);
|
||||
error |= __prctl_check_order(env_start, <=, env_end);
|
||||
|
@@ -66,6 +66,7 @@
|
||||
#include <linux/kexec.h>
|
||||
#include <linux/bpf.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/userfaultfd_k.h>
|
||||
|
||||
#include "../lib/kstrtox.h"
|
||||
|
||||
@@ -1719,6 +1720,17 @@ static struct ctl_table vm_table[] = {
|
||||
.extra1 = (void *)&mmap_rnd_compat_bits_min,
|
||||
.extra2 = (void *)&mmap_rnd_compat_bits_max,
|
||||
},
|
||||
#endif
|
||||
#ifdef CONFIG_USERFAULTFD
|
||||
{
|
||||
.procname = "unprivileged_userfaultfd",
|
||||
.data = &sysctl_unprivileged_userfaultfd,
|
||||
.maxlen = sizeof(sysctl_unprivileged_userfaultfd),
|
||||
.mode = 0644,
|
||||
.proc_handler = proc_dointvec_minmax,
|
||||
.extra1 = &zero,
|
||||
.extra2 = &one,
|
||||
},
|
||||
#endif
|
||||
{ }
|
||||
};
|
||||
|
Reference in New Issue
Block a user