[Crash-utility] [PATCH] fix missing RT PRIO_ARRAY table with CONFIG_RT_GROUP_SCHED=n
Dave Anderson
anderson at redhat.com
Fri Jan 23 14:22:45 UTC 2015
----- Original Message -----
> On the kernel with CONFIG_RT_GROUP_SCHED=n, the "RT PRIO_ARRAY" table of runq
> command always empty, nevertheless exists "rt_sched_class" task.
>
> This cause to substract offset "task_struct->rt - task_struct" only if there is
> my_q member (ie. CONFIG_RT_GROUP_SCHED=y). Therefore dump_RT_prio_array()
> passes the address of "rt member of task_struct" to task_to_context().
>
> This patch ensure to pass the address of "task_struct" to task_to_context().
But moving the task_addr assignment down to where you have placed it will
not work when OFFSET(task_struct_rt) is invalid. Look above the for loop,
where it has this:
if (VALID_MEMBER(task_struct_rt) &&
VALID_MEMBER(sched_rt_entity_run_list))
ld->list_head_offset = OFFSET(sched_rt_entity_run_list);
else
ld->list_head_offset = OFFSET(task_struct_run_list);
So it looks like it should be:
+ if (VALID_MEMBER(task_struct_rt)
+ task_addr -= OFFSET(task_struct_rt);
+ else
+ task_addr -= (task_struct_run_list);
And BTW, what does the failure look like?
Thanks,
Dave
> ---
> task.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/task.c b/task.c
> index 147ff5c..50c82c8 100644
> --- a/task.c
> +++ b/task.c
> @@ -8688,9 +8688,9 @@ dump_RT_prio_array(ulong k_prio_array, char
> *u_prio_array)
> &rt_rq_buf[OFFSET(rt_rq_active)]);
> FREEBUF(rt_rq_buf);
> continue;
> - } else
> - task_addr -= OFFSET(task_struct_rt);
> + }
> }
> + task_addr -= OFFSET(task_struct_rt);
> if (!(tc = task_to_context(task_addr)))
> continue;
>
> --
> 1.9.1
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
>
More information about the Crash-utility
mailing list