Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98959948 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler updates from Ingo Molnar:

 - Move the nohz kick code out of the scheduler tick to a dedicated IPI,
   from Frederic Weisbecker.

  This necessiated quite some background infrastructure rework,
  including:

   * Clean up some irq-work internals
   * Implement remote irq-work
   * Implement nohz kick on top of remote irq-work
   * Move full dynticks timer enqueue notification to new kick
   * Move multi-task notification to new kick
   * Remove unecessary barriers on multi-task notification

 - Remove proliferation of wait_on_bit() action functions and allow
   wait_on_bit_action() functions to support a timeout.  (Neil Brown)

 - Another round of sched/numa improvements, cleanups and fixes.  (Rik
   van Riel)

 - Implement fast idling of CPUs when the system is partially loaded,
   for better scalability.  (Tim Chen)

 - Restructure and fix the CPU hotplug handling code that may leave
   cfs_rq and rt_rq's throttled when tasks are migrated away from a dead
   cpu.  (Kirill Tkhai)

 - Robustify the sched topology setup code.  (Peterz Zijlstra)

 - Improve sched_feat() handling wrt.  static_keys (Jason Baron)

 - Misc fixes.

* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (37 commits)
  sched/fair: Fix 'make xmldocs' warning caused by missing description
  sched: Use macro for magic number of -1 for setparam
  sched: Robustify topology setup
  sched: Fix sched_setparam() policy == -1 logic
  sched: Allow wait_on_bit_action() functions to support a timeout
  sched: Remove proliferation of wait_on_bit() action functions
  sched/numa: Revert "Use effective_load() to balance NUMA loads"
  sched: Fix static_key race with sched_feat()
  sched: Remove extra static_key*() function indirection
  sched/rt: Fix replenish_dl_entity() comments to match the current upstream code
  sched: Transform resched_task() into resched_curr()
  sched/deadline: Kill task_struct->pi_top_task
  sched: Rework check_for_tasks()
  sched/rt: Enqueue just unthrottled rt_rq back on the stack in __disable_runtime()
  sched/fair: Disable runtime_enabled on dying rq
  sched/numa: Change scan period code to match intent
  sched/numa: Rework best node setting in task_numa_migrate()
  sched/numa: Examine a task move when examining a task swap
  sched/numa: Simplify task_numa_compare()
  sched/numa: Use effective_load() to balance NUMA loads
  ...
parents ef35ad26 cd3bd4e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -90,7 +90,7 @@ operations:
     to be cleared before proceeding:
     to be cleared before proceeding:


		wait_on_bit(&op->flags, FSCACHE_OP_WAITING,
		wait_on_bit(&op->flags, FSCACHE_OP_WAITING,
			    fscache_wait_bit, TASK_UNINTERRUPTIBLE);
			    TASK_UNINTERRUPTIBLE);




 (2) The operation may be fast asynchronous (FSCACHE_OP_FAST), in which case it
 (2) The operation may be fast asynchronous (FSCACHE_OP_FAST), in which case it
+1 −1
Original line number Original line Diff line number Diff line
@@ -1515,7 +1515,7 @@ Doing the same with chrt -r 5 and function-trace set.
  <idle>-0       3d.h4    1us+:      0:120:R   + [003]  2448: 94:R sleep
  <idle>-0       3d.h4    1us+:      0:120:R   + [003]  2448: 94:R sleep
  <idle>-0       3d.h4    2us : ttwu_do_activate.constprop.87 <-try_to_wake_up
  <idle>-0       3d.h4    2us : ttwu_do_activate.constprop.87 <-try_to_wake_up
  <idle>-0       3d.h3    3us : check_preempt_curr <-ttwu_do_wakeup
  <idle>-0       3d.h3    3us : check_preempt_curr <-ttwu_do_wakeup
  <idle>-0       3d.h3    3us : resched_task <-check_preempt_curr
  <idle>-0       3d.h3    3us : resched_curr <-check_preempt_curr
  <idle>-0       3dNh3    4us : task_woken_rt <-ttwu_do_wakeup
  <idle>-0       3dNh3    4us : task_woken_rt <-ttwu_do_wakeup
  <idle>-0       3dNh3    4us : _raw_spin_unlock <-try_to_wake_up
  <idle>-0       3dNh3    4us : _raw_spin_unlock <-try_to_wake_up
  <idle>-0       3dNh3    4us : sub_preempt_count <-_raw_spin_unlock
  <idle>-0       3dNh3    4us : sub_preempt_count <-_raw_spin_unlock
