lkml.org 
[lkml]   [2009]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] perf_counter: cleanup for __perf_event_sched_in()
    It must be a group leader if event->attr.pinned is "1"

    Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
    ---
    kernel/perf_event.c | 11 +++++------
    1 files changed, 5 insertions(+), 6 deletions(-)

    diff --git a/kernel/perf_event.c b/kernel/perf_event.c
    index 76ac4db..fdd9c94 100644
    --- a/kernel/perf_event.c
    +++ b/kernel/perf_event.c
    @@ -1258,12 +1258,11 @@ __perf_event_sched_in(struct perf_event_context *ctx,
    if (event->cpu != -1 && event->cpu != cpu)
    continue;

    - if (event != event->group_leader)
    - event_sched_in(event, cpuctx, ctx, cpu);
    - else {
    - if (group_can_go_on(event, cpuctx, 1))
    - group_sched_in(event, cpuctx, ctx, cpu);
    - }
    + /* Only a group leader can be pinned */
    + BUG_ON(event != event->group_leader);
    +
    + if (group_can_go_on(event, cpuctx, 1))
    + group_sched_in(event, cpuctx, ctx, cpu);

    /*
    * If this pinned group hasn't been scheduled,
    --
    1.6.1.2


    \
     
     \ /
      Last update: 2009-09-22 10:51    [W:0.028 / U:33.044 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site