* Question about request queues in I/O scheduling
@ 2016-04-24 18:42 Max Kanushin
2016-04-29 15:31 ` Jeff Moyer
0 siblings, 1 reply; 4+ messages in thread
From: Max Kanushin @ 2016-04-24 18:42 UTC (permalink / raw)
To: linux-kernel
Hello,
I was searching for a way to find out the length of a request_queue
(that is defined as a structure in linux/include/linux/blkdev.h).
However I am new to the kernel development and can't figure out where is
the actual list of requests to be processed by an elevator.
Is there a way to iterate requests in a queue or at least find a number
of them?
Please make a personal CC for me. I will really appreciate your help.
Best regards
Max Kanushin.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about request queues in I/O scheduling
2016-04-24 18:42 Question about request queues in I/O scheduling Max Kanushin
@ 2016-04-29 15:31 ` Jeff Moyer
[not found] ` <CAL+kshPDB8j3j7Gp4Zm5WK3W8HbO2pm3SQcB28p0LMF3KtdOBQ@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Moyer @ 2016-04-29 15:31 UTC (permalink / raw)
To: Max Kanushin; +Cc: linux-kernel
Max Kanushin <rextuz@gmail.com> writes:
> Hello,
>
> I was searching for a way to find out the length of a request_queue
> (that is defined as a structure in
> linux/include/linux/blkdev.h). However I am new to the kernel
> development and can't figure out where is the actual list of requests
> to be processed by an elevator.
> Is there a way to iterate requests in a queue or at least find a
> number of them?
Hi, Max,
What exactly are you trying to accomplish?
Cheers,
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about request queues in I/O scheduling
[not found] ` <CAL+kshPDB8j3j7Gp4Zm5WK3W8HbO2pm3SQcB28p0LMF3KtdOBQ@mail.gmail.com>
@ 2016-04-29 16:22 ` Jeff Moyer
2016-05-12 5:33 ` Max Kanushin
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Moyer @ 2016-04-29 16:22 UTC (permalink / raw)
To: Max Kanushin; +Cc: linux-kernel
Max Kanushin <rextuz@gmail.com> writes:
> Thank you very much for the reply. My general idea is take control of all
> request queues to block and unblock them manually depending on their load.
> One of my steps is to find a length of a queue to decide if to block it.
> Actually I think I've found the way. If I got it right, I can move from one
> request to another within the list:
> struct list_head queue_head;
> So that I can calculate how many requests are there in the queue.
Hi, Max,
The queue_head is the dispatch list for I/O, so it does not represent
all I/O queued for a request_queue. The number of requests in the
scheduler would be reflected by q->nr_sorted. The number of dispatched
requests is in an array, in_flight.
Cheers,
Jeff
>
> Best regards,
> Max Kanushin.
> On Apr 29, 2016 6:32 PM, "Jeff Moyer" <jmoyer@redhat.com> wrote:
>
>> Max Kanushin <rextuz@gmail.com> writes:
>>
>> > Hello,
>> >
>> > I was searching for a way to find out the length of a request_queue
>> > (that is defined as a structure in
>> > linux/include/linux/blkdev.h). However I am new to the kernel
>> > development and can't figure out where is the actual list of requests
>> > to be processed by an elevator.
>> > Is there a way to iterate requests in a queue or at least find a
>> > number of them?
>>
>> Hi, Max,
>>
>> What exactly are you trying to accomplish?
>>
>> Cheers,
>> Jeff
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Question about request queues in I/O scheduling
2016-04-29 16:22 ` Jeff Moyer
@ 2016-05-12 5:33 ` Max Kanushin
0 siblings, 0 replies; 4+ messages in thread
From: Max Kanushin @ 2016-05-12 5:33 UTC (permalink / raw)
To: linux-kernel; +Cc: jmoyer
Hello,
I was trying to use spin_trylock(q->queue_lock) on several queues when
q->nr_sorted exceeds the per-defined number to block them and unlock the
them later with spin_unlock(q->queue_lock), but I have faced the
following problem: my system freezes when I am trying to test it by
moving files around in my system. I thought it might be caused by
blocking a queue of a system partition or swap, but I do not know how to
check this as well.
Is it the right way to stop the queue/elevator? What are freezes might
be caused by? Is there a simple way to find out which block device is a
queue belong to?
I would really appreciate your reply.
Best regards,
Max Kanushin.
On 04/29/2016 07:22 PM, Jeff Moyer wrote:
> Max Kanushin <rextuz@gmail.com> writes:
>
>> Thank you very much for the reply. My general idea is take control of all
>> request queues to block and unblock them manually depending on their load.
>> One of my steps is to find a length of a queue to decide if to block it.
>> Actually I think I've found the way. If I got it right, I can move from one
>> request to another within the list:
>> struct list_head queue_head;
>> So that I can calculate how many requests are there in the queue.
>
> Hi, Max,
>
> The queue_head is the dispatch list for I/O, so it does not represent
> all I/O queued for a request_queue. The number of requests in the
> scheduler would be reflected by q->nr_sorted. The number of dispatched
> requests is in an array, in_flight.
>
> Cheers,
> Jeff
>
>
>
>>
>> Best regards,
>> Max Kanushin.
>> On Apr 29, 2016 6:32 PM, "Jeff Moyer" <jmoyer@redhat.com> wrote:
>>
>>> Max Kanushin <rextuz@gmail.com> writes:
>>>
>>>> Hello,
>>>>
>>>> I was searching for a way to find out the length of a request_queue
>>>> (that is defined as a structure in
>>>> linux/include/linux/blkdev.h). However I am new to the kernel
>>>> development and can't figure out where is the actual list of requests
>>>> to be processed by an elevator.
>>>> Is there a way to iterate requests in a queue or at least find a
>>>> number of them?
>>>
>>> Hi, Max,
>>>
>>> What exactly are you trying to accomplish?
>>>
>>> Cheers,
>>> Jeff
>>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-12 5:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-24 18:42 Question about request queues in I/O scheduling Max Kanushin
2016-04-29 15:31 ` Jeff Moyer
[not found] ` <CAL+kshPDB8j3j7Gp4Zm5WK3W8HbO2pm3SQcB28p0LMF3KtdOBQ@mail.gmail.com>
2016-04-29 16:22 ` Jeff Moyer
2016-05-12 5:33 ` Max Kanushin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox