From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753320AbcD2QW4 (ORCPT ); Fri, 29 Apr 2016 12:22:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47660 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753160AbcD2QWz (ORCPT ); Fri, 29 Apr 2016 12:22:55 -0400 From: Jeff Moyer To: Max Kanushin Cc: linux-kernel@vger.kernel.org Subject: Re: Question about request queues in I/O scheduling References: <571D1390.6060204@gmail.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Fri, 29 Apr 2016 12:22:48 -0400 In-Reply-To: (Max Kanushin's message of "Fri, 29 Apr 2016 18:48:35 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Max Kanushin 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" wrote: > >> Max Kanushin 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 >>