+14 −27
Original line number Original line Diff line number Diff line
@@ -614,16 +614,6 @@ static void write_endio(struct bio *bio, int error)
	wake_up_bit(&b->state, B_WRITING);
	wake_up_bit(&b->state, B_WRITING);
}
}


/*
 * This function is called when wait_on_bit is actually waiting.
 */
static int do_io_schedule(void *word)
{
	io_schedule();

	return 0;
}

/*
/*
 * Initiate a write on a dirty buffer, but don't wait for it.
 * Initiate a write on a dirty buffer, but don't wait for it.
 *
 *
@@ -640,8 +630,7 @@ static void __write_dirty_buffer(struct dm_buffer *b,
		return;
		return;


	clear_bit(B_DIRTY, &b->state);
	clear_bit(B_DIRTY, &b->state);
	wait_on_bit_lock(&b->state, B_WRITING,
	wait_on_bit_lock_io(&b->state, B_WRITING, TASK_UNINTERRUPTIBLE);
			 do_io_schedule, TASK_UNINTERRUPTIBLE);


	if (!write_list)
	if (!write_list)
		submit_io(b, WRITE, b->block, write_endio);
		submit_io(b, WRITE, b->block, write_endio);
@@ -675,9 +664,9 @@ static void __make_buffer_clean(struct dm_buffer *b)
	if (!b->state)	/* fast case */
	if (!b->state)	/* fast case */
		return;
		return;


	wait_on_bit(&b->state, B_READING, do_io_schedule, TASK_UNINTERRUPTIBLE);
	wait_on_bit_io(&b->state, B_READING, TASK_UNINTERRUPTIBLE);
	__write_dirty_buffer(b, NULL);
	__write_dirty_buffer(b, NULL);
	wait_on_bit(&b->state, B_WRITING, do_io_schedule, TASK_UNINTERRUPTIBLE);
	wait_on_bit_io(&b->state, B_WRITING, TASK_UNINTERRUPTIBLE);
}
}


/*
/*
@@ -1030,7 +1019,7 @@ static void *new_read(struct dm_bufio_client *c, sector_t block,
	if (need_submit)
	if (need_submit)
		submit_io(b, READ, b->block, read_endio);
		submit_io(b, READ, b->block, read_endio);


	wait_on_bit(&b->state, B_READING, do_io_schedule, TASK_UNINTERRUPTIBLE);
	wait_on_bit_io(&b->state, B_READING, TASK_UNINTERRUPTIBLE);


	if (b->read_error) {
	if (b->read_error) {
		int error = b->read_error;
		int error = b->read_error;
@@ -1209,14 +1198,12 @@ int dm_bufio_write_dirty_buffers(struct dm_bufio_client *c)
				dropped_lock = 1;
				dropped_lock = 1;
				b->hold_count++;
				b->hold_count++;
				dm_bufio_unlock(c);
				dm_bufio_unlock(c);
				wait_on_bit(&b->state, B_WRITING,
				wait_on_bit_io(&b->state, B_WRITING,
					    do_io_schedule,
					       TASK_UNINTERRUPTIBLE);
					       TASK_UNINTERRUPTIBLE);
				dm_bufio_lock(c);
				dm_bufio_lock(c);
				b->hold_count--;
				b->hold_count--;
			} else
			} else
				wait_on_bit(&b->state, B_WRITING,
				wait_on_bit_io(&b->state, B_WRITING,
					    do_io_schedule,
					       TASK_UNINTERRUPTIBLE);
					       TASK_UNINTERRUPTIBLE);
		}
		}


@@ -1321,15 +1308,15 @@ void dm_bufio_release_move(struct dm_buffer *b, sector_t new_block)


	__write_dirty_buffer(b, NULL);
	__write_dirty_buffer(b, NULL);
	if (b->hold_count == 1) {
	if (b->hold_count == 1) {
		wait_on_bit(&b->state, B_WRITING,
		wait_on_bit_io(&b->state, B_WRITING,
			    do_io_schedule, TASK_UNINTERRUPTIBLE);
			       TASK_UNINTERRUPTIBLE);
		set_bit(B_DIRTY, &b->state);
		set_bit(B_DIRTY, &b->state);
		__unlink_buffer(b);
		__unlink_buffer(b);
		__link_buffer(b, new_block, LIST_DIRTY);
		__link_buffer(b, new_block, LIST_DIRTY);
	} else {
	} else {
		sector_t old_block;
		sector_t old_block;
		wait_on_bit_lock(&b->state, B_WRITING,
		wait_on_bit_lock_io(&b->state, B_WRITING,
				 do_io_schedule, TASK_UNINTERRUPTIBLE);
				    TASK_UNINTERRUPTIBLE);
		/*
		/*
		 * Relink buffer to "new_block" so that write_callback
		 * Relink buffer to "new_block" so that write_callback
		 * sees "new_block" as a block number.
		 * sees "new_block" as a block number.
@@ -1341,8 +1328,8 @@ void dm_bufio_release_move(struct dm_buffer *b, sector_t new_block)
		__unlink_buffer(b);
		__unlink_buffer(b);
		__link_buffer(b, new_block, b->list_mode);
		__link_buffer(b, new_block, b->list_mode);
		submit_io(b, WRITE, new_block, write_endio);
		submit_io(b, WRITE, new_block, write_endio);
		wait_on_bit(&b->state, B_WRITING,
		wait_on_bit_io(&b->state, B_WRITING,
			    do_io_schedule, TASK_UNINTERRUPTIBLE);
			       TASK_UNINTERRUPTIBLE);
		__unlink_buffer(b);
		__unlink_buffer(b);
		__link_buffer(b, old_block, b->list_mode);
		__link_buffer(b, old_block, b->list_mode);
	}
	}
+1 −9
Original line number Original line Diff line number Diff line
@@ -1032,21 +1032,13 @@ static void start_merge(struct dm_snapshot *s)
		snapshot_merge_next_chunks(s);
		snapshot_merge_next_chunks(s);
}
}


static int wait_schedule(void *ptr)
{
	schedule();

	return 0;
}

/*
/*
 * Stop the merging process and wait until it finishes.
 * Stop the merging process and wait until it finishes.
 */
 */
