Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4002492pxb; Mon, 8 Feb 2021 05:49:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoXXihFU06Upb/geK0728y5Gs+//OS0hNpFSwc1IvCxK6S8Q5l57h/9pMM7QnJuzbSFU9w X-Received: by 2002:a05:6402:7ce:: with SMTP id u14mr12753174edy.370.1612792139963; Mon, 08 Feb 2021 05:48:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612792139; cv=none; d=google.com; s=arc-20160816; b=OsUjN6jNvB6SHjioBdjo1g1p/FCxR2hJu/dQARF5gA/PW9JN3OQsl2B8VLR1Q61O8U NYYcuYiwyK8Gv/kNi+GU7bW74dPjlBIp35kI54wyk/TogDJoUqFRhVvIDHnMdPG+Ysq7 3IByNH3CKjk8pDhxQyjK2aJqrBF+6wni3He44139gkmEu3Pq1Yok+E9mIBLSszptax7U zjMqOqaIy/g5sj/ZMDWAtADT73/Iw78ZwcTiB6FTdULoM3OdNtLC/iBsMsZWBtWAQvNP 2XQfIgXbzt1Z16jfIQKQxXVEoViYBQ6m+p9/tnOibTe+vKT059VCR2C34GrD053xHunM 7gsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ujKmkzTGj+GO4qA+coEao+2xEy5/H8aiDMABhkJNmp4=; b=EDNGtwgCuxICG5g6ZUtyZpYkYK+B37cicRFLeTr3nZtTFZo5gKtUqkm83B0nIrl1NQ T6znFpWqkv+Wiq5p3eNLF5Y2TuQeXZS+CVHRN0fEEEt3j8GIxyB0MiB9ibMJvgBw+JVr t/7L/UTfM8vKjYOMSMcOYF5wsL+YVpYlBiUGXPUDUOQFM2zsGF4ghyp/5Snz0sd4+jpS cyw0yq24b7Gm+esw00DYMcgZwMHj8+dKc2NnZS6XvepbAWGfN+WiorrlCFW4fRBtW3ss cfLNlu7wzXUXU0epiId2+lDcfFvOM00Su1/z+CF+zi0/mtif24J/L6v8Ae11tGvxo1CQ 3ZrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=M9nx2Dhq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j26si9013295eds.297.2021.02.08.05.48.34; Mon, 08 Feb 2021 05:48:59 -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; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=M9nx2Dhq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230495AbhBHNru (ORCPT + 99 others); Mon, 8 Feb 2021 08:47:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbhBHNqV (ORCPT ); Mon, 8 Feb 2021 08:46:21 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8932C06121D for ; Mon, 8 Feb 2021 05:43:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ujKmkzTGj+GO4qA+coEao+2xEy5/H8aiDMABhkJNmp4=; b=M9nx2DhqblldW46zwomm3P9Zsn zAwnx1jw780kjmOwvoOWlhl0pKFNzWKKJG+VfHHgaCYHtHUQdpLoi2V2ciYz50DPTMSEW4D5X9jxU PaXVvrMPPBCjxrjyd6kSwJ+pYlPYa7ySFUuPdxF3jNmcgdKi+lz1oevHajbLtq6lymw1/tXI986sp baFa3P7KyaAXETHS4ZmcZ7uSf1PgcgfNutsIqRybDpiAGlR1HUlz8GL3bxCJtMYFSzKBjC3D/yr/+ XOu0r8hqalEsYETiPyy9hhV76e2bMitrO/8ccSGtn+bdanGEI58B8KjDzB6r5QmCV95JntQajiKN8 Uamu3clQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1l96p9-0000Bt-6S; Mon, 08 Feb 2021 13:43:31 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7379E3060AE; Mon, 8 Feb 2021 14:43:27 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 3880E20D8A019; Mon, 8 Feb 2021 14:43:27 +0100 (CET) Date: Mon, 8 Feb 2021 14:43:27 +0100 From: Peter Zijlstra To: Dietmar Eggemann Cc: Ingo Molnar , Juri Lelli , Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org, Vincent Guittot , Steven Rostedt , Quentin Perret , Valentin Schneider Subject: Re: [PATCH] sched/deadline: Reduce rq lock contention in dl_add_task_root_domain() Message-ID: References: <20210119083542.19856-1-dietmar.eggemann@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210119083542.19856-1-dietmar.eggemann@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 19, 2021 at 09:35:42AM +0100, 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. > > 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 Thanks!