From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755200AbZEVGob (ORCPT ); Fri, 22 May 2009 02:44:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751375AbZEVGoX (ORCPT ); Fri, 22 May 2009 02:44:23 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:55452 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751368AbZEVGoW (ORCPT ); Fri, 22 May 2009 02:44:22 -0400 Message-ID: <4A164978.1020604@cn.fujitsu.com> Date: Fri, 22 May 2009 14:43:04 +0800 From: Gui Jianfeng User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: Vivek Goyal CC: nauman@google.com, dpshah@google.com, lizf@cn.fujitsu.com, mikew@google.com, fchecconi@gmail.com, paolo.valente@unimore.it, jens.axboe@oracle.com, ryov@valinux.co.jp, fernando@oss.ntt.co.jp, s-uchida@ap.jp.nec.com, taka@valinux.co.jp, jmoyer@redhat.com, dhaval@linux.vnet.ibm.com, balbir@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org, righi.andrea@gmail.com, agk@redhat.com, dm-devel@redhat.com, snitzer@redhat.com, m-ikeda@ds.jp.nec.com, akpm@linux-foundation.org Subject: Re: [PATCH 02/18] io-controller: Common flat fair queuing code in elevaotor layer References: <1241553525-28095-1-git-send-email-vgoyal@redhat.com> <1241553525-28095-3-git-send-email-vgoyal@redhat.com> In-Reply-To: <1241553525-28095-3-git-send-email-vgoyal@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vivek Goyal wrote: ... > +/* A request got completed from io_queue. Do the accounting. */ > +void elv_ioq_completed_request(struct request_queue *q, struct request *rq) > +{ > + const int sync = rq_is_sync(rq); > + struct io_queue *ioq = rq->ioq; > + struct elv_fq_data *efqd = &q->elevator->efqd; > + > + if (!elv_iosched_fair_queuing_enabled(q->elevator)) > + return; > + > + elv_log_ioq(efqd, ioq, "complete"); > + > + elv_update_hw_tag(efqd); > + > + WARN_ON(!efqd->rq_in_driver); > + WARN_ON(!ioq->dispatched); > + efqd->rq_in_driver--; > + ioq->dispatched--; > + > + if (sync) > + ioq->last_end_request = jiffies; > + > + /* > + * If this is the active queue, check if it needs to be expired, > + * or if we want to idle in case it has no pending requests. > + */ > + > + if (elv_active_ioq(q->elevator) == ioq) { > + if (elv_ioq_slice_new(ioq)) { > + elv_ioq_set_prio_slice(q, ioq); Hi Vivek, Would you explain a bit why slice_end should be set when first request completes. Why not set it just when an ioq gets active? Thanks. Gui Jianfeng