static void stop_merge(struct dm_snapshot *s)
static void stop_merge(struct dm_snapshot *s)
{
{
	set_bit(SHUTDOWN_MERGE, &s->state_bits);
	set_bit(SHUTDOWN_MERGE, &s->state_bits);
	wait_on_bit(&s->state_bits, RUNNING_MERGE, wait_schedule,
	wait_on_bit(&s->state_bits, RUNNING_MERGE, TASK_UNINTERRUPTIBLE);
		    TASK_UNINTERRUPTIBLE);
	clear_bit(SHUTDOWN_MERGE, &s->state_bits);
	clear_bit(SHUTDOWN_MERGE, &s->state_bits);
}
}


+2 −10
Original line number Original line Diff line number Diff line
@@ -253,13 +253,6 @@ static int dvb_usbv2_adapter_stream_exit(struct dvb_usb_adapter *adap)
	return usb_urb_exitv2(&adap->stream);
	return usb_urb_exitv2(&adap->stream);
}
}


static int wait_schedule(void *ptr)
{
	schedule();

	return 0;
}

static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
{
{
	struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv;
	struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv;
@@ -273,8 +266,7 @@ static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
			dvbdmxfeed->pid, dvbdmxfeed->index);
			dvbdmxfeed->pid, dvbdmxfeed->index);


	/* wait init is done */
	/* wait init is done */
	wait_on_bit(&adap->state_bits, ADAP_INIT, wait_schedule,
	wait_on_bit(&adap->state_bits, ADAP_INIT, TASK_UNINTERRUPTIBLE);
			TASK_UNINTERRUPTIBLE);


	if (adap->active_fe == -1)
	if (adap->active_fe == -1)
		return -EINVAL;
		return -EINVAL;
@@ -568,7 +560,7 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe)


	if (!adap->suspend_resume_active) {
	if (!adap->suspend_resume_active) {
		set_bit(ADAP_SLEEP, &adap->state_bits);
		set_bit(ADAP_SLEEP, &adap->state_bits);
		wait_on_bit(&adap->state_bits, ADAP_STREAMING, wait_schedule,
		wait_on_bit(&adap->state_bits, ADAP_STREAMING,
				TASK_UNINTERRUPTIBLE);
				TASK_UNINTERRUPTIBLE);
	}
	}


Loading