From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35CC9C433E0 for ; Thu, 25 Jun 2020 13:36:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03CD920672 for ; Thu, 25 Jun 2020 13:36:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qG407lUi"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iJbeT6WW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03CD920672 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jCp08hHqIwmI9p7FNk4Tju3XBHDaBuWyW22bzblJOvI=; b=qG407lUip6xZHxMgqZ+IlvbfV ld6lR2drEUDFA7OtjRF5p7NYX8BvNuXDTlT43oj2jxREdVyKHYlqZieGMKMZQeBKU4qegO4XGDvhJ Boc7K3WDhRpA3sjaNt5e16dPqgmBj6MMXXnjKimm56bme9LZHihMuEXQuJXSgJ0UeYk/t07wWvuIp w8227cYl+7i2JzJgTGS/w9H2NrCQ3oJWygftM8GtHX6gkNiS+wde7jOCMeMpAGbOOSXxvuI77Xi6X ExF1kmXdSydBX3MOin9r+qrQQ1vaKBWMoHeKmRM6IOvoRK7InjUms/eD+NtL7QgFhy65K+AYUWHG9 l872PPQfg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joS1n-0003F1-0W; Thu, 25 Jun 2020 13:34:55 +0000 Received: from us-smtp-1.mimecast.com ([205.139.110.61] helo=us-smtp-delivery-1.mimecast.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1joS1j-0003E9-Rr for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2020 13:34:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593092090; 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=09+fTYNd95SDGGKDwt8BrhJmqNTFAjuqhVxVc40SVsI=; b=iJbeT6WWkKWKFFYA6natZ1eM9RMwR3NV3g7KbinmEnMUHEFkTmy+N4vBZJWVIAQn6mI2cX WPsXkV/dzgs0rX3RkjdA1Ukjeh7G7EJqaplKJyaScJNLtZd5gIHZxVy7vvSKDNtxmHLL+u HWXFaZ2tO9joZSMoqCWQ3LR0EmF9SDE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-QEFGisLENvWklcWqJw2xPA-1; Thu, 25 Jun 2020 09:34:47 -0400 X-MC-Unique: QEFGisLENvWklcWqJw2xPA-1 Received: by mail-wr1-f71.google.com with SMTP id i12so6804359wrx.11 for ; Thu, 25 Jun 2020 06:34:47 -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=09+fTYNd95SDGGKDwt8BrhJmqNTFAjuqhVxVc40SVsI=; b=s6CzO4Gwml6TpnsWYcAWmkmU8bZgDoo4OftCRqDqoBNDxft0cCj8PXMwy9v/3sTmvm BoFNXwFr7P7QGyeQCTF1biE2caNOhahg0p8BMFUwxvQh9jGuB2Dn1FhtmFFysioUPSte /sV2eC7hzWEf65CNMd0gPeMfMzKEkhoycrRyyyoI1vMOvPqiEM6CP/qNFYQ/dKJp8N5S dfZqKFR6udf9h4QleUFLtXsWQZVXwSGcmMkIfRmP+ws7JAN8L9XJUcQ3Shl1MPfHrbMN IyqJ+tF3HPAe8L3IRVUlrGdnFPR/txL94hQRzgsBw9Vpj6+YB5DQ3RbXRar4+oNcvL5g EaTw== X-Gm-Message-State: AOAM5329ykEaxafnMPDr/g30gCmI6y6RP9lRc2a//hVCCNZhtx1L6HY9 MLqOrhxO4x3QpnW4oKa8MYXb+5Jqbem3fAa4MPskjwZpEIj08H+Pachd+QqudF2ciqG0GQUjaNA TE1NUPBvIURkaFExyL79aXyZfLMm0MY1kOTs= X-Received: by 2002:a5d:4607:: with SMTP id t7mr29457179wrq.251.1593092086520; Thu, 25 Jun 2020 06:34:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVs80JYUKeuedepRXnHMw9aA0kaFHrIbJMxp3wkfoS+pI6CTS5+7LKDDYqfG3a6oNxXWhJqA== X-Received: by 2002:a5d:4607:: with SMTP id t7mr29457132wrq.251.1593092086206; Thu, 25 Jun 2020 06:34:46 -0700 (PDT) Received: from localhost.localdomain ([151.29.187.107]) by smtp.gmail.com with ESMTPSA id d28sm34118699wrc.50.2020.06.25.06.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 06:34:45 -0700 (PDT) Date: Thu, 25 Jun 2020 15:34:43 +0200 From: Juri Lelli To: Sai Harshini Nimmala Subject: Re: [PATCH] Revert "sched/deadline: Remove cpu_active_mask from cpudl_find()" Message-ID: <20200625133443.GJ5763@localhost.localdomain> References: <1593065595-17794-1-git-send-email-snimmala@codeaurora.org> MIME-Version: 1.0 In-Reply-To: <1593065595-17794-1-git-send-email-snimmala@codeaurora.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rgottimu@codeaurora.org, vincent.guittot@linaro.org, peterz@infradead.org, linux-arm-msm@vger.kernel.org, adharmap@codeaurora.org, Puja Gupta , linux-kernel@vger.kernel.org, rostedt@goodmis.org, linux-arm-msm-owner@vger.kernel.org, bsegall@google.com, dickey@codeaurora.org, mingo@redhat.com, mgorman@suse.de, shalagra@codeaurora.org, satyap@codeaurora.org, clingutla@codeaurora.org, aiquny@codeaurora.org, pkondeti@codeaurora.org, dietmar.eggemann@arm.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On 24/06/20 23:13, Sai Harshini Nimmala wrote: > The original commit 9659e1ee removes checking the cpu_active_mask > while finding the best cpu to place a deadline task, citing the reason that > this mask rarely changes and removing the check will give performance > gains. > However, on hotplugging, the cpu dying path has a brief duration between > the CPUHP_TEARDOWN_CPU and CPUHP_AP_SCHED_STARTING hotplug states where > the DL task can be scheduled on this cpu because the corresponding cpu > bit in cpu->free_cpus has not been cleared yet. Without the > cpu_active_mask check we could end up putting a DL task on such cpus > leading to a BUG. > The cpu_active_mask will be updated promptly before either of these > states and will provide a more accurate check for the use case above. > > Signed-off-by: Puja Gupta > Signed-off-by: Sai Harshini Nimmala > --- > kernel/sched/cpudeadline.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/cpudeadline.c b/kernel/sched/cpudeadline.c > index 5cc4012..0346837 100644 > --- a/kernel/sched/cpudeadline.c > +++ b/kernel/sched/cpudeadline.c > @@ -120,7 +120,8 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p, > const struct sched_dl_entity *dl_se = &p->dl; > > if (later_mask && > - cpumask_and(later_mask, cp->free_cpus, p->cpus_ptr)) { > + cpumask_and(later_mask, cp->free_cpus, p->cpus_ptr) && > + cpumask_and(later_mask, later_mask, cpu_active_mask)) { > return 1; > } else { > int best_cpu = cpudl_maximum(cp); So, I believe the patch you want to revert only removed the condition above. > @@ -128,6 +129,7 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p, > WARN_ON(best_cpu != -1 && !cpu_present(best_cpu)); > > if (cpumask_test_cpu(best_cpu, p->cpus_ptr) && > + cpumask_test_cpu(best_cpu, cpu_active_mask) && > dl_time_before(dl_se->deadline, cp->elements[0].dl)) { > if (later_mask) > cpumask_set_cpu(best_cpu, later_mask); Did you actually experience issues with this second part as well? I'm thinking the WARN_ON should have fired in that case, no? Thanks, Juri _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel