Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp528013ybl; Thu, 12 Dec 2019 00:06:37 -0800 (PST) X-Google-Smtp-Source: APXvYqz0UIeskiSiniC216w7vsZUfczGViDjSq0PMGehRJp4QiJDnIz/7Y11Oz7cLDHwKECA7nXu X-Received: by 2002:a05:6830:10c6:: with SMTP id z6mr7117802oto.203.1576137997597; Thu, 12 Dec 2019 00:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576137997; cv=none; d=google.com; s=arc-20160816; b=s5Ubp9MvLrTbI9VEeiwRJzPdl4aaSGzClwSaGLt6q3h7BCb2JvgNGGXvOM/nu8lIJU XRHdXBLKlI5eayDww9VyhcqDEg9oI/kWXZuouW8RKBZirOWqOio0GettXi+FttlJUpbN dQD8EBt5wix6ND+HCS4SV0+GTG8tMw6H+OhoE7Xi+t0TllEZU9hWGilKDEnW73QNWUoE tNXtNPLRVaCcMPu2uvbCCXgR8JbCYjQHQypBp7PaTKBA3PiDj4yEItb6VIZ9U3BEckk6 F+SpQ25+sDI/Bx/c8OsxdzfsLNdo3Mhm5iBE1OtQVrE4IbdFQga48QD8xvO/fHCC99Lo qI6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=D5CdL72oAGFzvBY6QtxAW/opFYUrS0DCzRtDcLARPlM=; b=mB+la1WuYdwKFWgdlGcr0wV4UycodpGJKCfsywYzT3aUUv0Wtq8WQLwledn5o5zniq YSXgWe+1X76Rcea/4eMDY9+HrBpZsBJhDzgADwgmqAP2oa0wANf8BLcDK59tBQPNY6PT CH85VhQGeQbXpMBbqhZmt3mcOyknB0pQLgpaMnVZ8wI7FheuVHtGfGOio9Z5kG17lAaF y4syOO3ZR3Z0jKZ86L3ZelTh7Az6o+mcUy0xupo8gFrrvVeckAebIbi0XaMll//0Ap2J WGciBUgKl2XOhjMKWCvA0o3opYvFRnz66Z9CygYjwEQoiX2//zc4m8fnwx8Ko2oGfKK2 aWbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RQ1aCrQt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si2356082oth.94.2019.12.12.00.06.24; Thu, 12 Dec 2019 00:06:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RQ1aCrQt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728193AbfLLIFf (ORCPT + 99 others); Thu, 12 Dec 2019 03:05:35 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:33850 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728151AbfLLIFf (ORCPT ); Thu, 12 Dec 2019 03:05:35 -0500 Received: by mail-lj1-f196.google.com with SMTP id m6so1218435ljc.1 for ; Thu, 12 Dec 2019 00:05:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=D5CdL72oAGFzvBY6QtxAW/opFYUrS0DCzRtDcLARPlM=; b=RQ1aCrQt71scdxmVYOs2+irsGBO5mXSKza7aFK6gEHkMShYqAzp3Af4m8OgE7nr9do BJ4cxPCyx9FNdHcrgGZsI7CNzBwLEfhCtNnq3C6+MGvk3TuAlDcX4U7H5qHgjssSVGlv oaT8SX3p3JhPmB+dPkYoOIg+J/1mM936nKSLZqt0Y0owt6igrVdNc4x58M4DFS7ph3JZ St3jtX7Vh0Z/Z1ZffIHG1AUZem7ldcu+fkwlsSzSOWK8w9FneZEl78Mf2Pxx/MqZshe2 EXw1ZEE5bblU4EzHGmfpQjLtvLb792Ntlh/0wkS/48iYQWQdqUxnp97ZsmzmkX6bvEgg 4dBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=D5CdL72oAGFzvBY6QtxAW/opFYUrS0DCzRtDcLARPlM=; b=WoaNOXVNgSIrhiruxdUxdJlzmAB9LLusqCv7Edm0bOJYdsoDoTTiidVU6/JKL6IdEc /RchZBP2EFOf681gi94HzVGjAKeHHfxf1zKoq39NVzbXBpBSg5xs7fERE9h3ekcNdcog HUPqKjJ8ISKksf31uCwdzjHoRNaMRBCT1CCcpVHFKrQvF6dmVN2BOwNLPZL70qm53N6u Qvi+4mhSMm16VZlslvbFkX/CYgwirTkV6EzztrsxwYxcU/7qxehnTTThbBbzHP9sCcN0 syzh9U9fRgz7A73C+dxbekbfduWPoLj1gkvLyWneJMII7ukNuevFf3QV3kz8H9p05lQy nGlA== X-Gm-Message-State: APjAAAWIGB/VpEMZYdJ8JoDrzA/307MyiQozlygCW54QD4DuQbxFMht3 7mIMXM/pF0ctPFVbJ2gr+QutITiQTfPaBfSC9A3L6A== X-Received: by 2002:a2e:9a04:: with SMTP id o4mr5216093lji.214.1576137932881; Thu, 12 Dec 2019 00:05:32 -0800 (PST) MIME-Version: 1.0 References: <20191204200623.198897-1-joshdon@google.com> In-Reply-To: From: Vincent Guittot Date: Thu, 12 Dec 2019 09:05:21 +0100 Message-ID: Subject: Re: [PATCH v2] sched/fair: Do not set skip buddy up the sched hierarchy To: Josh Don , Ingo Molnar , Peter Zijlstra Cc: Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel , Paul Turner Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Josh, On Fri, 6 Dec 2019 at 23:13, Josh Don wrote: > > Hi Vincent, > > Thanks for taking a look. > > > There is a mismatch between the author Venkatesh Pallipadi and the > > signoff Josh Don > > If Venkatesh is the original author and you have then done some > > modifications, your both signed-off should be there > > Venkatesh no longer works at Google, so I don't have a way to get in > touch with him. Is my signed-off insufficient for this case? Maybe you can add a Co-developed-by tag to reflect your additional changes I guess that as long as you agree with the DCO, it's ok : https://www.kernel.org/doc/html/v5.4/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin Ingo, Peter, what do you think ? > > > On Thu, Dec 5, 2019 at 11:57 PM Vincent Guittot > wrote: > > > > Hi Josh, > > > > On Wed, 4 Dec 2019 at 21:06, Josh Don wrote: > > > > > > From: Venkatesh Pallipadi > > > > > > Setting skip buddy all the way up the hierarchy does not play well > > > with intra-cgroup yield. One typical usecase of yield is when a > > > thread in a cgroup wants to yield CPU to another thread within the > > > same cgroup. For such a case, setting the skip buddy all the way up > > > the hierarchy is counter-productive, as that results in CPU being > > > yielded to a task in some other cgroup. > > > > > > So, limit the skip effect only to the task requesting it. > > > > > > Signed-off-by: Josh Don > > > > There is a mismatch between the author Venkatesh Pallipadi and the > > signoff Josh Don > > If Venkatesh is the original author and you have then done some > > modifications, your both signed-off should be there > > > > Apart from that, the change makes sense to me > > > > > --- > > > v2: Only clear skip buddy on the current cfs_rq > > > > > > kernel/sched/fair.c | 18 +++++++++++------- > > > 1 file changed, 11 insertions(+), 7 deletions(-) > > > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > > index 08a233e97a01..0b7a1958ad52 100644 > > > --- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -4051,13 +4051,10 @@ static void __clear_buddies_next(struct sched_entity *se) > > > > > > static void __clear_buddies_skip(struct sched_entity *se) > > > { > > > - for_each_sched_entity(se) { > > > - struct cfs_rq *cfs_rq = cfs_rq_of(se); > > > - if (cfs_rq->skip != se) > > > - break; > > > + struct cfs_rq *cfs_rq = cfs_rq_of(se); > > > > > > + if (cfs_rq->skip == se) > > > cfs_rq->skip = NULL; > > > - } > > > } > > > > > > static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se) > > > @@ -6552,8 +6549,15 @@ static void set_next_buddy(struct sched_entity *se) > > > > > > static void set_skip_buddy(struct sched_entity *se) > > > { > > > - for_each_sched_entity(se) > > > - cfs_rq_of(se)->skip = se; > > > + /* > > > + * One typical usecase of yield is when a thread in a cgroup > > > + * wants to yield CPU to another thread within the same cgroup. > > > + * For such a case, setting the skip buddy all the way up the > > > + * hierarchy is counter-productive, as that results in CPU being > > > + * yielded to a task in some other cgroup. So, only set skip > > > + * for the task requesting it. > > > + */ > > > + cfs_rq_of(se)->skip = se; > > > } > > > > > > /* > > > -- > > > 2.24.0.393.g34dc348eaf-goog > > >