Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3068652pxb; Tue, 19 Jan 2021 12:57:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYzazCpXVY3BQuKsAVkoS0u1+xCcfsMVfJ2lO54fPdX7YRMMhnVdFhCn7iMya05ndoasu1 X-Received: by 2002:a05:6402:4391:: with SMTP id o17mr4919523edc.196.1611089831762; Tue, 19 Jan 2021 12:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611089831; cv=none; d=google.com; s=arc-20160816; b=HbYIwsEa0XmJFZ6Sp4y6/xpSzkXCwan8/FyWRfggUszRGvbK4OeN82maKWmB2Lxr62 pw1nalYFU1n1nETIOkcDLbkAnmoz7EsFn2BfY+sEijw2TmTDDJe12T/MILFXYUxqj5k4 DWmhd1zs3xGPxi+4DOK+MN0dK1BsZNTQOGRpyDz6UJFSnIIQXPKu1MubQ0mApD2+8UUB husHmXt4osd3zsp5hjm/ar8XkBnXpUdheWYumKv3ZDSVBxZGECtXQ5HiF/FMGOmjuJ0/ 2uEPJgsEUGDV7PVpY+I5N79tuydcw/ygsQ50X5UVDyKWehIYwMbeJWXXC4JiONHcosLJ x2NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from; bh=bluQOe/seVk5VKOF/UGDCuLUzyVDI6+nUXHxQJxknOY=; b=mlqHB5GicJu/Ck3rPLJRL6mrfp27hgj++Wzk/KtJsoW6edSlHyNdAt3xbMjmJ2fuY3 ipTvhRKNiID9LUK59iqBJif0ho1tkM/zDcMWTMXhORKPZFInTi0BSaaFZ/SwTCL6sYsG AH4hrFHC6Me7zv+30lWH1KX64IGsR7BhioPp3cUijhCiD+GRa23ivzmEWqnYTjuxTH+6 HoTjf+2Ak4TcqidF+nqNuAmuJ8gGR03jgQll16/LI2nkLuHLWur4CHEgYu++NXE253Bf g+ngHEtPiJWx9aFLN9AS/vJ1+C112RyqbqXxf/j8rXNNAErwVdk3eCAEsqdprzEPvtE9 pUNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si6168927ejh.299.2021.01.19.12.56.48; Tue, 19 Jan 2021 12:57:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403960AbhASU4H (ORCPT + 99 others); Tue, 19 Jan 2021 15:56:07 -0500 Received: from foss.arm.com ([217.140.110.172]:50462 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391991AbhASUwD (ORCPT ); Tue, 19 Jan 2021 15:52:03 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 16C41D6E; Tue, 19 Jan 2021 12:51:12 -0800 (PST) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D24723F719; Tue, 19 Jan 2021 12:51:10 -0800 (PST) From: Valentin Schneider To: Dietmar Eggemann , Ingo Molnar , Peter Zijlstra , Juri Lelli , Daniel Bristot de Oliveira Cc: linux-kernel@vger.kernel.org, Vincent Guittot , Steven Rostedt , Quentin Perret Subject: Re: [PATCH] sched/deadline: Reduce rq lock contention in dl_add_task_root_domain() In-Reply-To: <20210119083542.19856-1-dietmar.eggemann@arm.com> References: <20210119083542.19856-1-dietmar.eggemann@arm.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Tue, 19 Jan 2021 20:51:06 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/01/21 09:35, Dietmar Eggemann wrote: > dl_add_task_root_domain() is called during sched domain rebuild: > > rebuild_sched_domains_locked() > partition_and_rebuild_sched_domains() > rebuild_root_domains() > for all top_cpuset descendants: > update_tasks_root_domain() > for all tasks of cpuset: > dl_add_task_root_domain() > > Change it so that only the task pi lock is taken to check if the task > has a SCHED_DEADLINE (DL) policy. In case that p is a DL task take the > rq lock as well to be able to safely de-reference root domain's DL > bandwidth structure. > A task's policy is stable under ->pi_lock, so LGTM. Reviewed-by: Valentin Schneider > Most of the tasks will have another policy (namely SCHED_NORMAL) and > can now bail without taking the rq lock. > > One thing to note here: Even in case that there aren't any DL user > tasks, a slow frequency switching system with cpufreq gov schedutil has > a DL task (sugov) per frequency domain running which participates in DL > bandwidth management. > > Reviewed-by: Quentin Perret > Signed-off-by: Dietmar Eggemann