public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: Jens Axboe <axboe@kernel.dk>, Andi Kleen <andi@firstfloor.org>,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix array overflow in CFQ
Date: Tue, 19 Oct 2010 11:05:16 -0400	[thread overview]
Message-ID: <20101019150516.GE857@redhat.com> (raw)
In-Reply-To: <4CBD9BCA.2060200@linux.intel.com>

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[][].

Thanks
Vivek

  reply	other threads:[~2010-10-19 15:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19  9:10 [PATCH] Fix array overflow in CFQ Andi Kleen
2010-10-19 10:01 ` Jens Axboe
2010-10-19 11:49   ` Vivek Goyal
2010-10-19 11:55     ` Jens Axboe
2010-10-19 12:33     ` Vivek Goyal
2010-10-19 13:23       ` Andi Kleen
2010-10-19 15:05         ` Vivek Goyal [this message]
2010-10-21 16:53           ` Jeff Moyer
2010-10-21 17:16             ` Andi Kleen
2010-10-21 17:15               ` Jeff Moyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101019150516.GE857@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox