linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf: question about event scheduler
@ 2013-07-23  8:13 Stephane Eranian
  2013-07-23  9:48 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Stephane Eranian @ 2013-07-23  8:13 UTC (permalink / raw)
  To: LKML; +Cc: Peter Zijlstra, Jiri Olsa, mingo@elte.hu

Hi,

I am looking at ctx_pinned_sched_in() and
ctx_flexible_sched_in() and I am trying to
understand the difference of treatment in
case of errors for the two classes of events
(pinned vs. flexible).

For pinned events, when a group fails to
schedule in, the code goes on to the next
group and therefore walks the entire list
for each scheduler invocation.

For flexible events, when a group fails,
the loop aborts and no subsequent group
is tried.

I am trying to understand the motivation for
this difference here.

If I recall, the abort is here to limit malicious
DoS where a malicious user would provide
an arbitrary long list of events, hogging the kernel.
But in the case of pinned events, this is ignored
because to create such events one needs to be
root in the first place.

Am I getting this right?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: perf: question about event scheduler
  2013-07-23  8:13 perf: question about event scheduler Stephane Eranian
@ 2013-07-23  9:48 ` Peter Zijlstra
  2013-07-29  9:23   ` Stephane Eranian
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2013-07-23  9:48 UTC (permalink / raw)
  To: Stephane Eranian; +Cc: LKML, Jiri Olsa, mingo@elte.hu

On Tue, Jul 23, 2013 at 10:13:33AM +0200, Stephane Eranian wrote:
> Hi,
> 
> I am looking at ctx_pinned_sched_in() and
> ctx_flexible_sched_in() and I am trying to
> understand the difference of treatment in
> case of errors for the two classes of events
> (pinned vs. flexible).
> 
> For pinned events, when a group fails to
> schedule in, the code goes on to the next
> group and therefore walks the entire list
> for each scheduler invocation.
> 
> For flexible events, when a group fails,
> the loop aborts and no subsequent group
> is tried.
> 
> I am trying to understand the motivation for
> this difference here.
> 
> If I recall, the abort is here to limit malicious
> DoS where a malicious user would provide
> an arbitrary long list of events, hogging the kernel.
> But in the case of pinned events, this is ignored
> because to create such events one needs to be
> root in the first place.
> 
> Am I getting this right?

Whee, long time ago. I think the biggest reason is that pinned events
should always be scheduled. Not being able to schedule a pinned event is
an error. But yes, that and the fact that they're root only.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: perf: question about event scheduler
  2013-07-23  9:48 ` Peter Zijlstra
@ 2013-07-29  9:23   ` Stephane Eranian
  0 siblings, 0 replies; 3+ messages in thread
From: Stephane Eranian @ 2013-07-29  9:23 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: LKML, Jiri Olsa, mingo@elte.hu

On Tue, Jul 23, 2013 at 11:48 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Tue, Jul 23, 2013 at 10:13:33AM +0200, Stephane Eranian wrote:
> > Hi,
> >
> > I am looking at ctx_pinned_sched_in() and
> > ctx_flexible_sched_in() and I am trying to
> > understand the difference of treatment in
> > case of errors for the two classes of events
> > (pinned vs. flexible).
> >
> > For pinned events, when a group fails to
> > schedule in, the code goes on to the next
> > group and therefore walks the entire list
> > for each scheduler invocation.
> >
> > For flexible events, when a group fails,
> > the loop aborts and no subsequent group
> > is tried.
> >
> > I am trying to understand the motivation for
> > this difference here.
> >
> > If I recall, the abort is here to limit malicious
> > DoS where a malicious user would provide
> > an arbitrary long list of events, hogging the kernel.
> > But in the case of pinned events, this is ignored
> > because to create such events one needs to be
> > root in the first place.
> >
> > Am I getting this right?
>
> Whee, long time ago. I think the biggest reason is that pinned events
> should always be scheduled. Not being able to schedule a pinned event is
> an error. But yes, that and the fact that they're root only.
>
>
Ok, that's what I thought then.
Thanks,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-29  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-23  8:13 perf: question about event scheduler Stephane Eranian
2013-07-23  9:48 ` Peter Zijlstra
2013-07-29  9:23   ` Stephane Eranian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).