[PATCH] sched debug: remove NULL checking in print_cfs/rt_rq() - Kernel

This is a discussion on [PATCH] sched debug: remove NULL checking in print_cfs/rt_rq() - Kernel ; cfs->tg is initialized in init_tg_cfs_entry() with tg != NULL, and will never be invalidated to NULL. And the underlying cgroup of a valid task_group is always valid. Same for rt->tg. Signed-off-by: Li Zefan --- kernel/sched_debug.c | 14 ++------------ 1 files ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH] sched debug: remove NULL checking in print_cfs/rt_rq()

  1. [PATCH] sched debug: remove NULL checking in print_cfs/rt_rq()

    cfs->tg is initialized in init_tg_cfs_entry() with tg != NULL, and
    will never be invalidated to NULL. And the underlying cgroup of a
    valid task_group is always valid.

    Same for rt->tg.

    Signed-off-by: Li Zefan
    ---
    kernel/sched_debug.c | 14 ++------------
    1 files changed, 2 insertions(+), 12 deletions(-)

    diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
    index 5ae1776..d25cefe 100644
    --- a/kernel/sched_debug.c
    +++ b/kernel/sched_debug.c
    @@ -121,14 +121,9 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)

    #if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
    char path[128] = "";
    - struct cgroup *cgroup = NULL;
    struct task_group *tg = cfs_rq->tg;

    - if (tg)
    - cgroup = tg->css.cgroup;
    -
    - if (cgroup)
    - cgroup_path(cgroup, path, sizeof(path));
    + cgroup_path(tg->css.cgroup, path, sizeof(path));

    SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
    #else
    @@ -193,14 +188,9 @@ void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq)
    {
    #if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_RT_GROUP_SCHED)
    char path[128] = "";
    - struct cgroup *cgroup = NULL;
    struct task_group *tg = rt_rq->tg;

    - if (tg)
    - cgroup = tg->css.cgroup;
    -
    - if (cgroup)
    - cgroup_path(cgroup, path, sizeof(path));
    + cgroup_path(tg->css.cgroup, path, sizeof(path));

    SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, path);
    #else
    --
    1.5.4.rc3
    --
    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/

  2. Re: [PATCH] sched debug: remove NULL checking in print_cfs/rt_rq()


    * Li Zefan wrote:

    > cfs->tg is initialized in init_tg_cfs_entry() with tg != NULL, and
    > will never be invalidated to NULL. And the underlying cgroup of a
    > valid task_group is always valid.
    >
    > Same for rt->tg.
    >
    > Signed-off-by: Li Zefan
    > ---
    > kernel/sched_debug.c | 14 ++------------
    > 1 files changed, 2 insertions(+), 12 deletions(-)


    applied to tip/sched/core, thanks!

    Ingo
    --
    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/

+ Reply to Thread