You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'akpm' (patches from Andrew)
Merge more updates from Andrew Morton: - almost all of the rest of MM - misc bits - KASAN updates - procfs - lib/ updates - checkpatch updates * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (124 commits) checkpatch: remove false unbalanced braces warning checkpatch: notice unbalanced else braces in a patch checkpatch: add another old address for the FSF checkpatch: update $logFunctions checkpatch: warn on logging continuations checkpatch: warn on embedded function names lib/lz4: remove back-compat wrappers fs/pstore: fs/squashfs: change usage of LZ4 to work with new LZ4 version crypto: change LZ4 modules to work with new LZ4 module version lib/decompress_unlz4: change module to work with new LZ4 module version lib: update LZ4 compressor module lib/test_sort.c: make it explicitly non-modular lib: add CONFIG_TEST_SORT to enable self-test of sort() rbtree: use designated initializers linux/kernel.h: fix DIV_ROUND_CLOSEST to support negative divisors lib/find_bit.c: micro-optimise find_next_*_bit lib: add module support to atomic64 tests lib: add module support to glob tests lib: add module support to crc32 tests kernel/ksysfs.c: add __ro_after_init to bin_attribute structure ...
This commit is contained in:
@@ -4925,9 +4925,9 @@ unlock:
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
static int perf_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
static int perf_mmap_fault(struct vm_fault *vmf)
|
||||
{
|
||||
struct perf_event *event = vma->vm_file->private_data;
|
||||
struct perf_event *event = vmf->vma->vm_file->private_data;
|
||||
struct ring_buffer *rb;
|
||||
int ret = VM_FAULT_SIGBUS;
|
||||
|
||||
@@ -4950,7 +4950,7 @@ static int perf_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
goto unlock;
|
||||
|
||||
get_page(vmf->page);
|
||||
vmf->page->mapping = vma->vm_file->f_mapping;
|
||||
vmf->page->mapping = vmf->vma->vm_file->f_mapping;
|
||||
vmf->page->index = vmf->pgoff;
|
||||
|
||||
ret = 0;
|
||||
|
||||
+16
-10
@@ -153,14 +153,19 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
|
||||
struct page *old_page, struct page *new_page)
|
||||
{
|
||||
struct mm_struct *mm = vma->vm_mm;
|
||||
spinlock_t *ptl;
|
||||
pte_t *ptep;
|
||||
struct page_vma_mapped_walk pvmw = {
|
||||
.page = old_page,
|
||||
.vma = vma,
|
||||
.address = addr,
|
||||
};
|
||||
int err;
|
||||
/* For mmu_notifiers */
|
||||
const unsigned long mmun_start = addr;
|
||||
const unsigned long mmun_end = addr + PAGE_SIZE;
|
||||
struct mem_cgroup *memcg;
|
||||
|
||||
VM_BUG_ON_PAGE(PageTransHuge(old_page), old_page);
|
||||
|
||||
err = mem_cgroup_try_charge(new_page, vma->vm_mm, GFP_KERNEL, &memcg,
|
||||
false);
|
||||
if (err)
|
||||
@@ -171,11 +176,11 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
|
||||
|
||||
mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
|
||||
err = -EAGAIN;
|
||||
ptep = page_check_address(old_page, mm, addr, &ptl, 0);
|
||||
if (!ptep) {
|
||||
if (!page_vma_mapped_walk(&pvmw)) {
|
||||
mem_cgroup_cancel_charge(new_page, memcg, false);
|
||||
goto unlock;
|
||||
}
|
||||
VM_BUG_ON_PAGE(addr != pvmw.address, old_page);
|
||||
|
||||
get_page(new_page);
|
||||
page_add_new_anon_rmap(new_page, vma, addr, false);
|
||||
@@ -187,14 +192,15 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
|
||||
inc_mm_counter(mm, MM_ANONPAGES);
|
||||
}
|
||||
|
||||
flush_cache_page(vma, addr, pte_pfn(*ptep));
|
||||
ptep_clear_flush_notify(vma, addr, ptep);
|
||||
set_pte_at_notify(mm, addr, ptep, mk_pte(new_page, vma->vm_page_prot));
|
||||
flush_cache_page(vma, addr, pte_pfn(*pvmw.pte));
|
||||
ptep_clear_flush_notify(vma, addr, pvmw.pte);
|
||||
set_pte_at_notify(mm, addr, pvmw.pte,
|
||||
mk_pte(new_page, vma->vm_page_prot));
|
||||
|
||||
page_remove_rmap(old_page, false);
|
||||
if (!page_mapped(old_page))
|
||||
try_to_free_swap(old_page);
|
||||
pte_unmap_unlock(ptep, ptl);
|
||||
page_vma_mapped_walk_done(&pvmw);
|
||||
|
||||
if (vma->vm_flags & VM_LOCKED)
|
||||
munlock_vma_page(old_page);
|
||||
@@ -300,8 +306,8 @@ int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr,
|
||||
|
||||
retry:
|
||||
/* Read the page with vaddr into memory */
|
||||
ret = get_user_pages_remote(NULL, mm, vaddr, 1, FOLL_FORCE, &old_page,
|
||||
&vma, NULL);
|
||||
ret = get_user_pages_remote(NULL, mm, vaddr, 1,
|
||||
FOLL_FORCE | FOLL_SPLIT, &old_page, &vma, NULL);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <linux/task_io_accounting_ops.h>
|
||||
#include <linux/tracehook.h>
|
||||
#include <linux/fs_struct.h>
|
||||
#include <linux/userfaultfd_k.h>
|
||||
#include <linux/init_task.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <trace/events/sched.h>
|
||||
@@ -547,6 +548,7 @@ static void exit_mm(void)
|
||||
enter_lazy_tlb(mm, current);
|
||||
task_unlock(current);
|
||||
mm_update_next_owner(mm);
|
||||
userfaultfd_exit(mm);
|
||||
mmput(mm);
|
||||
if (test_thread_flag(TIF_MEMDIE))
|
||||
exit_oom_victim();
|
||||
|
||||
+1
-1
@@ -195,7 +195,7 @@ static ssize_t notes_read(struct file *filp, struct kobject *kobj,
|
||||
return count;
|
||||
}
|
||||
|
||||
static struct bin_attribute notes_attr = {
|
||||
static struct bin_attribute notes_attr __ro_after_init = {
|
||||
.attr = {
|
||||
.name = "notes",
|
||||
.mode = S_IRUGO,
|
||||
|
||||
@@ -246,9 +246,13 @@ static void devm_memremap_pages_release(struct device *dev, void *data)
|
||||
/* pages are dead and unused, undo the arch mapping */
|
||||
align_start = res->start & ~(SECTION_SIZE - 1);
|
||||
align_size = ALIGN(resource_size(res), SECTION_SIZE);
|
||||
|
||||
lock_device_hotplug();
|
||||
mem_hotplug_begin();
|
||||
arch_remove_memory(align_start, align_size);
|
||||
mem_hotplug_done();
|
||||
unlock_device_hotplug();
|
||||
|
||||
untrack_pfn(NULL, PHYS_PFN(align_start), align_size);
|
||||
pgmap_radix_release(res);
|
||||
dev_WARN_ONCE(dev, pgmap->altmap && pgmap->altmap->alloc,
|
||||
@@ -360,9 +364,11 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
|
||||
if (error)
|
||||
goto err_pfn_remap;
|
||||
|
||||
lock_device_hotplug();
|
||||
mem_hotplug_begin();
|
||||
error = arch_add_memory(nid, align_start, align_size, true);
|
||||
mem_hotplug_done();
|
||||
unlock_device_hotplug();
|
||||
if (error)
|
||||
goto err_add_memory;
|
||||
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ static int notifier_call_chain(struct notifier_block **nl,
|
||||
if (nr_calls)
|
||||
(*nr_calls)++;
|
||||
|
||||
if ((ret & NOTIFY_STOP_MASK) == NOTIFY_STOP_MASK)
|
||||
if (ret & NOTIFY_STOP_MASK)
|
||||
break;
|
||||
nb = next_nb;
|
||||
nr_to_call--;
|
||||
|
||||
+2
-2
@@ -39,10 +39,10 @@ static void relay_file_mmap_close(struct vm_area_struct *vma)
|
||||
/*
|
||||
* fault() vm_op implementation for relay file mapping.
|
||||
*/
|
||||
static int relay_buf_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
static int relay_buf_fault(struct vm_fault *vmf)
|
||||
{
|
||||
struct page *page;
|
||||
struct rchan_buf *buf = vma->vm_private_data;
|
||||
struct rchan_buf *buf = vmf->vma->vm_private_data;
|
||||
pgoff_t pgoff = vmf->pgoff;
|
||||
|
||||
if (!buf)
|
||||
|
||||
Reference in New Issue
Block a user