Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: "146 patches. Subsystems affected by this patch series: kthread, ia64, scripts, ntfs, squashfs, ocfs2, vfs, and mm (slab-generic, slab, kmemleak, dax, kasan, debug, pagecache, gup, shmem, frontswap, memremap, memcg, selftests, pagemap, dma, vmalloc, memory-failure, hugetlb, userfaultfd, vmscan, mempolicy, oom-kill, hugetlbfs, migration, thp, ksm, page-poison, percpu, rmap, zswap, zram, cleanups, hmm, and damon)" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (146 commits) mm/damon: hide kernel pointer from tracepoint event mm/damon/vaddr: hide kernel pointer from damon_va_three_regions() failure log mm/damon/vaddr: use pr_debug() for damon_va_three_regions() failure logging mm/damon/dbgfs: remove an unnecessary variable mm/damon: move the implementation of damon_insert_region to damon.h mm/damon: add access checking for hugetlb pages Docs/admin-guide/mm/damon/usage: update for schemes statistics mm/damon/dbgfs: support all DAMOS stats Docs/admin-guide/mm/damon/reclaim: document statistics parameters mm/damon/reclaim: provide reclamation statistics mm/damon/schemes: account how many times quota limit has exceeded mm/damon/schemes: account scheme actions that successfully applied mm/damon: remove a mistakenly added comment for a future feature Docs/admin-guide/mm/damon/usage: update for kdamond_pid and (mk|rm)_contexts Docs/admin-guide/mm/damon/usage: mention tracepoint at the beginning Docs/admin-guide/mm/damon/usage: remove redundant information Docs/admin-guide/mm/damon/usage: update for scheme quotas and watermarks mm/damon: convert macro functions to static inline functions mm/damon: modify damon_rand() macro to static inline function mm/damon: move damon_rand() definition into damon.h ...
This commit is contained in:
@@ -203,7 +203,7 @@ static int __init dma_atomic_pool_init(void)
|
||||
GFP_KERNEL);
|
||||
if (!atomic_pool_kernel)
|
||||
ret = -ENOMEM;
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA)) {
|
||||
if (has_managed_dma()) {
|
||||
atomic_pool_dma = __dma_atomic_pool_init(atomic_pool_size,
|
||||
GFP_KERNEL | GFP_DMA);
|
||||
if (!atomic_pool_dma)
|
||||
@@ -226,7 +226,7 @@ static inline struct gen_pool *dma_guess_pool(struct gen_pool *prev, gfp_t gfp)
|
||||
if (prev == NULL) {
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32))
|
||||
return atomic_pool_dma32;
|
||||
if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp & GFP_DMA))
|
||||
if (atomic_pool_dma && (gfp & GFP_DMA))
|
||||
return atomic_pool_dma;
|
||||
return atomic_pool_kernel;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <linux/mmu_notifier.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/mm_inline.h>
|
||||
#include <linux/vmacache.h>
|
||||
#include <linux/nsproxy.h>
|
||||
#include <linux/capability.h>
|
||||
@@ -365,12 +366,14 @@ struct vm_area_struct *vm_area_dup(struct vm_area_struct *orig)
|
||||
*new = data_race(*orig);
|
||||
INIT_LIST_HEAD(&new->anon_vma_chain);
|
||||
new->vm_next = new->vm_prev = NULL;
|
||||
dup_vma_anon_name(orig, new);
|
||||
}
|
||||
return new;
|
||||
}
|
||||
|
||||
void vm_area_free(struct vm_area_struct *vma)
|
||||
{
|
||||
free_vma_anon_name(vma);
|
||||
kmem_cache_free(vm_area_cachep, vma);
|
||||
}
|
||||
|
||||
|
||||
@@ -523,6 +523,7 @@ struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data),
|
||||
to_kthread(p)->cpu = cpu;
|
||||
return p;
|
||||
}
|
||||
EXPORT_SYMBOL(kthread_create_on_cpu);
|
||||
|
||||
void kthread_set_per_cpu(struct task_struct *k, int cpu)
|
||||
{
|
||||
|
||||
@@ -2031,9 +2031,8 @@ static int rcutorture_booster_init(unsigned int cpu)
|
||||
mutex_lock(&boost_mutex);
|
||||
rcu_torture_disable_rt_throttle();
|
||||
VERBOSE_TOROUT_STRING("Creating rcu_torture_boost task");
|
||||
boost_tasks[cpu] = kthread_create_on_node(rcu_torture_boost, NULL,
|
||||
cpu_to_node(cpu),
|
||||
"rcu_torture_boost");
|
||||
boost_tasks[cpu] = kthread_run_on_cpu(rcu_torture_boost, NULL,
|
||||
cpu, "rcu_torture_boost_%u");
|
||||
if (IS_ERR(boost_tasks[cpu])) {
|
||||
retval = PTR_ERR(boost_tasks[cpu]);
|
||||
VERBOSE_TOROUT_STRING("rcu_torture_boost task create failed");
|
||||
@@ -2042,8 +2041,6 @@ static int rcutorture_booster_init(unsigned int cpu)
|
||||
mutex_unlock(&boost_mutex);
|
||||
return retval;
|
||||
}
|
||||
kthread_bind(boost_tasks[cpu], cpu);
|
||||
wake_up_process(boost_tasks[cpu]);
|
||||
mutex_unlock(&boost_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
63
kernel/sys.c
63
kernel/sys.c
@@ -2261,6 +2261,66 @@ int __weak arch_prctl_spec_ctrl_set(struct task_struct *t, unsigned long which,
|
||||
|
||||
#define PR_IO_FLUSHER (PF_MEMALLOC_NOIO | PF_LOCAL_THROTTLE)
|
||||
|
||||
#ifdef CONFIG_ANON_VMA_NAME
|
||||
|
||||
#define ANON_VMA_NAME_MAX_LEN 80
|
||||
#define ANON_VMA_NAME_INVALID_CHARS "\\`$[]"
|
||||
|
||||
static inline bool is_valid_name_char(char ch)
|
||||
{
|
||||
/* printable ascii characters, excluding ANON_VMA_NAME_INVALID_CHARS */
|
||||
return ch > 0x1f && ch < 0x7f &&
|
||||
!strchr(ANON_VMA_NAME_INVALID_CHARS, ch);
|
||||
}
|
||||
|
||||
static int prctl_set_vma(unsigned long opt, unsigned long addr,
|
||||
unsigned long size, unsigned long arg)
|
||||
{
|
||||
struct mm_struct *mm = current->mm;
|
||||
const char __user *uname;
|
||||
char *name, *pch;
|
||||
int error;
|
||||
|
||||
switch (opt) {
|
||||
case PR_SET_VMA_ANON_NAME:
|
||||
uname = (const char __user *)arg;
|
||||
if (uname) {
|
||||
name = strndup_user(uname, ANON_VMA_NAME_MAX_LEN);
|
||||
|
||||
if (IS_ERR(name))
|
||||
return PTR_ERR(name);
|
||||
|
||||
for (pch = name; *pch != '\0'; pch++) {
|
||||
if (!is_valid_name_char(*pch)) {
|
||||
kfree(name);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Reset the name */
|
||||
name = NULL;
|
||||
}
|
||||
|
||||
mmap_write_lock(mm);
|
||||
error = madvise_set_anon_name(mm, addr, size, name);
|
||||
mmap_write_unlock(mm);
|
||||
kfree(name);
|
||||
break;
|
||||
default:
|
||||
error = -EINVAL;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
#else /* CONFIG_ANON_VMA_NAME */
|
||||
static int prctl_set_vma(unsigned long opt, unsigned long start,
|
||||
unsigned long size, unsigned long arg)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif /* CONFIG_ANON_VMA_NAME */
|
||||
|
||||
SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
|
||||
unsigned long, arg4, unsigned long, arg5)
|
||||
{
|
||||
@@ -2530,6 +2590,9 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
|
||||
error = sched_core_share_pid(arg2, arg3, arg4, arg5);
|
||||
break;
|
||||
#endif
|
||||
case PR_SET_VMA:
|
||||
error = prctl_set_vma(arg2, arg3, arg4, arg5);
|
||||
break;
|
||||
default:
|
||||
error = -EINVAL;
|
||||
break;
|
||||
|
||||
@@ -297,6 +297,7 @@ COND_SYSCALL(get_mempolicy);
|
||||
COND_SYSCALL(set_mempolicy);
|
||||
COND_SYSCALL(migrate_pages);
|
||||
COND_SYSCALL(move_pages);
|
||||
COND_SYSCALL(set_mempolicy_home_node);
|
||||
|
||||
COND_SYSCALL(perf_event_open);
|
||||
COND_SYSCALL(accept4);
|
||||
|
||||
@@ -123,6 +123,7 @@ static unsigned long long_max = LONG_MAX;
|
||||
static int one_hundred = 100;
|
||||
static int two_hundred = 200;
|
||||
static int one_thousand = 1000;
|
||||
static int three_thousand = 3000;
|
||||
#ifdef CONFIG_PRINTK
|
||||
static int ten_thousand = 10000;
|
||||
#endif
|
||||
@@ -2960,7 +2961,7 @@ static struct ctl_table vm_table[] = {
|
||||
.mode = 0644,
|
||||
.proc_handler = watermark_scale_factor_sysctl_handler,
|
||||
.extra1 = SYSCTL_ONE,
|
||||
.extra2 = &one_thousand,
|
||||
.extra2 = &three_thousand,
|
||||
},
|
||||
{
|
||||
.procname = "percpu_pagelist_high_fraction",
|
||||
|
||||
@@ -5898,16 +5898,13 @@ static __init int test_ringbuffer(void)
|
||||
rb_data[cpu].buffer = buffer;
|
||||
rb_data[cpu].cpu = cpu;
|
||||
rb_data[cpu].cnt = cpu;
|
||||
rb_threads[cpu] = kthread_create(rb_test, &rb_data[cpu],
|
||||
"rbtester/%d", cpu);
|
||||
rb_threads[cpu] = kthread_run_on_cpu(rb_test, &rb_data[cpu],
|
||||
cpu, "rbtester/%u");
|
||||
if (WARN_ON(IS_ERR(rb_threads[cpu]))) {
|
||||
pr_cont("FAILED\n");
|
||||
ret = PTR_ERR(rb_threads[cpu]);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
kthread_bind(rb_threads[cpu], cpu);
|
||||
wake_up_process(rb_threads[cpu]);
|
||||
}
|
||||
|
||||
/* Now create the rb hammer! */
|
||||
|
||||
@@ -491,18 +491,14 @@ static void stop_per_cpu_kthreads(void)
|
||||
static int start_cpu_kthread(unsigned int cpu)
|
||||
{
|
||||
struct task_struct *kthread;
|
||||
char comm[24];
|
||||
|
||||
snprintf(comm, 24, "hwlatd/%d", cpu);
|
||||
|
||||
kthread = kthread_create_on_cpu(kthread_fn, NULL, cpu, comm);
|
||||
kthread = kthread_run_on_cpu(kthread_fn, NULL, cpu, "hwlatd/%u");
|
||||
if (IS_ERR(kthread)) {
|
||||
pr_err(BANNER "could not start sampling thread\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
per_cpu(hwlat_per_cpu_data, cpu).kthread = kthread;
|
||||
wake_up_process(kthread);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1701,7 +1701,7 @@ static int start_kthread(unsigned int cpu)
|
||||
snprintf(comm, 24, "osnoise/%d", cpu);
|
||||
}
|
||||
|
||||
kthread = kthread_create_on_cpu(main, NULL, cpu, comm);
|
||||
kthread = kthread_run_on_cpu(main, NULL, cpu, comm);
|
||||
|
||||
if (IS_ERR(kthread)) {
|
||||
pr_err(BANNER "could not start sampling thread\n");
|
||||
@@ -1710,7 +1710,6 @@ static int start_kthread(unsigned int cpu)
|
||||
}
|
||||
|
||||
per_cpu(per_cpu_osnoise_var, cpu).kthread = kthread;
|
||||
wake_up_process(kthread);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user