lkml.org 
[lkml]   [2010]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Fix array overflow in CFQ
Date
Vivek Goyal <vgoyal@redhat.com> writes:

> On Tue, Oct 19, 2010 at 03:23:22PM +0200, Andi Kleen wrote:
>>
>> > slice = group_slice * count /
>> > max_t(unsigned, cfqg->busy_queues_avg[cfqd->serving_prio],
>> > cfq_group_busy_queues_wl(cfqd->serving_prio, cfqd,
>> >cfqg));
>> >
>> >So for IDLE class, we return immediately from the function and never
>> >execute cfqg->busy_queues_avg[IDLE].
>>
>> Hmm that's true. But why do you put this into a global variable
>> anyways, can't it
>> just be a local?
>
> We keep track of average number of queues per group per prio class. So it
> can't be local as it historical data.
>
>> >Now to remove the gcc warning we can increase the size of busy_queues_avg[]
>> >array but third field should always remain unused.
>> >
>> It's better to increase the field still I think.
>
> Agreed.
>
> Jens, do you want me to regenerate your patch so that we increase the
> size of ->busy_queues_avg[CFQ_PRIO_NR] but not ->service_trees[][].

Just be sure to put a huge comment in there so you don't confuse the
poor masses trying to make sense of the code.

Cheers,
Jeff


\
 
 \ /
  Last update: 2010-10-21 18:59    [W:0.055 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site