Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp424400rwn; Thu, 8 Sep 2022 03:53:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR6RUPGEQPSx2APHHJ4DqE9XqzrgRocO5Eno+oiWJz4+H3ZEslLbKRgG30AJMaiyWfd986dK X-Received: by 2002:a17:903:503:b0:176:e043:18ab with SMTP id jn3-20020a170903050300b00176e04318abmr8319678plb.45.1662634439324; Thu, 08 Sep 2022 03:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662634439; cv=none; d=google.com; s=arc-20160816; b=g4Qn64r9KV97yC0OMtoEdWRl/6P7G9C7GG/G9sR2G0lozen16+VeBi73FVb7oQw6zz q8R7n1MWH2pIOU61g/Md3xtq1Y46Ns8u9eejAtzkgPx/jQXZiHCOT1CiXTfMh7kQQ6P6 fLD+5yD1WFLzhEoePcvTDMY3IJNXapPxV7ciXCH9bmKmemiYbU1U83/IdMraiKl5Cqgq yau0LKP4pdhmpjrrqDZs8/hliq41QrS/1EDtiW+y07FPyB9vCV+ulQiE2bS7y76QhMal 0l893YEVPLXp596ufUGwWr4rtDYHswcMf87oJJje8GK4YIM4imAAVGeaRKBb/HP9q5lh gCnQ== 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 :dkim-signature; bh=RVGiQFzdoGT4mUBJX9AgoACfWUpyb70+cZGif8ZAb7M=; b=0c0D38Sf1E2ZSphzxDAwxaHZh+331m9NpcC5f91tX0NkEMvMwLDDfZwKeiuKqcEbYT 9hJZtknj7Mk18CgognDMjGNk7e1lqJq3s6V+zaPngp4xL5ga0knMbEFpkA50TFsneu9L dWrVceq4YvG1VuJDadEsAgSKrxVhrMMX//9+OPjCfr3v7r0VHpP84ptSdCp4v8d1MGjD LPC/f4gPpzPPjGf/qJnJJIdqWnH1B7GUTto+/dd8ZavXdr2JrksuyYH2Hgf6Hko6DD9U 2EZcW23Mvdw/JkWw6Jlk5bSTU7Q626c3q98d3FuFRsQ2DyyApVPSjU2OnYZgjIsN/bSj mCUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="P/VXCM/l"; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx17-20020a17090b4b1100b001fb62b2c5d6si703877pjb.140.2022.09.08.03.53.46; Thu, 08 Sep 2022 03:53:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="P/VXCM/l"; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229546AbiIHKgl (ORCPT + 99 others); Thu, 8 Sep 2022 06:36:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbiIHKgi (ORCPT ); Thu, 8 Sep 2022 06:36:38 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 063909E2F7 for ; Thu, 8 Sep 2022 03:36:37 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9E3FB33AB1; Thu, 8 Sep 2022 10:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662633395; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RVGiQFzdoGT4mUBJX9AgoACfWUpyb70+cZGif8ZAb7M=; b=P/VXCM/l1S1C6XLk6JnvhP1EBAw11TtgP8z2eK5dPfshXkXBO9ZDYVRItLhd9ohIZ8pawp zdVtPUJIZ5VDqJ7D1nV8UihyyIJd2QbZ3Jp9pw++hCZEhFxCLAkNtaJcApRUsRJJbyFQRL 20sYKR5gXnQ63yu/T3c0PL/W3QLiLPQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662633395; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RVGiQFzdoGT4mUBJX9AgoACfWUpyb70+cZGif8ZAb7M=; b=xJtlVypap21E6s6oh47rgNyELpnn4ldteXfZ04vTd3cLMJpQRs5WlXL/N7PAQwGX7FZ+0J /YQdJxOd8dxPxmBA== Received: from suse.de (unknown [10.163.43.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 347A02C143; Thu, 8 Sep 2022 10:36:34 +0000 (UTC) Date: Thu, 8 Sep 2022 11:36:32 +0100 From: Mel Gorman To: Abel Wu Cc: Peter Zijlstra , Vincent Guittot , Rohit Jain , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/fair: Fix misuse of available_idle_cpu() Message-ID: <20220908103632.yzm5boxrr3nmvhpm@suse.de> References: <20220908080702.58938-1-wuyun.abel@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20220908080702.58938-1-wuyun.abel@bytedance.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 08, 2022 at 04:07:02PM +0800, Abel Wu wrote: > The function available_idle_cpu() was introduced to distinguish > between the code paths that cares if the vCPU is preempted and > the ones don't care. In general, available_idle_cpu() is used in > selecting cpus for immediate use, e.g. ttwu. While idle_cpu() is > used in the paths that only cares about the cpu is idle or not, > and __update_idle_core() is one of them. > > Use idle_cpu() instead in the idle path to make has_idle_core > a better hint. > > Fixes: 943d355d7fee (sched/core: Distinguish between idle_cpu() calls based on desired effect, introduce available_idle_cpu()) > Signed-off-by: Abel Wu Seems fair. As vCPU preemption is specific to virtualisation, it is very unlikely that SMT is exposed to the guest so the impact of the patch is minimal but I still think it's right so; Acked-by: Mel Gorman -- Mel Gorman SUSE Labs