Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1274057

Re: [PATCH 3/4] sched: introduce synchronized idle injection

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/4] sched: introduce synchronized idle injection
Date 2015-11-20 14:00 +0100
Message-ID <qwTse-7ka-11@gated-at.bofh.it> (permalink)
References (4 earlier) <qwBbY-3Tf-25@gated-at.bofh.it> <qwDGN-5Ex-5@gated-at.bofh.it> <qwQum-5rq-7@gated-at.bofh.it> <qwR75-5WC-47@gated-at.bofh.it> <qwRA7-67v-43@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Nov 20, 2015 at 11:58:12AM +0100, Thomas Gleixner wrote:
> That's not what I meant. If you don't want to control all that from
> the scheduler than you are back to that thread which "runs" at RT
> priority and does
> 
> 	 if (machine_on_fire) {
> 	        defer_timer_interrupt(5ms);
> 		end = now + 5ms:
> 	    	while (now < end)
> 		      mwait();
>          }
> 
> That's what the existing code does, but the above does not longer
> claim it's idle and confuses the hell out of nohz and whatever.  It's
> just a "runaway" RT task which "hogs" the CPU for 5ms and makes the
> next timer interrupt firing late.

Right; so the naive way of implementing that is by simply programing the
timer hardware 5ms in the future and leaving it at that.

The problem with that would be a device interrupt happening and mucking
with timers, this would result in the timer hardware being reprogrammed
to a 'sane' value. I see two solutions for that:

 - add another check in tick_program_event(); or,

 - muck about with the evtdev pointer, such that we (temporarily) neuter
   its clock_event_device::set_next_*() methods.

The later is fugly, but avoids any runtime overhead.

This all makes the idle-injection muck hard depend on hres_active, but I
think that's a sane constraint anyway.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 3/4] sched: introduce synchronized idle injection Morten Rasmussen <morten.rasmussen@arm.com> - 2015-11-18 16:50 +0100
  Re: [PATCH 3/4] sched: introduce synchronized idle injection Arjan van de Ven <arjan@linux.intel.com> - 2015-11-18 17:00 +0100
    Re: [PATCH 3/4] sched: introduce synchronized idle injection Morten Rasmussen <morten.rasmussen@arm.com> - 2015-11-19 18:30 +0100
      Re: [PATCH 3/4] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-19 21:10 +0100
        Re: [PATCH 3/4] sched: introduce synchronized idle injection Thomas Gleixner <tglx@linutronix.de> - 2015-11-20 10:50 +0100
          Re: [PATCH 3/4] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-20 11:30 +0100
            Re: [PATCH 3/4] sched: introduce synchronized idle injection Thomas Gleixner <tglx@linutronix.de> - 2015-11-20 12:00 +0100
              Re: [PATCH 3/4] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-20 14:00 +0100
                Re: [PATCH 3/4] sched: introduce synchronized idle injection Thomas Gleixner <tglx@linutronix.de> - 2015-11-20 20:00 +0100
              Re: [PATCH 3/4] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-24 12:40 +0100
      Re: [PATCH 3/4] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-23 19:00 +0100

csiph-web