Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2265194pxb; Mon, 23 Aug 2021 16:26:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3pzwRvsCy9pVzDYUKcP19hgIJl9OL2IwrpvCX/x2uBAsfoxiEWqMOrfFeCI/GCr3qMZiv X-Received: by 2002:a17:906:d04b:: with SMTP id bo11mr38401518ejb.513.1629761181456; Mon, 23 Aug 2021 16:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629761181; cv=none; d=google.com; s=arc-20160816; b=mVsN4diA+ZJc+NoZziGHP/50WyNrsJAxQ4KYGXkX8F60Aa0YRblbcLpyx7U4sefFus Xdq34QbcRp0FRs8sVvWQYPvzd72EYyemTER4ogtogM3AtG+MC/yeJNBW2K0Kb7+5v9sg WFKicg186eGY1QrvfM42mNDaVqf+XXm7g7HRadClaLqtMkDMzRf5TfjurD2AXZ/9uuKu fwkGF47M1/izpa3e6zgtaDyV3WQXIoawXkv26gSIkZ7x5/Ce5Ic37afUBV6iwhmcBN3d 3/J3nac+3kGXZ4P01/zzYqChp1JhRXwrcZQVOBgnXOPQZn3IIllDNTtjOehUm0njE8Kz 7quA== 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=A7bP/SLiBOnFDu0wqR6On8yDXES3VpQI1qN5SJ7wmMs=; b=QpVciEPn1QlVatpYi4QIG0rzKS4g5+42WlJOovB31Mdz8gllBBpbfgYYNq7b0Aq0sn ZJfk7eOK82kdPtNcRWOEX5rJUY+5nhlTiYdUtos7fOMkuG+UBXf4Rum3Dn7K5IjqMXNZ hGiYCttOFIXONu/4wlaz0IVgFgNui+/3uJFDvEgyCdQ61EKqMs9aCHa+72jbRS3ylGcu RHgSyvTsQkz3dUb7oNCQKKIH28akADahcDRb9q1O+27UKSVlRy7iC2p+Yg3Atf+69qVm uufhputnRn/x1DiyTD4ory+QoCQEQTUqJ7tT5RoC8OXDwOC9fjsYFK0L9C4rRhw4KIAi UefQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="gJFq/xCd"; 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 w17si15453547ejv.123.2021.08.23.16.25.57; Mon, 23 Aug 2021 16:26:21 -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=20161025 header.b="gJFq/xCd"; 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 S233165AbhHWXZX (ORCPT + 99 others); Mon, 23 Aug 2021 19:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233093AbhHWXZX (ORCPT ); Mon, 23 Aug 2021 19:25:23 -0400 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BB36C061575 for ; Mon, 23 Aug 2021 16:24:39 -0700 (PDT) Received: by mail-yb1-xb2a.google.com with SMTP id n126so24031854ybf.6 for ; Mon, 23 Aug 2021 16:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A7bP/SLiBOnFDu0wqR6On8yDXES3VpQI1qN5SJ7wmMs=; b=gJFq/xCdHjs7QbiMdC417WnTvz/zKpowi8pkIkcfTBnnewL6j5f+pPlvM2aiJ5V/nD iMG4f+sRyjHF6v5l4z2zzU2pinlby/+532gNIphkVgfTYuI89wtJiPLrMnJMK0X5dWxx fLQ0SGJd+nbEYwAQCQ+PROfmMIwIdD0llsvVuVyIwOVgJP/1FA8crQEQ2MBLLxVFJABa Wng8LXFjBKM2owQAweuvQmZLqydSMvex+/K/4UA3CeZdrjNJSN43arD0xhxgKvaov3d8 5ktD+YH1yFNw355XcMl7jJbSwxJL2aayX3RNo5mru9QjmSaf+TokyblQOUVdz0xRr3gi ujlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A7bP/SLiBOnFDu0wqR6On8yDXES3VpQI1qN5SJ7wmMs=; b=EBlwSLBBtu9ANtxqa5rE8yW68Nw0sk2ziJ1pYP3VA88Q2KTFcGw1Sro4i+tRsbwbVB LV3wPIkTy0Iie/HS3aHcFaT6vMwEViIYecaGbXMbDKJHdhZNaFivLG0BF9N6IjblKu9O O2dXx3PxJ9ACHlhyjcCCMeo72U3/dCCXEdq9AsVZd47mvhaFvNi3t+lsecAUZ8kIX6Pz AKubdIqyg/rtU8iQYZ8Yxl0lWgc73CbGWKs9JGTVwfMKCXOFCt3o/DYGnZLvSpHbNEWS XvNuUcuLjLO0uBZtQI2IbkOYdO3avgz1mxHGHfCfhoriDaV0ao1J1mVaAHeoyeI+lA/K eIXg== X-Gm-Message-State: AOAM530xRnmD+SM6A9xP0fROKlhI3tNMeSrE5Ztn0tkR+zfSBYSDOBWq lvR7QYR96mbq2OIeiuYwIpFSfNI3nYrt0f9GS4ABlA== X-Received: by 2002:a25:c095:: with SMTP id c143mr6437050ybf.179.1629761077639; Mon, 23 Aug 2021 16:24:37 -0700 (PDT) MIME-Version: 1.0 References: <20210818005615.138527-1-joshdon@google.com> In-Reply-To: From: Josh Don Date: Mon, 23 Aug 2021 16:24:26 -0700 Message-ID: Subject: Re: [PATCH] sched/core: fix pick_next_task 'max' tracking To: Peter Zijlstra Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Joel Fernandes , Vineeth Pillai , linux-kernel , Tao Zhou Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Mon, Aug 23, 2021 at 4:17 AM Peter Zijlstra wrote: [snip] > + for_each_cpu(i, smt_mask) { > + rq_i = cpu_rq(i); > + p = rq_i->core_temp; > > - /* > - * If this sibling doesn't yet have a suitable task to > - * run; ask for the most eligible task, given the > - * highest priority task already selected for this > - * core. > - */ > - p = pick_task(rq_i, class, max, fi_before); > + if (!cookie_equals(p, cookie)) { > + p = NULL; > + if (cookie) > + p = sched_core_find(rq_i, cookie); In the case that 'max' has a zero cookie, shouldn't we search for a match on this cpu if the original class pick ('p') had a non-zero cookie? We don't enqueue tasks with zero cookie in the core_tree, so I forget if there was some other reasoning here. > if (!p) > - continue; > + p = idle_sched_class.pick_task(rq_i); > + }