Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp222351pxk; Wed, 16 Sep 2020 02:43:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwYESg4s+V/9oeLI7rbEJwFEnXdvDpUDhsSEFIRqRnBjwHQAXKD0qw9Ix6T19QRDaNEz1S X-Received: by 2002:a17:906:c113:: with SMTP id do19mr23849179ejc.219.1600249400005; Wed, 16 Sep 2020 02:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600249399; cv=none; d=google.com; s=arc-20160816; b=AjSx+wWVk7x4V0Ti/XFe5osByWnTqPHAjrzQgKtHUf3eahrp25raBUpCJYvTKab6J0 3oO5FaCjHE2WqdZ6dNc1IKuIb6Ra2XNTHjZ2F3q2HPmGciEbFFdyHIH+2y9j7A9QGw1/ pB2e4D5NH6ZbW7vFJrZHkxsny5/YEVDx+ZVw5a/ayyD90/L5WYlTfJ1UWmbwa0WmyLN2 +S90M65t0Izo3CiJF0uSbO7VvpdaAI6hyJZRRDADO/k4d3h3E4Dn+Wj4tc4n3xhy1lR9 B16JbLuEZprOfMcdw0YQcL0TLkCIWXrJw79Rrcs/aKD92Gij8rbYQcVi/M6za3WdkXgC +OcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gMIUkN39zioLKdRgfk5ZGYhuC2sGPoh7d3vjz5ISfiA=; b=mzBnfaOGR6JtWG8bsUBBIFW6IT8BPPvWrjOF2/t1Bwzc1O9EIpAjyIt9dXlqSTux56 5Db2TTuybJTIicX3MxaI+6PRDpDKaH5I5dPkStR4vh0pxEolIKD6jyD0pjXiLOn0bQBP abe4YdMSuGDRJDyWIgezQJnxez1Im8htNwcAlCklnJbnrNHdw6QeNx24rAnKgNMmoNlh qN/NL0rZ2DufQFQPI/+cDuzj/pr87mYBHpR0uAAIvKBpxZvKD5ie4+c4dknQy77mO0fB isCK9ZDAsHors7/0L1MTzmOEZfFdfZzdnbRplV8CGdNWPDPOmu9oudjNTPTrUXzw0ilY jM7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fmvJV98S; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si11377188ejv.383.2020.09.16.02.42.56; Wed, 16 Sep 2020 02:43:19 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=fmvJV98S; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726710AbgIPJmQ (ORCPT + 99 others); Wed, 16 Sep 2020 05:42:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58673 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726302AbgIPJmM (ORCPT ); Wed, 16 Sep 2020 05:42:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600249331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gMIUkN39zioLKdRgfk5ZGYhuC2sGPoh7d3vjz5ISfiA=; b=fmvJV98SAI0Wl9n4Iannh+wk15fSoT43V3wHcSRUljVHGq2qOqdRD27FKTdgvCW/qK8UhI MW5Ml7Vb3XTgQs66b00WFzvmWIGkMKfhR2s3bDFlXLQjcrguHmDkjD2q7S1mCGG16Go7Or 5cVVdbwoFm8aNSDxtBpE+HqFc0G3tPk= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-696C7VKSPK6y7rofg20uaw-1; Wed, 16 Sep 2020 05:42:08 -0400 X-MC-Unique: 696C7VKSPK6y7rofg20uaw-1 Received: by mail-wm1-f69.google.com with SMTP id m25so817706wmi.0 for ; Wed, 16 Sep 2020 02:42:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gMIUkN39zioLKdRgfk5ZGYhuC2sGPoh7d3vjz5ISfiA=; b=f6AzrmNxUmjCx3hmpIoVbXxfcWk3n/pSCU1zyqEzWUP36rgdLvfNg1iyEU9JtzTQxP /21JkzntqduXuftIme3ZtyCghUPyQXHY+/JPWSsluDk6Go9NDplATsA7xiw5HcFJ8mil w+IQOdDt6KdS5F0wfyKfAbqab18DNfYM+uZTg3A0b40vzVRH/y9Tnn5F8gisuPUcWFLo JM0D80pmqG+Ji3UUGztH2LeNdyx4gmbmlZusQr1EuFKuOb9FkMSNZAX7MNraqYojwmeB UIxLBuRQqQnJrHqm5ASkpgYiI1NOlClG8ey8ZDIYHwTUorP303BZRwmZvYrTXiSVQl6n xpMA== X-Gm-Message-State: AOAM532NVEW9DZx+h9041umGFAAeSbpnvvsyi9JNlZQTNZr0w+DOMXeS MQAJkgX36LhVHH7RgjJOhFvKUbzWVyWdamJWxSVyRmsGMcs8c0va6U5Ir0g0Wu8ZwqwsEUOzE89 Zj2P+2QZGeyjvKqQmxKK6A/Kt X-Received: by 2002:a5d:4cc1:: with SMTP id c1mr25717095wrt.122.1600249326348; Wed, 16 Sep 2020 02:42:06 -0700 (PDT) X-Received: by 2002:a5d:4cc1:: with SMTP id c1mr25717069wrt.122.1600249326052; Wed, 16 Sep 2020 02:42:06 -0700 (PDT) Received: from localhost.localdomain ([151.29.43.50]) by smtp.gmail.com with ESMTPSA id l16sm35646630wrb.70.2020.09.16.02.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 02:42:05 -0700 (PDT) Date: Wed, 16 Sep 2020 11:42:03 +0200 From: Juri Lelli To: Peng Liu Cc: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, valentin.schneider@arm.com, raistlin@linux.it, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/deadline: Fix sched_dl_global_validate() Message-ID: <20200916094203.GA6652@localhost.localdomain> References: <20200915152048.GA25835@iZj6chx1xj0e0buvshuecpZ> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200915152048.GA25835@iZj6chx1xj0e0buvshuecpZ> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 15/09/20 23:20, Peng Liu wrote: > When user changes sched_rt_{runtime, period}_us, then > > sched_rt_handler() > --> sched_dl_bandwidth_validate() > { > new_bw = global_rt_runtime()/global_rt_period(); > > for_each_possible_cpu(cpu) { > dl_b = dl_bw_of(cpu); > if (new_bw < dl_b->total_bw) > ret = -EBUSY; > } > } > > Under CONFIG_SMP, dl_bw is per root domain , but not per CPU, > dl_b->total_bw is the allocated bandwidth of the whole root domain. > we should compare dl_b->total_bw against cpus*new_bw, where 'cpus' > is the number of CPUs of the root domain. Hummm, I think you are right. Guess nobody played a lot with changing global values. :-/ > Also, below annotation(in kernel/sched/sched.h) implied implementation > only appeared in SCHED_DEADLINE v2[1], then deadline scheduler kept > evolving till got merged(v9), but the annotation remains unchanged, > meaningless and misleading, correct it. > > * With respect to SMP, the bandwidth is given on a per-CPU basis, > * meaning that: > * - dl_bw (< 100%) is the bandwidth of the system (group) on each CPU; > * - dl_total_bw array contains, in the i-eth element, the currently > * allocated bandwidth on the i-eth CPU. > > [1] https://lkml.org/lkml/2010/2/28/119 > > Signed-off-by: Peng Liu > --- > In fact, I'm not 100% sure that's a bug, since it's too 'obvious' and > not newly introduced code. > > Also, the introduced #ifdef...#endif pairs look ugly, I have no idea > how to eliminate them. Ideas and comments are welcome. Thanks. Can't we just use dl_bw_cpus() ? Thanks, Juri