diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-18 14:31:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-18 14:31:26 -0500 |
commit | c67a98c00ea3c1fad14833f440fcd770232d24e7 (patch) | |
tree | 8f8848b43285f36e3dada9b989d09b00127dab5e /kernel | |
parent | 03582f338e39ed8f8e8451ef1ef04f060d785a87 (diff) | |
parent | 45e79815b89149dc6698e71b587c86ffaf4062aa (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton:
"16 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm/memblock.c: fix a typo in __next_mem_pfn_range() comments
mm, page_alloc: check for max order in hot path
scripts/spdxcheck.py: make python3 compliant
tmpfs: make lseek(SEEK_DATA/SEK_HOLE) return ENXIO with a negative offset
lib/ubsan.c: don't mark __ubsan_handle_builtin_unreachable as noreturn
mm/vmstat.c: fix NUMA statistics updates
mm/gup.c: fix follow_page_mask() kerneldoc comment
ocfs2: free up write context when direct IO failed
scripts/faddr2line: fix location of start_kernel in comment
mm: don't reclaim inodes with many attached pages
mm, memory_hotplug: check zone_movable in has_unmovable_pages
mm/swapfile.c: use kvzalloc for swap_info_struct allocation
MAINTAINERS: update OMAP MMC entry
hugetlbfs: fix kernel BUG at fs/hugetlbfs/inode.c:444!
kernel/sched/psi.c: simplify cgroup_move_task()
z3fold: fix possible reclaim races
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/psi.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 7cdecfc010af..3d7355d7c3e3 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c | |||
@@ -633,38 +633,39 @@ void psi_cgroup_free(struct cgroup *cgroup) | |||
633 | */ | 633 | */ |
634 | void cgroup_move_task(struct task_struct *task, struct css_set *to) | 634 | void cgroup_move_task(struct task_struct *task, struct css_set *to) |
635 | { | 635 | { |
636 | bool move_psi = !psi_disabled; | ||
637 | unsigned int task_flags = 0; | 636 | unsigned int task_flags = 0; |
638 | struct rq_flags rf; | 637 | struct rq_flags rf; |
639 | struct rq *rq; | 638 | struct rq *rq; |
640 | 639 | ||
641 | if (move_psi) { | 640 | if (psi_disabled) { |
642 | rq = task_rq_lock(task, &rf); | 641 | /* |
642 | * Lame to do this here, but the scheduler cannot be locked | ||
643 | * from the outside, so we move cgroups from inside sched/. | ||
644 | */ | ||
645 | rcu_assign_pointer(task->cgroups, to); | ||
646 | return; | ||
647 | } | ||
643 | 648 | ||
644 | if (task_on_rq_queued(task)) | 649 | rq = task_rq_lock(task, &rf); |
645 | task_flags = TSK_RUNNING; | ||
646 | else if (task->in_iowait) | ||
647 | task_flags = TSK_IOWAIT; | ||
648 | 650 | ||
649 | if (task->flags & PF_MEMSTALL) | 651 | if (task_on_rq_queued(task)) |
650 | task_flags |= TSK_MEMSTALL; | 652 | task_flags = TSK_RUNNING; |
653 | else if (task->in_iowait) | ||
654 | task_flags = TSK_IOWAIT; | ||
651 | 655 | ||
652 | if (task_flags) | 656 | if (task->flags & PF_MEMSTALL) |
653 | psi_task_change(task, task_flags, 0); | 657 | task_flags |= TSK_MEMSTALL; |
654 | } | ||
655 | 658 | ||
656 | /* | 659 | if (task_flags) |
657 | * Lame to do this here, but the scheduler cannot be locked | 660 | psi_task_change(task, task_flags, 0); |
658 | * from the outside, so we move cgroups from inside sched/. | 661 | |
659 | */ | 662 | /* See comment above */ |
660 | rcu_assign_pointer(task->cgroups, to); | 663 | rcu_assign_pointer(task->cgroups, to); |
661 | 664 | ||
662 | if (move_psi) { | 665 | if (task_flags) |
663 | if (task_flags) | 666 | psi_task_change(task, 0, task_flags); |
664 | psi_task_change(task, 0, task_flags); | ||
665 | 667 | ||
666 | task_rq_unlock(rq, task, &rf); | 668 | task_rq_unlock(rq, task, &rf); |
667 | } | ||
668 | } | 669 | } |
669 | #endif /* CONFIG_CGROUPS */ | 670 | #endif /* CONFIG_CGROUPS */ |
670 | 671 | ||