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


Groups > linux.kernel > #1374064

Re: sched: horrible way to detect whether a task has been preempted

From Petr Mladek <pmladek@suse.com>
Newsgroups linux.kernel
Subject Re: sched: horrible way to detect whether a task has been preempted
Date 2016-04-08 10:10 +0200
Message-ID <rlzEm-Px-9@gated-at.bofh.it> (permalink)
References (1 earlier) <rgFKq-6zA-29@gated-at.bofh.it> <rlpvk-1uc-23@gated-at.bofh.it> <rlpOG-1Do-9@gated-at.bofh.it> <rlrnr-2VG-11@gated-at.bofh.it> <rlyIi-bh-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri 2016-04-08 09:05:28, Jiri Kosina wrote:
> On Thu, 7 Apr 2016, Jessica Yu wrote:
> 
> > > Alternatively, without eating up a TIF_ space, it'd be possible to push a
> > > magic contents on top of the stack in preempt_schedule_irq() (and pop it
> > > once we are returning from there), and if such magic value is detected, we
> > > just don't bother and claim unreliability.
> > 
> > Ah, but wouldn't we still have to walk through the frames (i.e. enter
> > the loop in patch 7/14) to look for the magic value in this approach?
> 
> The idea was that it'd be located at a place to which saved stack pointer 
> of the sleeping task is pointing to (or at a fixed offset from it).

It is an interesting idea but it looks even more hacky than checking
the frame pointers and return values.

Checking the stack might be an overkill but we already do this for all
the other patched functions.

The big advantage about checking the stack is that it does not add
any overhead to the scheduler code, does not eat any TIF flag or
memory. The overhead is only when we are migrating a task and it is
charged to a separate process.

Best Regards,
Petr

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


Thread

Re: sched: horrible way to detect whether a task has been preempted Jessica Yu <jeyu@redhat.com> - 2016-04-07 23:20 +0200
  Re: sched: horrible way to detect whether a task has been  preempted Jiri Kosina <jikos@kernel.org> - 2016-04-07 23:40 +0200
    Re: sched: horrible way to detect whether a task has been preempted Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-08 00:40 +0200
      Re: sched: horrible way to detect whether a task has been  preempted Jiri Kosina <jikos@kernel.org> - 2016-04-08 01:00 +0200
    Re: sched: horrible way to detect whether a task has been preempted Jessica Yu <jeyu@redhat.com> - 2016-04-08 01:20 +0200
      Re: sched: horrible way to detect whether a task has been  preempted Jiri Kosina <jikos@kernel.org> - 2016-04-08 09:10 +0200
        Re: sched: horrible way to detect whether a task has been preempted Petr Mladek <pmladek@suse.com> - 2016-04-08 10:10 +0200
          Re: sched: horrible way to detect whether a task has been preempted Josh Poimboeuf <jpoimboe@redhat.com> - 2016-04-08 16:40 +0200
            Re: sched: horrible way to detect whether a task has been preempted Petr Mladek <pmladek@suse.com> - 2016-04-11 10:40 +0200

csiph-web