Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp998669imu; Fri, 7 Dec 2018 12:21:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/XxhnkBCZMldIrnyqCAl3FFsyIeR7oFkOlfr7CnlkbV2Aeym7f6/MjEsSbl/KdUrYSLhYCL X-Received: by 2002:a62:81c1:: with SMTP id t184mr3730319pfd.40.1544214115643; Fri, 07 Dec 2018 12:21:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544214115; cv=none; d=google.com; s=arc-20160816; b=EZxKyVcmPvT6QkOa30FyQ8VDS3slKi341LMHwZ9hJgXeiMrjEqhH1ujS5ryDrbz8ty S/LTw97dcX09upc5o575XQaAgLgTkyOForqracJ8bL+8r3QUpfZnEY0T6AKKPCfrmcmp WC1+3U2DYlOSeVBcl5aICLnBdXSX26oH1K9nwE15M9u0Q7PxRdZxkBUA2EMR+jNLqDaL 4s4srpx4tNKdFLJnH8xqgq5UWWumUq7INZYrARZyeDbB56/z5UwAizOaVySGFRzBudth nToWMnKKhLUTlKZ2OzJqGd4W6yzFreyoOlCPM+J1P/aBRR204xkwUFFkMWEoM1B5jjBB X5Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YOWvqr+xmnQNeRdg/hMVcViGsdBnf4xLNEjRsRSDPsM=; b=yrGvxT32Qj2UjuF/qGUL9pVZMs9KgcLYkMLi3/280xfXckEVpn8Io5CE4ck8CFHCv+ COvIVCXs+n5MHzGcbFgxhJTCd66oEhNLl7DOW8LAN7gNPrUO5AgsrQyOH0fuNxKG9bW7 yvl/qWw5qEthP+tCrxfcS/rvsl8zC0J8zNJxsttYCgeFcDRttx5Cmq1uOQYE2/xxQslu 9kN2TCJiC3g2RostbmQhc+xpJkMdzyECgBOt9To7+2UocOpZJ3SiEC3OvFQJyfeBtt5V tpUfARXh36wUC0pQMbZAVKn6hF59pzWwkuJ+hJS9CEc7XC92Aj/s1N+mEKXwE2OeJTN/ 0jDQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si3567730pgc.85.2018.12.07.12.21.39; Fri, 07 Dec 2018 12:21:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726156AbeLGUU5 (ORCPT + 99 others); Fri, 7 Dec 2018 15:20:57 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:53736 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726078AbeLGUU5 (ORCPT ); Fri, 7 Dec 2018 15:20:57 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B743C15AB; Fri, 7 Dec 2018 12:20:56 -0800 (PST) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5A2F43F614; Fri, 7 Dec 2018 12:20:54 -0800 (PST) Subject: Re: [PATCH v4 04/10] sched/fair: Dynamically update cfs_overload_cpus To: Steve Sistare , mingo@redhat.com, peterz@infradead.org Cc: subhra.mazumdar@oracle.com, dhaval.giani@oracle.com, daniel.m.jordan@oracle.com, pavel.tatashin@microsoft.com, matt@codeblueprint.co.uk, umgwanakikbuti@gmail.com, riel@redhat.com, jbacik@fb.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, quentin.perret@arm.com, linux-kernel@vger.kernel.org References: <1544131696-2888-1-git-send-email-steven.sistare@oracle.com> <1544131696-2888-5-git-send-email-steven.sistare@oracle.com> From: Valentin Schneider Message-ID: <3ec57357-dc4e-be1b-963f-abcf760ecc5a@arm.com> Date: Fri, 7 Dec 2018 20:20:52 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1544131696-2888-5-git-send-email-steven.sistare@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve, On 06/12/2018 21:28, Steve Sistare wrote: [...] > @@ -3724,6 +3725,28 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) > rq->misfit_task_load = task_h_load(p); > } > > +static void overload_clear(struct rq *rq) Nitpicky nit: cfs_overload_{clear, set} might be a bit better, just to explicitly differentiate this from rq->rd->overload. Although I suppose the naming problem will show up again if/when you try to expand this to other classes... > +{ > + struct sparsemask *overload_cpus; > + > + rcu_read_lock(); > + overload_cpus = rcu_dereference(rq->cfs_overload_cpus); > + if (overload_cpus) > + sparsemask_clear_elem(overload_cpus, rq->cpu); > + rcu_read_unlock(); > +} > + > +static void overload_set(struct rq *rq) > +{ > + struct sparsemask *overload_cpus; > + > + rcu_read_lock(); > + overload_cpus = rcu_dereference(rq->cfs_overload_cpus); > + if (overload_cpus) > + sparsemask_set_elem(overload_cpus, rq->cpu); > + rcu_read_unlock(); > +} > + > #else /* CONFIG_SMP */ > > #define UPDATE_TG 0x0 [...] > @@ -4468,8 +4495,12 @@ static void throttle_cfs_rq(struct cfs_rq *cfs_rq) > dequeue = 0; > } > > - if (!se) > + if (!se) { > sub_nr_running(rq, task_delta); > + if (prev_nr >= 2 && prev_nr - task_delta < 2) > + overload_clear(rq); > + > + } Eventually it'd be nice to squash those into {add, sub}_nr_running(), but you already mentioned wanting to stick to CFS for now, so I don't think it's *too* much of a big deal. > > cfs_rq->throttled = 1; > cfs_rq->throttled_clock = rq_clock(rq); > @@ -4499,6 +4530,7 @@ static void throttle_cfs_rq(struct cfs_rq *cfs_rq) [...]