Re: [PATCH] Fix array overflow in CFQ

Andi Kleen
2010-10-19T13:23:27Z

> 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?
> 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.

-Andi