Question about CFQ queue preemption with REQ_PRIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

First of all, I am a big fan of the CFQ I/O scheduler. Thank you for your contribution. :-)
I have a question about the below CFQ queue preemption condition in cfq_should_preempt().

        /*
         * So both queues are sync. Let the new request get disk time if
         * it's a metadata request and the current queue is doing regular IO.
         */
        if ((rq->cmd_flags & REQ_PRIO) && !cfqq->prio_pending)
                return true;

Normally, REQ_PRIO flag is used for READ requests for reading metadata, so then, the CFQ
queue containing "rq" must be a SYNC queue and cfqq is also a SYNC queue because we
already passed through the below condition. Therefore, the comment "So both queues are sync"
is TRUE.

        if (rq_is_sync(rq) && !cfq_cfqq_sync(cfqq))
                return true;

But, I am wordering about the case of that an asynchronous WRITE request with REQ_PRIO
is inserted into the request queue. Actually, ext4 metadata are submitted as asynchronous
WRITE requests with REQ_PRIO by kworker. In this case, asynchronous WRITE requests can
preempt synchronous READ requests. Anyways, I think ext4 metadata write should have
priority for better filesystem call responsiveness, but the comment in the source code,
"So both queues are sync", makes me a little confused.

Could you explain about the meaning of the comment in the source code?

Best Regards,

��.n��������+%������w��{.n�����{����n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux