Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp449218pxu; Sun, 22 Nov 2020 14:43:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWNxn0SEOyTVMIIk6DvJN2t5gR/b/5ZWHfs+FS0Rz3dr0JjUUx2+LkkZc6vTbWOqxkFvoY X-Received: by 2002:a17:906:34cd:: with SMTP id h13mr18254776ejb.350.1606084988330; Sun, 22 Nov 2020 14:43:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606084988; cv=none; d=google.com; s=arc-20160816; b=mZpkykqee4GGop+oF1nhirVlcxsIs0fO1O2rzD+lugQIGHMbZjK5+HJrWOjKIChAiy ydlyiuLfVluGPaME9ETFjYHNxmj7ROkVhIbP4ZQuh9ynUW4GFbxB570RtOqnC21GLMIz hnUGuJrp7VuX1k7ucPmtRUyqBffTtubzqoZvLH5Z4HXsAZmUdC56rTLLd8I7y24TeLA8 2wqxXhyDKkoO+IPCx5BXgDm48QEdrHJHOef6IcTY2LMyvbIdiUEXfltMOg6ElQ31+fjO YZX2Pddz3SUvqxS4Cs0imspJJT64Nz1/yS3JFTW+u2y3Ls+6Ap+hLBCoOg/ilhUyRFy2 /wZw== 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=7qVjazRK/V3lBu7OCD/QeDeirETDO0A195L4HDxXUug=; b=emkKBvBf9JK7ooyYtXIfo9J/ZQQJQHdyFKlon3ALf0pvpsdBGTf9EVvKJuVWl3a+FP sPjzVc2TGhRwMjGqTGaCYEAdSjA7xLJSMKMyZwZf+F3Twal0C5D/LBbVylabXZziyEej MsVZG/pDRuIo0oArCYZmWetr7ggHQVsZ+gieIEd68+EBivWLiRIy4228G2eb8wyGp2wo QeMSoQucIEVjd2KG6MvI8+1qdqFbLXqHT6x9Cpf32A8fPOhzLVRwFOEA4Chqw4oCzVuf MsRsAaHDxJRRuZP+d7E6YkUkBhKhTDKEcJdcffgtjrP9Se5ZPqXyTtjqnEUJJluwl26c 5iaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j4apR2DT; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si5641143edr.89.2020.11.22.14.42.46; Sun, 22 Nov 2020 14:43:08 -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=@gmail.com header.s=20161025 header.b=j4apR2DT; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbgKVWla (ORCPT + 99 others); Sun, 22 Nov 2020 17:41:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgKVWl3 (ORCPT ); Sun, 22 Nov 2020 17:41:29 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DF40C0613CF for ; Sun, 22 Nov 2020 14:41:29 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id k5so1453665plt.6 for ; Sun, 22 Nov 2020 14:41:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7qVjazRK/V3lBu7OCD/QeDeirETDO0A195L4HDxXUug=; b=j4apR2DTXgWoTUUHKbRvTyxm2fy8/RpK1X0anc/b/mJO538fOTtIYzM8noBGBQRK+a gbiM/SBzND8+5j08xU/8bBOfVmTkuuKigBdw5M9+YXTR/RhWtVxHvvwSEATI7O4ZVSun mDCF2EfrccF2deN4jttYFY4CWNJWF0xq9HE7CgHcNXrRu66Fno9DwJnT1i89imO6UlRB OATWGkEaI82219jp/Mwvh0lhSaG+FFG+ydZ3aVyH6chYOrF0TlZUMMLvhzhZiiFB9GEh SG7b0K0ZPNSNfk2Dwxft372CnvqzGI4DM8GI4Gm6obtWh6JSvf3foXRVwwJxnZUuNYul LgaQ== 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=7qVjazRK/V3lBu7OCD/QeDeirETDO0A195L4HDxXUug=; b=rI3HqN7B1aA1iW7oR41Glwt+WTV3rvGFkddKcEBCcpDN4QDXmeLsLSeQ9+C+6SW3/J ui7B84DKJjrEGMKVkCPdBxHn54mFSdnTqo7xoX1YGd5129N/MT50hjgyKSxc7d4OM0KM mDuIltFB7jWckpOVTh5TpuIpXbist+NUl9RP6App+Sl1BTleCObrfxyY+ih3I8fG0I7B RpH7XPoeScIgRe5akw7Lcuz/3hwNMtAfsjJmlM2Br2Q6sbLKLboFN/r5bS+TeZdgfue0 O0in8TPToC0qf1J0CH6vMDhEBQ/PDoU6Yd8nr3sh/iFHgmWpSaSMnVvIEIkk2wCIPm5g hkOA== X-Gm-Message-State: AOAM531HY5j5v26D5BNEh0Rda8zKUEMI5svEmgKA1VJxsDYxVZXIN5sJ yLoBhoEaR7aR89KPVTNfynE= X-Received: by 2002:a17:902:ea85:b029:da:b27:396a with SMTP id x5-20020a170902ea85b02900da0b27396amr1938341plb.9.1606084888891; Sun, 22 Nov 2020 14:41:28 -0800 (PST) Received: from localhost (61-68-227-232.tpgi.com.au. [61.68.227.232]) by smtp.gmail.com with ESMTPSA id d68sm9280237pfd.32.2020.11.22.14.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2020 14:41:27 -0800 (PST) Date: Mon, 23 Nov 2020 09:41:23 +1100 From: Balbir Singh To: "Joel Fernandes (Google)" Cc: Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , Vineeth Pillai , Aaron Lu , Aubrey Li , tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , vineeth@bitbyteword.org, Chen Yu , Christian Brauner , Agata Gruza , Antonio Gomez Iglesias , graf@amazon.com, konrad.wilk@oracle.com, dfaggioli@suse.com, pjt@google.com, rostedt@goodmis.org, derkling@google.com, benbjiang@tencent.com, Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , Junaid Shahid , jsbarnes@google.com, chris.hyser@oracle.com, Ben Segall , Josh Don , Hao Luo , Tom Lendacky , Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: Re: [PATCH -tip 10/32] sched: Fix priority inversion of cookied task with sibling Message-ID: <20201122224123.GE110669@balbir-desktop> References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-11-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201117232003.3580179-11-joel@joelfernandes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 06:19:40PM -0500, Joel Fernandes (Google) wrote: > From: Peter Zijlstra > > The rationale is as follows. In the core-wide pick logic, even if > need_sync == false, we need to go look at other CPUs (non-local CPUs) to > see if they could be running RT. > > Say the RQs in a particular core look like this: > Let CFS1 and CFS2 be 2 tagged CFS tags. Let RT1 be an untagged RT task. > > rq0 rq1 > CFS1 (tagged) RT1 (not tag) > CFS2 (tagged) > > Say schedule() runs on rq0. Now, it will enter the above loop and > pick_task(RT) will return NULL for 'p'. It will enter the above if() block > and see that need_sync == false and will skip RT entirely. > > The end result of the selection will be (say prio(CFS1) > prio(CFS2)): > rq0 rq1 > CFS1 IDLE > > When it should have selected: > rq0 r1 > IDLE RT > > Joel saw this issue on real-world usecases in ChromeOS where an RT task > gets constantly force-idled and breaks RT. Lets cure it. > > NOTE: This problem will be fixed differently in a later patch. It just > kept here for reference purposes about this issue, and to make > applying later patches easier. > The changelog is hard to read, it refers to above if(), whereas there is no code snippet in the changelog. Also, from what I can see following the series, p->core_cookie is not yet set anywhere (unless I missed it), so fixing it in here did not make sense just reading the series. Balbir