Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759574Ab3DCBMQ (ORCPT ); Tue, 2 Apr 2013 21:12:16 -0400 Received: from mga14.intel.com ([143.182.124.37]:60839 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754449Ab3DCBMN (ORCPT ); Tue, 2 Apr 2013 21:12:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,396,1363158000"; d="scan'208";a="279942816" Message-ID: <515B81D6.6010006@intel.com> Date: Wed, 03 Apr 2013 09:11:50 +0800 From: Alex Shi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: Vincent Guittot CC: "mingo@redhat.com" , Peter Zijlstra , Thomas Gleixner , Andrew Morton , Arjan van de Ven , Borislav Petkov , Paul Turner , Namhyung Kim , Mike Galbraith , gregkh@linuxfoundation.org, Preeti U Murthy , Viresh Kumar , linux-kernel Subject: Re: [patch v6 10/21] sched: get rq potential maximum utilization References: <1364654108-16307-1-git-send-email-alex.shi@intel.com> <1364654108-16307-11-git-send-email-alex.shi@intel.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1330 Lines: 37 On 04/02/2013 10:38 PM, Vincent Guittot wrote: >> +static unsigned int max_rq_util(int cpu) >> > +{ >> > + struct rq *rq = cpu_rq(cpu); >> > + unsigned int rt_util = scale_rt_util(cpu); >> > + unsigned int cfs_util; >> > + unsigned int nr_running; >> > + >> > + cfs_util = (FULL_UTIL - rt_util) > rq->util ? rq->util >> > + : (FULL_UTIL - rt_util); > rt_util and rq->util don't use the same computation algorithm so the > results are hardly comparable or addable. In addition, some RT tasks > can have impacted the rq->util, so they will be accounted in both > side. Thanks Vincent! Yes, rt_util calculated with different way, but it has very similar meaning with rq->util. So compare them make sense. Yes, the rq->util and rt_util have some overlap, so we need to remove the overlap part, otherwise the total utlization of this cpu will beyond 100%. that's not make sense. And since RT task always has higher priority than cfs task, here I keep the RT utilization and yield the cfs utilization. > > Vincent > -- Thanks Alex -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/