Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2433231rdh; Wed, 27 Sep 2023 02:25:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEa6HLRa8JQrEimSmG73wocblU1yW25sWE3yUO4+VTc37BGrVAkwC4ZNEf8tSVeyrQ77n5h X-Received: by 2002:a05:6a21:18f:b0:159:e0b9:bd25 with SMTP id le15-20020a056a21018f00b00159e0b9bd25mr1733322pzb.57.1695806747037; Wed, 27 Sep 2023 02:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695806747; cv=none; d=google.com; s=arc-20160816; b=jJeOUN3FY7HSYQtK+mQZqJwuPLevMg+pwaKVxQdPVgq50GP0UTNO5MpH9h4jIgVMQW QReYkL+kYw14+DxCMRORjoMk73EJAVoNRg1/2V+7lV+J4PiPV9Ld8hH5S0pMUU/WPwXN RLDpgdZ421Q0Y+OVcc6oATtU14bWWhsqofXDGdYHfpy5cAbHaSzue1ZiyIghBgofoQx+ UFtS10WFQsrR3PB3F9h8WENV5MxOT1WkSCIhLRe5FTe9htBgbMN/EK2iRcaNWY4kdegC oq8jq7h6TaP2lqmk9wrvaK06ZWuIyjBMxITYa1VRvnIN8zodD7XPcgLu+JM2woPppGc2 8dqw== 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:sender:dkim-signature; bh=nV6vVOxuvpJ4aTooRcfx52+uWH5cR86Wo4p6hinLqq4=; fh=CK2KBITInphtTvmoTs28NjYcukqk1f3ksdK9lOen6HQ=; b=WkAIpAW4N8ZsPMn7YcKQRiO7sOOsu51ahwci6qxCmjzbqs/7H9/ZAzFi3u79vVFwVO poK23hzeiZ0CX2zslo22liomy5A3tJDGeQVgqPppftn86ndq/3S6jyJBDgixxIuYQCjq cQg1P8JYmzgxPa1leThrIrkflCj8SDVao/YxTd4BzVCne5EYj25dvyu08pkmrgnmK1Bs 6QyuIkMp7Rra6P8RvPOCWe0vlkwlmnMSRNcn5gxyspVSL0l8knihoUQkBbAAJQCCK30Q bTtVkVo7sw5ISKd0QbKz47z4GyoiBzuHWdM8NQF/KGtU7UAt+cXyttcIqCxbZVXkHzTz QhMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=imQaO1OC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id n13-20020a170902d2cd00b001bc553d16e0si15783954plc.507.2023.09.27.02.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 02:25:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=imQaO1OC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1398B80608AA; Wed, 27 Sep 2023 01:00:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbjI0IAV (ORCPT + 99 others); Wed, 27 Sep 2023 04:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbjI0IAT (ORCPT ); Wed, 27 Sep 2023 04:00:19 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B3DD11D for ; Wed, 27 Sep 2023 01:00:17 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-99c93638322so2330953166b.1 for ; Wed, 27 Sep 2023 01:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695801615; x=1696406415; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=nV6vVOxuvpJ4aTooRcfx52+uWH5cR86Wo4p6hinLqq4=; b=imQaO1OCO1Bu36Gbh6cQ4DkD1/YMos322YzXw2ymRIkCCnWarGdpK2SCPH4IQSu6Ib syv/PljQ3BxdkSFypoJkWZVpDvTSRz50IfiTClnSj9/KMH1NMhJgl7PTE/QK2CofPJeS xome/IjcZlp9rYfMUtNWvjWct+Z7+kearzwFrAJR1gKb1PzWY9Ke3saBNNQKvLJjkoM7 oj0sScYCtM6BmbMWMdprlr1+V7AKDxb+SaNv3fcFwiaI1W/yqB6WwHWR70CaF4KOmmW7 7c8kq8JVx/n/ehho1GA638zS/49HpLhpiHFoj9QKLmaBLU2UhEP97IoiFlQYjDFXv02F 2Gsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695801615; x=1696406415; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nV6vVOxuvpJ4aTooRcfx52+uWH5cR86Wo4p6hinLqq4=; b=Pm3pmBhK5EQHXGG8h0Uu9+ugDRzYzpOHr4uJkvDHwwTxYhF4gJhe+3EVOpVr8iqrKt Au7KXwZV3cZy9ImzMTgaCwGSPKpPsEVyD1oESpDOETggzAK2UK5FSVZ9cBp5xxzwB76p DclIT919a8oY6QhSPiC26+g9lRjyXMTZcPtn2tlPMYcV2yI+5yTiyet25xXe3wNZwrdy iLXqAbmmvsA8jeTGQyaHbTPA1H9XBQ1E6YsPk3tPgnINJ0ILlEf65dQTaL8bn0ErKTid Can/Qra8dOJ7ET1nzljG8rh6IT8KM/uqreCm3LeEXOLle1GgwgyhOEnfdt39dXd/j9Gb EcRw== X-Gm-Message-State: AOJu0YzxTS2mnQEH1OayiqGsY1W9Ky95YMwG03sWy2SJKg1kjCVGrDAZ 93IWeNkmYxUi1GhpY5V1Hs8= X-Received: by 2002:a17:906:99c7:b0:9b2:a783:3d0 with SMTP id s7-20020a17090699c700b009b2a78303d0mr4571087ejn.37.1695801615309; Wed, 27 Sep 2023 01:00:15 -0700 (PDT) Received: from gmail.com (1F2EF49C.nat.pool.telekom.hu. [31.46.244.156]) by smtp.gmail.com with ESMTPSA id l9-20020a170906230900b00993004239a4sm8817491eja.215.2023.09.27.01.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 01:00:14 -0700 (PDT) Sender: Ingo Molnar Date: Wed, 27 Sep 2023 10:00:11 +0200 From: Ingo Molnar To: Chen Yu Cc: Peter Zijlstra , Mathieu Desnoyers , 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, Chen Yu Subject: Re: [PATCH 0/2] Introduce SIS_CACHE to choose previous CPU during task wakeup Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,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 agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Wed, 27 Sep 2023 01:00:26 -0700 (PDT) * Chen Yu wrote: > When task p is woken up, the scheduler leverages select_idle_sibling() > to find an idle CPU for it. p's previous CPU is usually a preference > because it can improve cache locality. However in many cases, the > previous CPU has already been taken by other wakees, thus p has to > find another idle CPU. > > Inhibit the task migration while keeping the work conservation of > scheduler could benefit many workloads. Inspired by Mathieu's > proposal to limit the task migration ratio[1], this patch considers > the task average sleep duration. If the task is a short sleeping one, > then tag its previous CPU as cache hot for a short while. During this > reservation period, other wakees are not allowed to pick this idle CPU > until a timeout. Later if the task is woken up again, it can find its > previous CPU still idle, and choose it in select_idle_sibling(). Yeah, so I'm not convinced about this at this stage. By allowing a task to basically hog a CPU after it has gone idle already, however briefly, we reduce resource utilization efficiency for the sake of singular benchmark workloads. In a mixed environment the cost of leaving CPUs idle longer than necessary will show up - and none of these benchmarks show that kind of side effect and indirect overhead. This feature would be a lot more convincing if it tried to measure overhead in the pathological case, not the case it's been written for. Thanks, Ingo