Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933615AbbHLI5A (ORCPT ); Wed, 12 Aug 2015 04:57:00 -0400 Received: from mga09.intel.com ([134.134.136.24]:60694 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753425AbbHLI4Y (ORCPT ); Wed, 12 Aug 2015 04:56:24 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,659,1432623600"; d="scan'208";a="782547047" Date: Wed, 12 Aug 2015 09:05:48 +0800 From: Yuyang Du To: byungchul.park@lge.com Cc: mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] sched: sync with the prev cfs when changing cgroup within a cpu Message-ID: <20150812010548.GA28764@intel.com> References: <1439363115-2259-1-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1439363115-2259-1-git-send-email-byungchul.park@lge.com> 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 Content-Length: 1196 Lines: 33 On Wed, Aug 12, 2015 at 04:05:15PM +0900, byungchul.park@lge.com wrote: > > current code seems to be wrong with cfs_rq's avg loads when changing > a task's cgroup(=cfs_rq) to another. i tested with "echo pid > cgroup" and > found that e.g. cfs_rq->avg.load_avg became larger and larger whenever i > changed a cgroup to another again and again. > > we have to sync se's average load with both *prev* cfs_rq and next cfs_rq > when changing its group. > I think you are right in general, it has nothing to do with migrate_task_rq_fair() and the load should be carried to new cfs_rq. But whether it is queued or not should be doing the same thing, so what about: /* if queued, the previous dequeue_task() should have already done it */ if (!queued) __upload_load_avg() remove_from_old_cfs_rq(); /* virtually catch up because of the skew between cfs_rqs */ task's last_update_time = cfs_rq's last_update_time; add_to_new_cfs_rq(); Thanks, Yuyang -- 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/