Merge tag 'sched-core-2023-04-27' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Apr 2023 21:53:30 +0000 (14:53 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Apr 2023 21:53:30 +0000 (14:53 -0700)
Pull scheduler updates from Ingo Molnar:

 - Allow unprivileged PSI poll()ing

 - Fix performance regression introduced by mm_cid

 - Improve livepatch stalls by adding livepatch task switching to
   cond_resched(). This resolves livepatching busy-loop stalls with
   certain CPU-bound kthreads

 - Improve sched_move_task() performance on autogroup configs

 - On core-scheduling CPUs, avoid selecting throttled tasks to run

 - Misc cleanups, fixes and improvements

* tag 'sched-core-2023-04-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/clock: Fix local_clock() before sched_clock_init()
  sched/rt: Fix bad task migration for rt tasks
  sched: Fix performance regression introduced by mm_cid
  sched/core: Make sched_dynamic_mutex static
  sched/psi: Allow unprivileged polling of N*2s period
  sched/psi: Extract update_triggers side effect
  sched/psi: Rename existing poll members in preparation
  sched/psi: Rearrange polling code in preparation
  sched/fair: Fix inaccurate tally of ttwu_move_affine
  vhost: Fix livepatch timeouts in vhost_worker()
  livepatch,sched: Add livepatch task switching to cond_resched()
  livepatch: Skip task_call_func() for current task
  livepatch: Convert stack entries array to percpu
  sched: Interleave cfs bandwidth timers for improved single thread performance at low utilization
  sched/core: Reduce cost of sched_move_task when config autogroup
  sched/core: Avoid selecting the task that is throttled to run when core-sched enable
  sched/topology: Make sched_energy_mutex,update static

1  2 
drivers/vhost/vhost.c
include/linux/mm_types.h
include/linux/sched.h
include/linux/sched/mm.h
kernel/cgroup/cgroup.c
kernel/fork.c
kernel/livepatch/core.c
kernel/sched/core.c
kernel/sched/fair.c

@@@ -358,14 -360,13 +358,13 @@@ static int vhost_worker(void *data
                llist_for_each_entry_safe(work, work_next, node, node) {
                        clear_bit(VHOST_WORK_QUEUED, &work->flags);
                        __set_current_state(TASK_RUNNING);
 -                      kcov_remote_start_common(dev->kcov_handle);
 +                      kcov_remote_start_common(worker->kcov_handle);
                        work->fn(work);
                        kcov_remote_stop();
-                       if (need_resched())
-                               schedule();
+                       cond_resched();
                }
        }
 -      kthread_unuse_mm(dev->mm);
 +
        return 0;
  }
  
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/fork.c
@@@ -1308,7 -1179,8 +1313,9 @@@ static struct mm_struct *mm_init(struc
  fail_pcpu:
        while (i > 0)
                percpu_counter_destroy(&mm->rss_stat[--i]);
+       mm_destroy_cid(mm);
+ fail_cid:
 +      destroy_context(mm);
  fail_nocontext:
        mm_free_pgd(mm);
  fail_nopgd:
Simple merge
@@@ -5268,10 -5284,13 +5286,13 @@@ context_switch(struct rq *rq, struct ta
  
        /*
         * kernel -> kernel   lazy + transfer active
 -       *   user -> kernel   lazy + mmgrab() active
 +       *   user -> kernel   lazy + mmgrab_lazy_tlb() active
         *
 -       * kernel ->   user   switch + mmdrop() active
 +       * kernel ->   user   switch + mmdrop_lazy_tlb() active
         *   user ->   user   switch
+        *
+        * switch_mm_cid() needs to be updated if the barriers provided
+        * by context_switch() are modified.
         */
        if (!next->mm) {                                // to kernel
                enter_lazy_tlb(prev->active_mm, next);
Simple merge