Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp424889ybh; Wed, 11 Mar 2020 03:54:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuftkOzaxuJ4rpcggetWruKK9cdl8h2pBvP2mQeqU6oN6oqnAZLqCcM6e66i8kHoK9O6DTZ X-Received: by 2002:aca:5194:: with SMTP id f142mr1528735oib.100.1583924084344; Wed, 11 Mar 2020 03:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583924084; cv=none; d=google.com; s=arc-20160816; b=Hg+w+PYM5wXDjJUpKh1ogMJu9dcwpWD4tx7P5VeZPBi6fzCkYZjLTsCh5SCzEs4kqA NAkK+Glw+9DkvFaq0HdeZ68mCpbP9/2if89fZYWrPKZXSDsm8thvB5TK+E0RsTNHsSec l+YljZmgN7UCLal6rJ9GhGMMU+B4Lm80PG1ATz7bg8XnBXtfKWaMd4m8KpKNHA7EtLes ZG0u8NDYtq/ZhJGMDw7Jc8pce/myyUWhTk96IP6PWEaSK/N4C4mBTYRpe3tfRKqSvAbl QA6FycBCM1kDE59rYNkXhDek5ttDGN7XQyhEmEHcOfqyqtRByFjuwB4HUYUe5RNV+S87 B31g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature; bh=NmT/A86crWcHVCwgwTmJ3cYXNLDKm0Jw38Fg/SociCc=; b=Ny/BDsky03bJV/uc0RFmYkdMljsilz+z4z/m2q4Y7wK/WC5hntS43JCOCu2r+gD3RT UpKjXtHlZE7LZNQB6jaU0VdBPWtMH+id3kXwWe9Rew0+cuHvLFrr16V7FYdSptuZUbTv MWULOFovWDEVERFKN48vGC5wbAfpwnctZ4t77Q75kGMf9cW0vR3Gtje19vPegIyvsNVV KwJYXBZj8n8c6O/Qb4X572iNwXmmtWU9QtNKW1x9n5G3VFpyiVVsbCLnArSVuGpNKhmO 4swuneaU8WyWlGGI4ufjR8zRZBDNarvB/Cul9Cggpgxk9MtrZT8hXqDh4TI6dEiynXiY 2jIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="CO6/GNd/"; 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 s21si119442otp.225.2020.03.11.03.54.30; Wed, 11 Mar 2020 03:54:44 -0700 (PDT) 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; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="CO6/GNd/"; 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 S1729035AbgCKKyJ (ORCPT + 99 others); Wed, 11 Mar 2020 06:54:09 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:49331 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbgCKKyJ (ORCPT ); Wed, 11 Mar 2020 06:54:09 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1583924049; h=In-Reply-To: Content-Type: MIME-Version: References: Message-ID: Subject: Cc: To: From: Date: Sender; bh=NmT/A86crWcHVCwgwTmJ3cYXNLDKm0Jw38Fg/SociCc=; b=CO6/GNd/H6fyizyoixtv9CD7k8o3CsHH7g+WMwXeh/Fe2R2eL9Gs9zW1CHYVqnjd+5QeY7aF znbxnnywYuB6qeU7uNaaZelzskBud7ghEnnmJUOTRRJ0wLIFTDXTh+YNDB0qF4hdvnRfXjRW 7eZX/j+O3F/Fq2n1MhDWvfkBpEM= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e68c34f.7f2df93a09d0-smtp-out-n05; Wed, 11 Mar 2020 10:54:07 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id E1667C43637; Wed, 11 Mar 2020 10:54:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from codeaurora.org (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pkondeti) by smtp.codeaurora.org (Postfix) with ESMTPSA id D4C5FC433CB; Wed, 11 Mar 2020 10:54:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D4C5FC433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=pkondeti@codeaurora.org Date: Wed, 11 Mar 2020 16:23:58 +0530 From: Pavan Kondeti To: Qais Yousef Cc: Ingo Molnar , Peter Zijlstra , Steven Rostedt , Dietmar Eggemann , Juri Lelli , Vincent Guittot , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 6/6] sched/rt: Fix pushing unfit tasks to a better CPU Message-ID: <20200311105358.GO28029@codeaurora.org> References: <20200302132721.8353-1-qais.yousef@arm.com> <20200302132721.8353-7-qais.yousef@arm.com> <20200306175112.vkpeouec2c47yujl@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200306175112.vkpeouec2c47yujl@e107158-lin.cambridge.arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 06, 2020 at 05:51:13PM +0000, Qais Yousef wrote: > Hi Pavan > > On 03/02/20 13:27, Qais Yousef wrote: > > If a task was running on unfit CPU we could ignore migrating if the > > priority level of the new fitting CPU is the *same* as the unfit one. > > > > Add an extra check to select_task_rq_rt() to allow the push in case: > > > > * p->prio == new_cpu.highest_priority > > * task_fits(p, new_cpu) > > > > Fixes: 804d402fb6f6 ("sched/rt: Make RT capacity-aware") > > Signed-off-by: Qais Yousef > > --- > > Can you please confirm if you have any objection to this patch? Without it > I see large delays in the 2 tasks test like I outlined in [1]. It wasn't clear > from [2] whether you are in agreement now or not. > > [1] https://lore.kernel.org/lkml/20200217135306.cjc2225wdlwqiicu@e107158-lin.cambridge.arm.com/ > [2] https://lore.kernel.org/lkml/20200227033608.GN28029@codeaurora.org/ > I am not very sure about this. Like we discussed, this patch is addressing a specific scenario i.e two equal prio tasks waking at the same time. We allow the packing so that task_woken_rt() spread the tasks. The enqueue operation is waste here. At the same time, I can't think of a better alternative. Retrying find_lowest_rq() may still give the same result until the previous task is fully woken on the CPU. btw, the commit description does not talk about the race at all. If there is no race, we won't even end up in this scenario i.e find_lowest_rq() may simply return -1. Thanks, Pavan -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.