Merge branch 'akpm' (patches from Andrew)
Merge updates from Andrew Morton: - a few misc things - ocfs2 updates - most of MM * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (132 commits) hugetlbfs: dirty pages as they are added to pagecache mm: export add_swap_extent() mm: split SWP_FILE into SWP_ACTIVATED and SWP_FS tools/testing/selftests/vm/map_fixed_noreplace.c: add test for MAP_FIXED_NOREPLACE mm: thp: relocate flush_cache_range() in migrate_misplaced_transhuge_page() mm: thp: fix mmu_notifier in migrate_misplaced_transhuge_page() mm: thp: fix MADV_DONTNEED vs migrate_misplaced_transhuge_page race condition mm/kasan/quarantine.c: make quarantine_lock a raw_spinlock_t mm/gup: cache dev_pagemap while pinning pages Revert "x86/e820: put !E820_TYPE_RAM regions into memblock.reserved" mm: return zero_resv_unavail optimization mm: zero remaining unavailable struct pages tools/testing/selftests/vm/gup_benchmark.c: add MAP_HUGETLB option tools/testing/selftests/vm/gup_benchmark.c: add MAP_SHARED option tools/testing/selftests/vm/gup_benchmark.c: allow user specified file tools/testing/selftests/vm/gup_benchmark.c: fix 'write' flag usage mm/gup_benchmark.c: add additional pinning methods mm/gup_benchmark.c: time put_page() mm: don't raise MEMCG_OOM event due to failed high-order allocation mm/page-writeback.c: fix range_cyclic writeback vs writepages deadlock ...
This commit is contained in:
@@ -418,9 +418,12 @@ static int cramfs_physmem_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
int i;
|
||||
vma->vm_flags |= VM_MIXEDMAP;
|
||||
for (i = 0; i < pages && !ret; i++) {
|
||||
vm_fault_t vmf;
|
||||
unsigned long off = i * PAGE_SIZE;
|
||||
pfn_t pfn = phys_to_pfn_t(address + off, PFN_DEV);
|
||||
ret = vm_insert_mixed(vma, vma->vm_start + off, pfn);
|
||||
vmf = vmf_insert_mixed(vma, vma->vm_start + off, pfn);
|
||||
if (vmf & VM_FAULT_ERROR)
|
||||
ret = vm_fault_to_errno(vmf, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
38
fs/dcache.c
38
fs/dcache.c
@@ -257,24 +257,10 @@ static void __d_free(struct rcu_head *head)
|
||||
kmem_cache_free(dentry_cache, dentry);
|
||||
}
|
||||
|
||||
static void __d_free_external_name(struct rcu_head *head)
|
||||
{
|
||||
struct external_name *name = container_of(head, struct external_name,
|
||||
u.head);
|
||||
|
||||
mod_node_page_state(page_pgdat(virt_to_page(name)),
|
||||
NR_INDIRECTLY_RECLAIMABLE_BYTES,
|
||||
-ksize(name));
|
||||
|
||||
kfree(name);
|
||||
}
|
||||
|
||||
static void __d_free_external(struct rcu_head *head)
|
||||
{
|
||||
struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu);
|
||||
|
||||
__d_free_external_name(&external_name(dentry)->u.head);
|
||||
|
||||
kfree(external_name(dentry));
|
||||
kmem_cache_free(dentry_cache, dentry);
|
||||
}
|
||||
|
||||
@@ -306,7 +292,7 @@ void release_dentry_name_snapshot(struct name_snapshot *name)
|
||||
struct external_name *p;
|
||||
p = container_of(name->name, struct external_name, name[0]);
|
||||
if (unlikely(atomic_dec_and_test(&p->u.count)))
|
||||
call_rcu(&p->u.head, __d_free_external_name);
|
||||
kfree_rcu(p, u.head);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(release_dentry_name_snapshot);
|
||||
@@ -1606,7 +1592,6 @@ EXPORT_SYMBOL(d_invalidate);
|
||||
|
||||
struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
|
||||
{
|
||||
struct external_name *ext = NULL;
|
||||
struct dentry *dentry;
|
||||
char *dname;
|
||||
int err;
|
||||
@@ -1627,14 +1612,15 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
|
||||
dname = dentry->d_iname;
|
||||
} else if (name->len > DNAME_INLINE_LEN-1) {
|
||||
size_t size = offsetof(struct external_name, name[1]);
|
||||
|
||||
ext = kmalloc(size + name->len, GFP_KERNEL_ACCOUNT);
|
||||
if (!ext) {
|
||||
struct external_name *p = kmalloc(size + name->len,
|
||||
GFP_KERNEL_ACCOUNT |
|
||||
__GFP_RECLAIMABLE);
|
||||
if (!p) {
|
||||
kmem_cache_free(dentry_cache, dentry);
|
||||
return NULL;
|
||||
}
|
||||
atomic_set(&ext->u.count, 1);
|
||||
dname = ext->name;
|
||||
atomic_set(&p->u.count, 1);
|
||||
dname = p->name;
|
||||
} else {
|
||||
dname = dentry->d_iname;
|
||||
}
|
||||
@@ -1673,12 +1659,6 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
|
||||
}
|
||||
}
|
||||
|
||||
if (unlikely(ext)) {
|
||||
pg_data_t *pgdat = page_pgdat(virt_to_page(ext));
|
||||
mod_node_page_state(pgdat, NR_INDIRECTLY_RECLAIMABLE_BYTES,
|
||||
ksize(ext));
|
||||
}
|
||||
|
||||
this_cpu_inc(nr_dentry);
|
||||
|
||||
return dentry;
|
||||
@@ -2707,7 +2687,7 @@ static void copy_name(struct dentry *dentry, struct dentry *target)
|
||||
dentry->d_name.hash_len = target->d_name.hash_len;
|
||||
}
|
||||
if (old_name && likely(atomic_dec_and_test(&old_name->u.count)))
|
||||
call_rcu(&old_name->u.head, __d_free_external_name);
|
||||
kfree_rcu(old_name, u.head);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -1057,7 +1057,7 @@ iomap_page_mkwrite_actor(struct inode *inode, loff_t pos, loff_t length,
|
||||
return length;
|
||||
}
|
||||
|
||||
int iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops)
|
||||
vm_fault_t iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops)
|
||||
{
|
||||
struct page *page = vmf->page;
|
||||
struct inode *inode = file_inode(vmf->vma->vm_file);
|
||||
|
@@ -236,6 +236,9 @@ static int kernfs_fill_super(struct super_block *sb, unsigned long magic)
|
||||
sb->s_export_op = &kernfs_export_ops;
|
||||
sb->s_time_gran = 1;
|
||||
|
||||
/* sysfs dentries and inodes don't require IO to create */
|
||||
sb->s_shrink.seeks = 0;
|
||||
|
||||
/* get root inode, initialize and unlock it */
|
||||
mutex_lock(&kernfs_mutex);
|
||||
inode = kernfs_get_inode(sb, info->root->kn);
|
||||
|
@@ -5106,8 +5106,6 @@ int ocfs2_split_extent(handle_t *handle,
|
||||
* rightmost extent list.
|
||||
*/
|
||||
if (path->p_tree_depth) {
|
||||
struct ocfs2_extent_block *eb;
|
||||
|
||||
ret = ocfs2_read_extent_block(et->et_ci,
|
||||
ocfs2_et_get_last_eb_blk(et),
|
||||
&last_eb_bh);
|
||||
@@ -5115,8 +5113,6 @@ int ocfs2_split_extent(handle_t *handle,
|
||||
mlog_errno(ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
eb = (struct ocfs2_extent_block *) last_eb_bh->b_data;
|
||||
}
|
||||
|
||||
if (rec->e_cpos == split_rec->e_cpos &&
|
||||
|
@@ -1392,8 +1392,7 @@ retry:
|
||||
unlock:
|
||||
spin_unlock(&oi->ip_lock);
|
||||
out:
|
||||
if (new)
|
||||
kfree(new);
|
||||
kfree(new);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -329,7 +329,7 @@ void dlm_print_one_mle(struct dlm_master_list_entry *mle)
|
||||
{
|
||||
char *buf;
|
||||
|
||||
buf = (char *) get_zeroed_page(GFP_NOFS);
|
||||
buf = (char *) get_zeroed_page(GFP_ATOMIC);
|
||||
if (buf) {
|
||||
dump_mle(mle, buf, PAGE_SIZE - 1);
|
||||
free_page((unsigned long)buf);
|
||||
|
@@ -531,7 +531,7 @@ void __dlm_dirty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
|
||||
assert_spin_locked(&res->spinlock);
|
||||
|
||||
/* don't shuffle secondary queues */
|
||||
if ((res->owner == dlm->node_num)) {
|
||||
if (res->owner == dlm->node_num) {
|
||||
if (res->state & (DLM_LOCK_RES_MIGRATING |
|
||||
DLM_LOCK_RES_BLOCK_DIRTY))
|
||||
return;
|
||||
|
@@ -4135,7 +4135,6 @@ static int ocfs2_create_reflink_node(struct inode *s_inode,
|
||||
struct buffer_head *ref_root_bh = NULL;
|
||||
struct ocfs2_cached_dealloc_ctxt dealloc;
|
||||
struct ocfs2_super *osb = OCFS2_SB(s_inode->i_sb);
|
||||
struct ocfs2_refcount_block *rb;
|
||||
struct ocfs2_dinode *di = (struct ocfs2_dinode *)s_bh->b_data;
|
||||
struct ocfs2_refcount_tree *ref_tree;
|
||||
|
||||
@@ -4162,7 +4161,6 @@ static int ocfs2_create_reflink_node(struct inode *s_inode,
|
||||
mlog_errno(ret);
|
||||
goto out;
|
||||
}
|
||||
rb = (struct ocfs2_refcount_block *)ref_root_bh->b_data;
|
||||
|
||||
ret = ocfs2_duplicate_extent_list(s_inode, t_inode, t_bh,
|
||||
&ref_tree->rf_ci, ref_root_bh,
|
||||
|
@@ -516,6 +516,9 @@ int proc_fill_super(struct super_block *s, void *data, int silent)
|
||||
*/
|
||||
s->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;
|
||||
|
||||
/* procfs dentries and inodes don't require IO to create */
|
||||
s->s_shrink.seeks = 0;
|
||||
|
||||
pde_get(&proc_root);
|
||||
root_inode = proc_get_inode(s, &proc_root);
|
||||
if (!root_inode) {
|
||||
|
@@ -10,9 +10,6 @@
|
||||
#include <linux/seqlock.h>
|
||||
#include <linux/time.h>
|
||||
|
||||
#define LOAD_INT(x) ((x) >> FSHIFT)
|
||||
#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
|
||||
|
||||
static int loadavg_proc_show(struct seq_file *m, void *v)
|
||||
{
|
||||
unsigned long avnrun[3];
|
||||
|
@@ -38,6 +38,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
|
||||
long cached;
|
||||
long available;
|
||||
unsigned long pages[NR_LRU_LISTS];
|
||||
unsigned long sreclaimable, sunreclaim;
|
||||
int lru;
|
||||
|
||||
si_meminfo(&i);
|
||||
@@ -53,6 +54,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
|
||||
pages[lru] = global_node_page_state(NR_LRU_BASE + lru);
|
||||
|
||||
available = si_mem_available();
|
||||
sreclaimable = global_node_page_state(NR_SLAB_RECLAIMABLE);
|
||||
sunreclaim = global_node_page_state(NR_SLAB_UNRECLAIMABLE);
|
||||
|
||||
show_val_kb(m, "MemTotal: ", i.totalram);
|
||||
show_val_kb(m, "MemFree: ", i.freeram);
|
||||
@@ -94,14 +97,11 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
|
||||
show_val_kb(m, "Mapped: ",
|
||||
global_node_page_state(NR_FILE_MAPPED));
|
||||
show_val_kb(m, "Shmem: ", i.sharedram);
|
||||
show_val_kb(m, "Slab: ",
|
||||
global_node_page_state(NR_SLAB_RECLAIMABLE) +
|
||||
global_node_page_state(NR_SLAB_UNRECLAIMABLE));
|
||||
|
||||
show_val_kb(m, "SReclaimable: ",
|
||||
global_node_page_state(NR_SLAB_RECLAIMABLE));
|
||||
show_val_kb(m, "SUnreclaim: ",
|
||||
global_node_page_state(NR_SLAB_UNRECLAIMABLE));
|
||||
show_val_kb(m, "KReclaimable: ", sreclaimable +
|
||||
global_node_page_state(NR_KERNEL_MISC_RECLAIMABLE));
|
||||
show_val_kb(m, "Slab: ", sreclaimable + sunreclaim);
|
||||
show_val_kb(m, "SReclaimable: ", sreclaimable);
|
||||
show_val_kb(m, "SUnreclaim: ", sunreclaim);
|
||||
seq_printf(m, "KernelStack: %8lu kB\n",
|
||||
global_zone_page_state(NR_KERNEL_STACK_KB));
|
||||
show_val_kb(m, "PageTables: ",
|
||||
|
@@ -713,6 +713,8 @@ static void smap_gather_stats(struct vm_area_struct *vma,
|
||||
smaps_walk.private = mss;
|
||||
|
||||
#ifdef CONFIG_SHMEM
|
||||
/* In case of smaps_rollup, reset the value from previous vma */
|
||||
mss->check_shmem_swap = false;
|
||||
if (vma->vm_file && shmem_mapping(vma->vm_file->f_mapping)) {
|
||||
/*
|
||||
* For shared or readonly shmem mappings we know that all
|
||||
@@ -728,7 +730,7 @@ static void smap_gather_stats(struct vm_area_struct *vma,
|
||||
|
||||
if (!shmem_swapped || (vma->vm_flags & VM_SHARED) ||
|
||||
!(vma->vm_flags & VM_WRITE)) {
|
||||
mss->swap = shmem_swapped;
|
||||
mss->swap += shmem_swapped;
|
||||
} else {
|
||||
mss->check_shmem_swap = true;
|
||||
smaps_walk.pte_hole = smaps_pte_hole;
|
||||
|
@@ -1026,7 +1026,7 @@ static ssize_t userfaultfd_ctx_read(struct userfaultfd_ctx *ctx, int no_wait,
|
||||
struct userfaultfd_ctx *fork_nctx = NULL;
|
||||
|
||||
/* always take the fd_wqh lock before the fault_pending_wqh lock */
|
||||
spin_lock(&ctx->fd_wqh.lock);
|
||||
spin_lock_irq(&ctx->fd_wqh.lock);
|
||||
__add_wait_queue(&ctx->fd_wqh, &wait);
|
||||
for (;;) {
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
@@ -1112,13 +1112,13 @@ static ssize_t userfaultfd_ctx_read(struct userfaultfd_ctx *ctx, int no_wait,
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
spin_unlock(&ctx->fd_wqh.lock);
|
||||
spin_unlock_irq(&ctx->fd_wqh.lock);
|
||||
schedule();
|
||||
spin_lock(&ctx->fd_wqh.lock);
|
||||
spin_lock_irq(&ctx->fd_wqh.lock);
|
||||
}
|
||||
__remove_wait_queue(&ctx->fd_wqh, &wait);
|
||||
__set_current_state(TASK_RUNNING);
|
||||
spin_unlock(&ctx->fd_wqh.lock);
|
||||
spin_unlock_irq(&ctx->fd_wqh.lock);
|
||||
|
||||
if (!ret && msg->event == UFFD_EVENT_FORK) {
|
||||
ret = resolve_userfault_fork(ctx, fork_nctx, msg);
|
||||
|
Viittaa uudesa ongelmassa
Block a user