Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3568501pxb; Fri, 5 Nov 2021 18:35:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNQjVSSqtbKqEYr4HCex/TldQOD5TJ1PuLjJYy8TKmkVIOR47bCMGzwMdgZvc7CEaQCHHw X-Received: by 2002:a6b:d20f:: with SMTP id q15mr2109683iob.39.1636162524654; Fri, 05 Nov 2021 18:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636162524; cv=none; d=google.com; s=arc-20160816; b=Rdw681SvL1biRNI7y7wSZZmQdEZWhKTt1JjrsKywZCpNfk9t5JV13AsZ01YQPH/heR IvuuGjyumjFhdRYfN+NB38EE/qDLXZgLyq+cJCSHj8iQgrRgJTsjVLXJAgUY8Gg08RmJ sqHmN7Z/TG63EB4bGijJJKLi/eeJB1FBs77yY0YfpMm4FljijEiD/C2QcWBte9m/P0lL sMd6sQnl2EUk8/T9T4dEywCZ6jBENh5bnBQhEs3HJGxId5WXglndZPq1quu2ioBp5+wy GrtnJ2gYT9sjxBj/wUXfkaxSCdiidwmX63AbyZQyOsM42oCYvVtH8a9Cwve8nv9qjqG+ HMvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MNyg2uSqsWWOkhRlD7q+NCFVj7IbVMltP2NKSoIKgM8=; b=GhheYqGuMCr+QcO+Z68jA83hXuP2V8NI1dvE4dtOEXiJSP6a2zoQAiGCpMRPoOXkPG uNAf3hbZSvN1WhUzK+6zQwBdMmKLZAAX5uhjgo1o5jC6m1LE6PD+Ktp7c0UWUvrIn9WX D5/6RHW/exsoamBtcQl/a0C0CSeYkQEXFBCIymbfUWRv0CU5pAdfTtgyGCz7L+tYhftG zzxq+DkM3o0y7cUjnl/0d/X8LrCatCqMBHkfZRgy7GPpH0oyGYRXG2ms14PnFY9B4aDA E7MaNGfe5WZ1OMqCQTKIp8Q7ISddscr6qPKDrXzy64Sa9iTuHmSgShrdSKsu/PvY0pJ7 l4CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=c45fjMeV; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay7si5484071iob.27.2021.11.05.18.35.02; Fri, 05 Nov 2021 18:35:24 -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=@google.com header.s=20210112 header.b=c45fjMeV; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbhKEXGz (ORCPT + 99 others); Fri, 5 Nov 2021 19:06:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbhKEXGx (ORCPT ); Fri, 5 Nov 2021 19:06:53 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72C75C061570 for ; Fri, 5 Nov 2021 16:04:13 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id bm28so10127147qkb.9 for ; Fri, 05 Nov 2021 16:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MNyg2uSqsWWOkhRlD7q+NCFVj7IbVMltP2NKSoIKgM8=; b=c45fjMeVz7SB02yT63a42t9+4q69zWkm8R93gB6TGNUKTkgiXYK2q5HvJNUqBKdadB Z1ebspcysUjRrUVV9LpXTgX4FPpT4ygkWeKMti34a6eDgqV802J00bcjjUjZoS5uL5xM 8oSXg0O8akBiMu5IJzz+t79UEpT/aV5qiV0B2cMpXEdGkM/L0L8WfU+5qT7YsTComahh 3jmcxkQv/klq0VgwMpYNXhPBDesIhRp2ybBdVbDoKrO/FLXEZgtsaHjEGoDqaD6iII3A N5HJc1EMUqF+soDkRVQfrwUqImRgdgNdycvE1NbXZWj9sipCHZwX+cz6CWY6qQZUNLiM clBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MNyg2uSqsWWOkhRlD7q+NCFVj7IbVMltP2NKSoIKgM8=; b=iJ70laQQEHEggH6YLE5CpWnlvR3UtMCy2k7biOSYpgXilXWxUIEWj8gIJrYbhc5QCd W2NTfe/obLq4DgYPI7urVtBm85G/sEXtqai37VBuv4rf9U6ps7BcRokQgVfcoqLfN+r4 DWpNFmcwmrXMNJNktfy3chMg/tzrp5A8sDv1gcgsndcMWwluCVLqFhexaDU8QL+pTBo1 WeMh9S8Hp9r0yXgxQa5pyd2CuqXk/OI1YXY70lAneTltIohXyMjeA7kt7uzCw9Hx2o8q 8emcQz4W0cssOS4IBSHDp0Dg7DPbAOdzbmi6LXfPxFTub7JAiRD6iI2uhNTwKm55J/rs nf8w== X-Gm-Message-State: AOAM530h7W7CiXZ9hxMi5nDMUNo6Y7P77c717Zx/vmg8OyueK97YnndV vi+DkHADZBKN964S27B8hgef//MA00uVvPd5FFizMA== X-Received: by 2002:a37:2716:: with SMTP id n22mr16030083qkn.492.1636153452199; Fri, 05 Nov 2021 16:04:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Joel Fernandes Date: Fri, 5 Nov 2021 19:04:00 -0400 Message-ID: Subject: Re: RT_GROUP_SCHED throttling blocks unthrottled RT tasks? To: Doug Anderson Cc: Peter Zijlstra , Steven Rostedt , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 5, 2021 at 1:44 PM Doug Anderson wrote: [..] > > > I tried gathering some tracing. One bit that might (?) be relevant: > > cros_ec_spi_hig-179 [000] d.h5 1495.305919: sched_waking: > comm=kworker/4:2 pid=5232 prio=120 target_cpu=004 > cros_ec_spi_hig-179 [000] d.h6 1495.305926: sched_wakeup: > comm=kworker/4:2 pid=5232 prio=120 target_cpu=004 > -0 [001] d.H5 1495.309113: sched_waking: > comm=sugov:6 pid=2658 prio=-1 target_cpu=006 > -0 [001] d.H6 1495.309119: sched_wakeup: > comm=sugov:6 pid=2658 prio=-1 target_cpu=006 > cros_ec_spi_hig-179 [000] d.h5 1495.309336: sched_waking: > comm=sugov:6 pid=2658 prio=-1 target_cpu=006 > cros_ec_spi_hig-179 [000] d.h6 1495.309341: sched_wakeup: > comm=sugov:6 pid=2658 prio=-1 target_cpu=006 > -0 [001] d.H5 1495.312137: sched_waking: > comm=sugov:6 pid=2658 prio=-1 target_cpu=006 > -0 [001] d.H6 1495.312142: sched_wakeup: > comm=sugov:6 pid=2658 prio=-1 target_cpu=006 > cros_ec_spi_hig-179 [000] d.h5 1495.312859: sched_waking: > comm=sugov:6 pid=2658 prio=-1 target_cpu=006 > cros_ec_spi_hig-179 [000] d.h6 1495.312870: sched_wakeup: > comm=sugov:6 pid=2658 prio=-1 target_cpu=006 > > My best guess is that there's some bug in the scheduler where it just > loops constantly picking an unthrottled RT task but then incorrectly > decides that it's throttled and thus doesn't run it. Thanks for posting this. Tricky bit indeed. I was wondering if the issue is here: https://elixir.bootlin.com/linux/latest/source/kernel/sched/rt.c#L1031 Basically, if something is actively getting RT-throttled on a CPU, then if something else unthrottled but RT is ready to run, the scheduler does resched_curr(rq) anyway. This probably happens when update_curr_rt() is called on the unthrottled RT task via task_tick_rt(). That seems a limitation of the current RT scheduler I think? Thoughts?