Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: - a few misc things - ocfs2 updates - most of MM * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (159 commits) tools/testing/selftests/proc/proc-self-syscall.c: remove duplicate include proc: more robust bulk read test proc: test /proc/*/maps, smaps, smaps_rollup, statm proc: use seq_puts() everywhere proc: read kernel cpu stat pointer once proc: remove unused argument in proc_pid_lookup() fs/proc/thread_self.c: code cleanup for proc_setup_thread_self() fs/proc/self.c: code cleanup for proc_setup_self() proc: return exit code 4 for skipped tests mm,mremap: bail out earlier in mremap_to under map pressure mm/sparse: fix a bad comparison mm/memory.c: do_fault: avoid usage of stale vm_area_struct writeback: fix inode cgroup switching comment mm/huge_memory.c: fix "orig_pud" set but not used mm/hotplug: fix an imbalance with DEBUG_PAGEALLOC mm/memcontrol.c: fix bad line in comment mm/cma.c: cma_declare_contiguous: correct err handling mm/page_ext.c: fix an imbalance with kmemleak mm/compaction: pass pgdat to too_many_isolated() instead of zone mm: remove zone_lru_lock() function, access ->lru_lock directly ...
This commit is contained in:
@ -3534,6 +3534,16 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
|
||||
return ret ?: nbytes;
|
||||
}
|
||||
|
||||
static __poll_t cgroup_file_poll(struct kernfs_open_file *of, poll_table *pt)
|
||||
{
|
||||
struct cftype *cft = of->kn->priv;
|
||||
|
||||
if (cft->poll)
|
||||
return cft->poll(of, pt);
|
||||
|
||||
return kernfs_generic_poll(of, pt);
|
||||
}
|
||||
|
||||
static void *cgroup_seqfile_start(struct seq_file *seq, loff_t *ppos)
|
||||
{
|
||||
return seq_cft(seq)->seq_start(seq, ppos);
|
||||
@ -3572,6 +3582,7 @@ static struct kernfs_ops cgroup_kf_single_ops = {
|
||||
.open = cgroup_file_open,
|
||||
.release = cgroup_file_release,
|
||||
.write = cgroup_file_write,
|
||||
.poll = cgroup_file_poll,
|
||||
.seq_show = cgroup_seqfile_show,
|
||||
};
|
||||
|
||||
@ -3580,6 +3591,7 @@ static struct kernfs_ops cgroup_kf_ops = {
|
||||
.open = cgroup_file_open,
|
||||
.release = cgroup_file_release,
|
||||
.write = cgroup_file_write,
|
||||
.poll = cgroup_file_poll,
|
||||
.seq_start = cgroup_seqfile_start,
|
||||
.seq_next = cgroup_seqfile_next,
|
||||
.seq_stop = cgroup_seqfile_stop,
|
||||
|
@ -464,6 +464,8 @@ static int __init crash_save_vmcoreinfo_init(void)
|
||||
VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE);
|
||||
#ifdef CONFIG_HUGETLB_PAGE
|
||||
VMCOREINFO_NUMBER(HUGETLB_PAGE_DTOR);
|
||||
#define PAGE_OFFLINE_MAPCOUNT_VALUE (~PG_offline)
|
||||
VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE);
|
||||
#endif
|
||||
|
||||
arch_crash_save_vmcoreinfo();
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/numa.h>
|
||||
#include <trace/events/sched.h>
|
||||
|
||||
static DEFINE_SPINLOCK(kthread_create_lock);
|
||||
@ -681,7 +682,7 @@ __kthread_create_worker(int cpu, unsigned int flags,
|
||||
{
|
||||
struct kthread_worker *worker;
|
||||
struct task_struct *task;
|
||||
int node = -1;
|
||||
int node = NUMA_NO_NODE;
|
||||
|
||||
worker = kzalloc(sizeof(*worker), GFP_KERNEL);
|
||||
if (!worker)
|
||||
|
@ -1215,14 +1215,16 @@ static struct page *saveable_highmem_page(struct zone *zone, unsigned long pfn)
|
||||
if (!pfn_valid(pfn))
|
||||
return NULL;
|
||||
|
||||
page = pfn_to_page(pfn);
|
||||
if (page_zone(page) != zone)
|
||||
page = pfn_to_online_page(pfn);
|
||||
if (!page || page_zone(page) != zone)
|
||||
return NULL;
|
||||
|
||||
BUG_ON(!PageHighMem(page));
|
||||
|
||||
if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page) ||
|
||||
PageReserved(page))
|
||||
if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page))
|
||||
return NULL;
|
||||
|
||||
if (PageReserved(page) || PageOffline(page))
|
||||
return NULL;
|
||||
|
||||
if (page_is_guard(page))
|
||||
@ -1277,8 +1279,8 @@ static struct page *saveable_page(struct zone *zone, unsigned long pfn)
|
||||
if (!pfn_valid(pfn))
|
||||
return NULL;
|
||||
|
||||
page = pfn_to_page(pfn);
|
||||
if (page_zone(page) != zone)
|
||||
page = pfn_to_online_page(pfn);
|
||||
if (!page || page_zone(page) != zone)
|
||||
return NULL;
|
||||
|
||||
BUG_ON(PageHighMem(page));
|
||||
@ -1286,6 +1288,9 @@ static struct page *saveable_page(struct zone *zone, unsigned long pfn)
|
||||
if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page))
|
||||
return NULL;
|
||||
|
||||
if (PageOffline(page))
|
||||
return NULL;
|
||||
|
||||
if (PageReserved(page)
|
||||
&& (!kernel_page_present(page) || pfn_is_nosave(pfn)))
|
||||
return NULL;
|
||||
|
@ -2220,6 +2220,9 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
|
||||
INIT_HLIST_HEAD(&p->preempt_notifiers);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_COMPACTION
|
||||
p->capture_control = NULL;
|
||||
#endif
|
||||
init_numa_balancing(clone_flags, p);
|
||||
}
|
||||
|
||||
|
@ -1173,7 +1173,7 @@ void init_numa_balancing(unsigned long clone_flags, struct task_struct *p)
|
||||
|
||||
/* New address space, reset the preferred nid */
|
||||
if (!(clone_flags & CLONE_VM)) {
|
||||
p->numa_preferred_nid = -1;
|
||||
p->numa_preferred_nid = NUMA_NO_NODE;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1193,13 +1193,13 @@ void init_numa_balancing(unsigned long clone_flags, struct task_struct *p)
|
||||
|
||||
static void account_numa_enqueue(struct rq *rq, struct task_struct *p)
|
||||
{
|
||||
rq->nr_numa_running += (p->numa_preferred_nid != -1);
|
||||
rq->nr_numa_running += (p->numa_preferred_nid != NUMA_NO_NODE);
|
||||
rq->nr_preferred_running += (p->numa_preferred_nid == task_node(p));
|
||||
}
|
||||
|
||||
static void account_numa_dequeue(struct rq *rq, struct task_struct *p)
|
||||
{
|
||||
rq->nr_numa_running -= (p->numa_preferred_nid != -1);
|
||||
rq->nr_numa_running -= (p->numa_preferred_nid != NUMA_NO_NODE);
|
||||
rq->nr_preferred_running -= (p->numa_preferred_nid == task_node(p));
|
||||
}
|
||||
|
||||
@ -1413,7 +1413,7 @@ bool should_numa_migrate_memory(struct task_struct *p, struct page * page,
|
||||
* two full passes of the "multi-stage node selection" test that is
|
||||
* executed below.
|
||||
*/
|
||||
if ((p->numa_preferred_nid == -1 || p->numa_scan_seq <= 4) &&
|
||||
if ((p->numa_preferred_nid == NUMA_NO_NODE || p->numa_scan_seq <= 4) &&
|
||||
(cpupid_pid_unset(last_cpupid) || cpupid_match_pid(p, last_cpupid)))
|
||||
return true;
|
||||
|
||||
@ -1861,7 +1861,7 @@ static void numa_migrate_preferred(struct task_struct *p)
|
||||
unsigned long interval = HZ;
|
||||
|
||||
/* This task has no NUMA fault statistics yet */
|
||||
if (unlikely(p->numa_preferred_nid == -1 || !p->numa_faults))
|
||||
if (unlikely(p->numa_preferred_nid == NUMA_NO_NODE || !p->numa_faults))
|
||||
return;
|
||||
|
||||
/* Periodically retry migrating the task to the preferred node */
|
||||
@ -2108,7 +2108,7 @@ static int preferred_group_nid(struct task_struct *p, int nid)
|
||||
|
||||
static void task_numa_placement(struct task_struct *p)
|
||||
{
|
||||
int seq, nid, max_nid = -1;
|
||||
int seq, nid, max_nid = NUMA_NO_NODE;
|
||||
unsigned long max_faults = 0;
|
||||
unsigned long fault_types[2] = { 0, 0 };
|
||||
unsigned long total_faults;
|
||||
@ -2651,7 +2651,8 @@ static void update_scan_period(struct task_struct *p, int new_cpu)
|
||||
* the preferred node.
|
||||
*/
|
||||
if (dst_nid == p->numa_preferred_nid ||
|
||||
(p->numa_preferred_nid != -1 && src_nid != p->numa_preferred_nid))
|
||||
(p->numa_preferred_nid != NUMA_NO_NODE &&
|
||||
src_nid != p->numa_preferred_nid))
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1471,7 +1471,7 @@ static struct ctl_table vm_table[] = {
|
||||
.data = &sysctl_extfrag_threshold,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = sysctl_extfrag_handler,
|
||||
.proc_handler = proc_dointvec_minmax,
|
||||
.extra1 = &min_extfrag_threshold,
|
||||
.extra2 = &max_extfrag_threshold,
|
||||
},
|
||||
|
Reference in New Issue
Block a user