Commit 30c99993 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'sched-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler updates from Ingo Molnar:
 "Debuggability:

   - Change most occurances of BUG_ON() to WARN_ON_ONCE()

   - Reorganize & fix TASK_ state comparisons, turn it into a bitmap

   - Update/fix misc scheduler debugging facilities

  Load-balancing & regular scheduling:

   - Improve the behavior of the scheduler in presence of lot of
     SCHED_IDLE tasks - in particular they should not impact other
     scheduling classes.

   - Optimize task load tracking, cleanups & fixes

   - Clean up & simplify misc load-balancing code

  Freezer:

   - Rewrite the core freezer to behave better wrt thawing and be
     simpler in general, by replacing PF_FROZEN with TASK_FROZEN &
     fixing/adjusting all the fallout.

  Deadline scheduler:

   - Fix the DL capacity-aware code

   - Factor out dl_task_is_earliest_deadline() &
     replenish_dl_new_period()

   - Relax/optimize locking in task_non_contending()

  Cleanups:

   - Factor out the update_current_exec_runtime() helper

   - Various cleanups, simplifications"

* tag 'sched-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
  sched: Fix more TASK_state comparisons
  sched: Fix TASK_state comparisons
  sched/fair: Move call to list_last_entry() in detach_tasks
  sched/fair: Cleanup loop_max and loop_break
  sched/fair: Make sure to try to detach at least one movable task
  sched: Show PF_flag holes
  freezer,sched: Rewrite core freezer logic
  sched: Widen TAKS_state literals
  sched/wait: Add wait_event_state()
  sched/completion: Add wait_for_completion_state()
  sched: Add TASK_ANY for wait_task_inactive()
  sched: Change wait_task_inactive()s match_state
  freezer,umh: Clean up freezer/initrd interaction
  freezer: Have {,un}lock_system_sleep() save/restore flags
  sched: Rename task_running() to task_on_cpu()
  sched/fair: Cleanup for SIS_PROP
  sched/fair: Default to false in test_idle_cores()
  sched/fair: Remove useless check in select_idle_core()
  sched/fair: Avoid double search on same cpu
  sched/fair: Remove redundant check in select_idle_smt()
  ...
parents 493ffd66 fdf756f7
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -654,12 +654,14 @@ void __init acpi_s2idle_setup(void)

int acpi_register_lps0_dev(struct acpi_s2idle_dev_ops *arg)
{
	unsigned int sleep_flags;

	if (!lps0_device_handle || sleep_no_lps0)
		return -ENODEV;

	lock_system_sleep();
	sleep_flags = lock_system_sleep();
	list_add(&arg->list_node, &lps0_s2idle_devops_head);
	unlock_system_sleep();
	unlock_system_sleep(sleep_flags);

	return 0;
}
@@ -667,12 +669,14 @@ EXPORT_SYMBOL_GPL(acpi_register_lps0_dev);

void acpi_unregister_lps0_dev(struct acpi_s2idle_dev_ops *arg)
{
	unsigned int sleep_flags;

	if (!lps0_device_handle || sleep_no_lps0)
		return;

	lock_system_sleep();
	sleep_flags = lock_system_sleep();
	list_del(&arg->list_node);
	unlock_system_sleep();
	unlock_system_sleep(sleep_flags);
}
EXPORT_SYMBOL_GPL(acpi_unregister_lps0_dev);

+1 −3
Original line number Diff line number Diff line
@@ -4259,10 +4259,9 @@ static int binder_wait_for_work(struct binder_thread *thread,
	struct binder_proc *proc = thread->proc;
	int ret = 0;

	freezer_do_not_count();
	binder_inner_proc_lock(proc);
	for (;;) {
		prepare_to_wait(&thread->wait, &wait, TASK_INTERRUPTIBLE);
		prepare_to_wait(&thread->wait, &wait, TASK_INTERRUPTIBLE|TASK_FREEZABLE);
		if (binder_has_work_ilocked(thread, do_proc_work))
			break;
		if (do_proc_work)
@@ -4279,7 +4278,6 @@ static int binder_wait_for_work(struct binder_thread *thread,
	}
	finish_wait(&thread->wait, &wait);
	binder_inner_proc_unlock(proc);
	freezer_count();

	return ret;
}
+2 −2
Original line number Diff line number Diff line
@@ -445,8 +445,8 @@ static int pt3_fetch_thread(void *data)
		pt3_proc_dma(adap);

		delay = ktime_set(0, PT3_FETCH_DELAY * NSEC_PER_MSEC);
		set_current_state(TASK_UNINTERRUPTIBLE);
		freezable_schedule_hrtimeout_range(&delay,
		set_current_state(TASK_UNINTERRUPTIBLE|TASK_FREEZABLE);
		schedule_hrtimeout_range(&delay,
					PT3_FETCH_DELAY_DELTA * NSEC_PER_MSEC,
					HRTIMER_MODE_REL);
	}
+1 −1
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ void idle_inject_stop(struct idle_inject_device *ii_dev)
		iit = per_cpu_ptr(&idle_inject_thread, cpu);
		iit->should_run = 0;

		wait_task_inactive(iit->tsk, 0);
		wait_task_inactive(iit->tsk, TASK_ANY);
	}

	cpu_hotplug_enable();
+4 −3
Original line number Diff line number Diff line
@@ -998,8 +998,9 @@ void
spi_dv_device(struct scsi_device *sdev)
{
	struct scsi_target *starget = sdev->sdev_target;
	u8 *buffer;
	const int len = SPI_MAX_ECHO_BUFFER_SIZE*2;
	unsigned int sleep_flags;
	u8 *buffer;

	/*
	 * Because this function and the power management code both call
@@ -1007,7 +1008,7 @@ spi_dv_device(struct scsi_device *sdev)
	 * while suspend or resume is in progress. Hence the
	 * lock/unlock_system_sleep() calls.
	 */
	lock_system_sleep();
	sleep_flags = lock_system_sleep();

	if (scsi_autopm_get_device(sdev))
		goto unlock_system_sleep;
@@ -1058,7 +1059,7 @@ spi_dv_device(struct scsi_device *sdev)
	scsi_autopm_put_device(sdev);

unlock_system_sleep:
	unlock_system_sleep();
	unlock_system_sleep(sleep_flags);
}
EXPORT_SYMBOL(spi_dv_device);

Loading