lkml.org 
[lkml]   [2015]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/8] cfq-iosched: fold cfq_find_alloc_queue() into cfq_get_queue()
Hey, Jeff.

On Tue, Jun 09, 2015 at 10:40:02AM -0400, Jeff Moyer wrote:
> The resulting code (introduced by the last patch, I know) is not ideal:
>
> rcu_read_lock();
> cfqg = cfq_lookup_create_cfqg(cfqd, bio_blkcg(bio));
> if (!cfqg) {
> cfqq = &cfqd->oom_cfqq;
> goto out;
> }
>
> if (!is_sync) {
> if (!ioprio_valid(cic->ioprio)) {
> struct task_struct *tsk = current;
> ioprio = task_nice_ioprio(tsk);
> ioprio_class = task_nice_ioclass(tsk);
> }
> async_cfqq = cfq_async_queue_prio(cfqd, ioprio_class,
> ioprio);
> cfqq = *async_cfqq;
> if (cfqq)
> goto out;
> }
>
> As you mentioned, we don't need to lookup the cfqg for the async queue.
> What's more is we could fallback to the oom_cfqq even if we had an
> existing async cfqq. I'm guessing you structured the code this way to
> make the error path cleaner. I don't think it's a big deal, as it
> should be a rare occurrence, so...

In this patch, the lookup seems unnecessary for the async case but the
change is required for the following changes because async queues are
moved from cfq_data to cfq_group, so we can't determine async queues
w/o looking up cfqg at all and we'll have to fall back to oom_cfqq if
cfqg lookup fails (cuz there's no system-wide async queues).

Thanks.

--
tejun


\
 
 \ /
  Last update: 2015-06-10 05:41    [W:0.108 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site