From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fra-out-011.esa.eu-central-1.outbound.mail-perimeter.amazon.com (fra-out-011.esa.eu-central-1.outbound.mail-perimeter.amazon.com [52.28.197.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BE843469EB for ; Fri, 21 Nov 2025 11:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.28.197.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763723919; cv=none; b=N6UzjpkA64ptnvmx8nyatSZtu6iBhJQekr6ErpFatLulzVMekxH8fOzR5gvwzoJlOJL28i3hbUHIu6SylJAOFVNBHLC69d99pelaiZDWHLdrDQ0+k6U5ZpzMCOaCvtRuPSbkAkFFXRLFBC4YfKfYTm546vQ5X6Q2oRWXs33m614= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763723919; c=relaxed/simple; bh=CX9ZHwNvF6P5JMpD0CSAVmCCCnjlx34W9jXGZUc0lvM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=E38+UWvNkstcD7zVOmxXsdrcYOm/k+ITg+0/ufpf2qA9zndkdu+xZwvdFBg87P9tF+5HzKmGj3Qfs6uEYLfmogHFiVGA8wzX5bwP0dRUu4WCF4crBSdBK5avn3gIdUQBobb4I8PTSbq8gt9CYW2/UzMwMhkqhFWFsNPcBsNUylA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=Pm+V1zoO; arc=none smtp.client-ip=52.28.197.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="Pm+V1zoO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1763723918; x=1795259918; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1w7uM3RruNEZ3nlRGdir27iG3Rl2zX7FvMtIcrJ1JFk=; b=Pm+V1zoO1zE4jSKH5Iddid/HqQWZrc4nqKsq3inCWHdMjvsy1PLmic9P sqxIOlKRYgixqPDr8cL0HE9Ni+timr3kB8iW1YL3MdtZzBywOPcH9VmEQ XHnyHyJIbowqEBiQHZ2S6UXWXLF618pB3vczUdxXPWthCxYbsdRciGeXB zTcxGR7SgN8Hp6rQU41rVgwu7paEF0VCnFxSAg/JlZyyaiEflSx+N5kjd 3rYqYWEkrfF+bsZRV2BUwZBibmYOuhyoR6rExnx+rYpFyNLl+N/AnNhH3 x9bneAEvty08ac644KaSDqedhldaPyesr+JTGLbBHVzEu873nyGgIgbb1 Q==; X-CSE-ConnectionGUID: VcY9OlOmQcODl9Ag6dFVIA== X-CSE-MsgGUID: zsQQC+JPRAekyQbphx6Iqw== X-IronPort-AV: E=Sophos;i="6.20,215,1758585600"; d="scan'208";a="5470852" Received: from ip-10-6-3-216.eu-central-1.compute.internal (HELO smtpout.naws.eu-central-1.prod.farcaster.email.amazon.dev) ([10.6.3.216]) by internal-fra-out-011.esa.eu-central-1.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2025 11:18:19 +0000 Received: from EX19MTAEUA002.ant.amazon.com [54.240.197.232:15507] by smtpin.naws.eu-central-1.prod.farcaster.email.amazon.dev [10.0.44.247:2525] with esmtp (Farcaster) id 0ce776cc-8c43-418d-8376-b998c05489c8; Fri, 21 Nov 2025 11:18:19 +0000 (UTC) X-Farcaster-Flow-ID: 0ce776cc-8c43-418d-8376-b998c05489c8 Received: from EX19D003EUB001.ant.amazon.com (10.252.51.97) by EX19MTAEUA002.ant.amazon.com (10.252.50.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.29; Fri, 21 Nov 2025 11:18:18 +0000 Received: from u5934974a1cdd59.ant.amazon.com (10.146.13.110) by EX19D003EUB001.ant.amazon.com (10.252.51.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.29; Fri, 21 Nov 2025 11:18:11 +0000 From: Fernand Sieber To: CC: , , , , , , , , , , , , Subject: Re: [PATCH] sched/fair: Add more core cookie check in wake up fast path Date: Fri, 21 Nov 2025 13:17:54 +0200 Message-ID: <20251121111754.374593-1-sieberf@amazon.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <92c22ad2-d84c-44e4-b34f-a80f7f3748a6@amd.com> References: <92c22ad2-d84c-44e4-b34f-a80f7f3748a6@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D041UWA001.ant.amazon.com (10.13.139.124) To EX19D003EUB001.ant.amazon.com (10.252.51.97) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi Prateek, Thank you for taking the time to review my patch. On 11/21/2025 2:54 AM, K Prateek Nayak wrote: > nit. > > You can replace the whole > > (available_idle_cpu() || sched_idle_cpu()) && sched_core_cookie_match() > > with "__select_idle_cpu() != 1" [...] I'm happy to do some code cleanup, however note that `__select_idle_cpu` is using `sched_cpu_cookie_match` whereas at this point in `select_idle_sibling` we don't know whether there's a full idle core or not available so I am proposing to use `sched_core_cookie_match`. We might be able to do the following alternatives: * use `__select_idle_cpu` (e.g `sched_cpu_cookie_match`) and ignore the case where the cpu might be idle but one of its siblings run an incompatible cookie. Perhaps simpler code but could yield more force idle. * use `test_idle_cores` before deciding whether `sched_cpu_cookie_match` or `sched_core_cookie_match` is appropriate. This is the most correct but perhaps overly complex. The approach that I picked has the disadvantages that it might fail some fast heuristics unnecessarily if there are no full idle core available anyways but I thought this was acceptable since the `select_idle_cpu` fallback at the end of the function seems reasonable. Let me know what you think. Best regards, Fernand Amazon Development Centre (South Africa) (Proprietary) Limited 29 Gogosoa Street, Observatory, Cape Town, Western Cape, 7925, South Africa Registration Number: 2004 / 034463 / 07