lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 6 Sep 2011 09:03:34 +0800
From:	Shaohua Li <shli@...nel.org>
To:	Maxim Patlasov <maxim.patlasov@...il.com>
Cc:	axboe@...nel.dk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] CFQ: fix handling 'deep' cfqq

2011/8/31 Maxim Patlasov <maxim.patlasov@...il.com>:
> Shaohua,
>
> Sorry for not getting back to you for long. See please inline comments below.
>
>> but the cfq_disk_looks_slow isn't updated if the queue doesn't have 4 requests
>> or doesn't dispatch > 4 requests, so you always have CFQD_DISK_LOOKS_FAST()
>> return true if the first slice gets it to true. And if the queue does
>> dispatch > 4 requests in one jiffy, only cfq_disk_looks_fast is updated,
>> CFQD_DISK_LOOKS_FAST returns true too. I don't understand when
>> CFQD_DISK_LOOKS_FAST can be false.
>
> The patch essentially gathers events when cfqq experiences deep queue
> early and dispatches 4 requests in one dispatch round. As soon as such
> an event detected, we're drop inside outer 'if' clause:
>
>> +     if (cfq_cfqq_deep_early(cfqq) && cfqq->n_dispatched >= CFQQ_DEEP_THR) {
>> +             if (cfqq->first_dispatch == jiffies)
>> +                     cfqd->cfq_disk_looks_fast++;
>> +             else
>> +                     cfqd->cfq_disk_looks_slow++;
>> +
>> +             cfqq->first_dispatch = 0;
>> +             cfqq->n_dispatched = 0;
>> +             cfq_clear_cfqq_deep_early(cfqq);
>> +             cfqd->cfq_disk_last_updated = jiffies;
>> +     }
>
> and either increment disk_looks_fast or disk_looks_slow.
>
> If the queue doesn't have 4 requests, cfqq is not 'deep' - no events
> to gather. Neither disk_looks_fast nor disk_looks_slow is updated.
>
> If the queue doesn't dispatch 4 requests in a raw, the event will be
> discarded, and again, neither disk_looks_fast nor disk_looks_slow is
> updated.
>
> If the queue does dispatch > 4 requests in one jiffy, only
> cfq_disk_looks_fast is updated - that's right. But if the queue
> dispatches first 4 requests in *more* than one jiffy,
> cfq_disk_looks_slow is updated.
So the case is in first round, the queue dispatch > 4 requests in one jiffy,
looks_fast gets updated. Later, if the queue always only dispatch < 4 requests
or has < 4 requests queued, no looks_fast/looks_slow gets updated till
10*HZ later.
CFQD_DISK_LOOKS_FAST() always returns true in the period. is this sane?

Thanks,
Shaohua
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