lkml.org 
[lkml]   [2016]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2] perf sched: fix wrong conversion of task state
Date
Hi Hiramatsu-san,

On 2016/7/28, 2016 8:43, Masami Hiramatsu wrote:
> Hmm, this includes several fixes and enhancements.
> 1. Use first bit of the state instead of state itself (critical bug to
avoid crash?)
> 2. Check the range of the array and return '?' if out (minor bug, it can
access data area)
> 3. Fix TASK_STATE_TO_CHAR_STR to swap X and Z.
> 4. Add new 'N+' to TASK_STATE_TO_CHAR_STR. (how about 'n'?)
> 5. Treat a preempted task as THREAD_WAIT_CPU.
>
> so IMHO, it is better to split this patch into atleast 2, #1 and #2
(critical bugfix),
> #3, #4, and #5 (minor update).

This time I will fix only the invalid array access and
adapting to the current kernel TASK_STATE, and leave the
preempted task handling for later follow-up.

[..]
>> @@ -897,9 +898,10 @@ static int thread_atoms_insert(struct perf_sched
*sched, struct thread *thread)
>> + return bit < sizeof(str) - 1 ? str[bit] : '?';
>
> You'd better use ARRAY_SIZE(str) instead of sizeof() for array here.

OK, will change this to use ARRAY_SIZE on the next update.

Thanks,
Tomoki Sekiyama

\
 
 \ /
  Last update: 2016-07-29 06:43    [W:0.055 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site