Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2662463rdb; Tue, 12 Sep 2023 08:30:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjuDn1PheHXxdXNzwmWwEAmEiiLL8qWxww4nWcNrsAn4ltD2V6Gf+mhSy5y9sSUEEkGBj7 X-Received: by 2002:a17:903:2302:b0:1c3:a4f2:7cc1 with SMTP id d2-20020a170903230200b001c3a4f27cc1mr16842plh.5.1694532604223; Tue, 12 Sep 2023 08:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694532604; cv=none; d=google.com; s=arc-20160816; b=uQk5qPa6sPocNO42pEifp/aNKO/oGPNsSZX1SS6t22+Ds+p7Mcuwp9ooPdcRANGnVl rtZ7UkZ5BjHCWftR7I5mPWEQ+gTZ4hSuKdkAoK4bDrUOi7GltNqpN++E4EjxS6besO32 PgDLekE8G2MTTa7qPCOeeVTy1Ud7IyauLNHfN3u7XNwbSLEf1arRGAyo0wu0Dn3OF8F8 4GRWIOr4MjMtbg0OzohufKEls/tRXaYtd0/MLsgauFEvSnkoAl2bDd38KpGUJQZYTkLG xOsraSkYw2sKB5a8QHbSnnPX5jNDzIalI9MP7NmoPqF6dl5NL80eBMf94AjbLqrXFEsA ecfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JstlJetc07E69DvgsMzMc/dkNMsHZtrpoEYcYdhK5Pw=; fh=oPCXb8dIe4bVFBga6CqRx+ZKGXSE41fT2ahkwEirh2o=; b=nnwRZ2X5gGevVLp++1op8CxfAx2oBMpAxFKy5ehAVXDZJdMj4w91CLgLAT1HSdiCHK AwX2a96zG8ZXsRE3NVTaO97wHXqFZeSIrYhI17pOR6Y/DXNMhXNeXITUubcRuoMnIgEO v31LZYr6rRwjOOzV4HC+evh/oNjTTMya2EzKtJD4g7rvyw2KP/oDUnUo2OByKFXK+Spz EOEImBZv1DbX0/8S5vJ1H16T7569t5Udeyv9MGrUlaYCP37MuZBBJMcZql5lA3NS6Ecg tjdBp7hrO9OCmlRynedXwfuyz53XRoCao1ESEsYXhsmFF9TiEAEwORg7oxXAgX4/Ihyk Ic2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=Xc0BtJnN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id t9-20020a1709027fc900b001c3a05b0b67si5161137plb.566.2023.09.12.08.30.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 08:30:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=Xc0BtJnN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 52C5B80A1918; Tue, 12 Sep 2023 08:17:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236257AbjILPRT (ORCPT + 99 others); Tue, 12 Sep 2023 11:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236178AbjILPRS (ORCPT ); Tue, 12 Sep 2023 11:17:18 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95FAA1BB for ; Tue, 12 Sep 2023 08:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1694531832; bh=pm0FGKtfxxTSRKFL2/sM6WK3QeRqGkLMV2tedpU+eJY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Xc0BtJnNZFWnjP6YDF78Ye27GM2CDB5QScP+Kcb5TeP582oOJDlxtMn/A4Zwd6j+L kGhfEVg5bV6TQ/CL1ykEWMTTT4ONIk7hiA/8h3LL5VqQpsTpNJOIb5uEfNrOhx4j9a V2j7RfxLQ3cO68+86kzSkK7EQopbsjoojkNJ2E/C7VwO+WruHncBh66aJETSoCFKa8 n422VBUzuvZCqhpLkNj/OCqHe8CvoaYcWvp39HD7L8UCneASHLzis/1dX1JxwY/9fq SkMZLU4N9T91bDPz56Aw5y4GHlXVItocNdOZmBIQqxPKuGA+MIdY25dCgs+6qdfF+u iGg0HdweMCiMQ== Received: from [IPV6:2606:6d00:100:4000:8b7d:289b:cbab:37c1] (unknown [IPv6:2606:6d00:100:4000:8b7d:289b:cbab:37c1]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4RlRyc21nxz1P8l; Tue, 12 Sep 2023 11:17:12 -0400 (EDT) Message-ID: <2a47ae82-b8cd-95db-9f48-82b3df0730f3@efficios.com> Date: Tue, 12 Sep 2023 11:18:33 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [RFC PATCH 2/2] sched/fair: skip the cache hot CPU in select_idle_cpu() Content-Language: en-US To: Chen Yu Cc: Peter Zijlstra , Ingo Molnar , Vincent Guittot , Juri Lelli , Tim Chen , Aaron Lu , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , K Prateek Nayak , "Gautham R . Shenoy" , linux-kernel@vger.kernel.org References: <30a7ff14-3f48-e8cf-333f-cbb7499656e3@efficios.com> <244ff1b9-c51e-be9b-0755-757f969b36e1@efficios.com> From: Mathieu Desnoyers In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Sep 2023 08:17:33 -0700 (PDT) X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email On 9/12/23 10:14, Chen Yu wrote: > On 2023-09-12 at 10:06:27 -0400, Mathieu Desnoyers wrote: [...] >> >> One more tweak: given that more than one task can update the cache_hot_timeout forward >> one after another, and given that some tasks have larger burst_sleep_avg values than >> others, I suspect we want to keep the forward movement monotonic with something like: >> >> if (sched_feat(SIS_CACHE) && task_sleep && !rq->nr_running && p->se.burst_sleep_avg && >> rq->cache_hot_timeout < now + p->se.burst_sleep_avg) >> rq->cache_hot_timeout = now + p->se.burst_sleep_avg; >> > > Yeah, Aaron has mentioned this too: > https://lore.kernel.org/lkml/ZP7SYu+gxlc%2FYjHu@chenyu5-mobl2/ > May I know the benefit of keeping forward movement monotonic? > I thought that, should we only honor the latest dequeued task's burst_sleep_avg? > Because we don't know whether the old deuqued task's cache has been scribbled by the latest > dequeued task or not, does it still make sense to wake up the old dequeued task on its > previous CPU? Here is my reasoning: If a second task is scheduled after the first dequeued task (a task with large burst_sleep_avg) is dequeued, that second task (with small burst_sleep_avg) would need to entirely scribble the other task's cache lines within the time given by sysctl_sched_migration_cost, which I suspect is typically not very large. So I doubt that the second task can entirely kick out the first task cache lines within that time frame, and therefore that second task should not move the cache_hot_timeout value backwards. But perhaps I'm missing something ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com