From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vivek Goyal Subject: Re: [PATCH 14/24] cfq-iosched: convert cfq_group_slice() to use cfqg->vfraction Date: Tue, 8 Jan 2013 11:42:26 -0500 Message-ID: <20130108164226.GE29635@redhat.com> References: <1356726946-26037-1-git-send-email-tj@kernel.org> <1356726946-26037-15-git-send-email-tj@kernel.org> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <1356726946-26037-15-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tejun Heo Cc: lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org, axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, ctalbott-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, rni-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org On Fri, Dec 28, 2012 at 12:35:36PM -0800, Tejun Heo wrote: > cfq_group_slice() calculates slice by taking a fraction of > cfq_target_latency according to the ratio of cfqg->weight against > service_tree->total_weight. This currently works only because all > cfqgs are treated to be at the same level. > > To prepare for proper hierarchy support, convert cfq_group_slice() to > base the calculation on cfqg->vfraction. As cfqg->vfraction is always > a fraction of 1 and represents the fraction allocated to the cfqg with > hierarchy considered, the slice can be simply calculated by > multiplying cfqg->vfraction to cfq_target_latency (with fixed point > shift factored in). > > As vfraction calculation currently treats all non-root cfqgs as > children of the root cfqg, this patch doesn't introduce noticeable > behavior difference. > > Signed-off-by: Tejun Heo Acked-by: Vivek Goyal Vivek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756643Ab3AHQmg (ORCPT ); Tue, 8 Jan 2013 11:42:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:25895 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756380Ab3AHQmf (ORCPT ); Tue, 8 Jan 2013 11:42:35 -0500 Date: Tue, 8 Jan 2013 11:42:26 -0500 From: Vivek Goyal To: Tejun Heo Cc: lizefan@huawei.com, axboe@kernel.dk, containers@lists.linux-foundation.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, ctalbott@google.com, rni@google.com Subject: Re: [PATCH 14/24] cfq-iosched: convert cfq_group_slice() to use cfqg->vfraction Message-ID: <20130108164226.GE29635@redhat.com> References: <1356726946-26037-1-git-send-email-tj@kernel.org> <1356726946-26037-15-git-send-email-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1356726946-26037-15-git-send-email-tj@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 28, 2012 at 12:35:36PM -0800, Tejun Heo wrote: > cfq_group_slice() calculates slice by taking a fraction of > cfq_target_latency according to the ratio of cfqg->weight against > service_tree->total_weight. This currently works only because all > cfqgs are treated to be at the same level. > > To prepare for proper hierarchy support, convert cfq_group_slice() to > base the calculation on cfqg->vfraction. As cfqg->vfraction is always > a fraction of 1 and represents the fraction allocated to the cfqg with > hierarchy considered, the slice can be simply calculated by > multiplying cfqg->vfraction to cfq_target_latency (with fixed point > shift factored in). > > As vfraction calculation currently treats all non-root cfqgs as > children of the root cfqg, this patch doesn't introduce noticeable > behavior difference. > > Signed-off-by: Tejun Heo Acked-by: Vivek Goyal Vivek