From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751320AbcFFJ6q (ORCPT ); Mon, 6 Jun 2016 05:58:46 -0400 Received: from merlin.infradead.org ([205.233.59.134]:54278 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbcFFJ6p (ORCPT ); Mon, 6 Jun 2016 05:58:45 -0400 Date: Mon, 6 Jun 2016 11:58:40 +0200 From: Peter Zijlstra To: Yuyang Du Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, bsegall@google.com, pjt@google.com, morten.rasmussen@arm.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com Subject: Re: [PATCH v4 3/5] sched/fair: Skip detach sched avgs for new task when changing task groups Message-ID: <20160606095840.GB30909@twins.programming.kicks-ass.net> References: <1465172441-27727-1-git-send-email-yuyang.du@intel.com> <1465172441-27727-4-git-send-email-yuyang.du@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1465172441-27727-4-git-send-email-yuyang.du@intel.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 06, 2016 at 08:20:39AM +0800, Yuyang Du wrote: > +static void task_move_group_fair(struct task_struct *p, bool fork) > { > - detach_task_cfs_rq(p); > + /* > + * Newly forked task should not be removed from any cfs_rq That's a pointless comment; that's exactly what the code _does_. Comments should explain the code, not restate it. So a comment like: * Newly forked tasks are not attached yet. Is entirely more useful. > + */ > + if (!fork) > + detach_task_cfs_rq(p); > set_task_rq(p, task_cpu(p)); > attach_task_cfs_rq(p); > /*