From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BC8C35C190 for ; Fri, 7 Aug 2026 03:42:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786074142; cv=none; b=sThxX1LP5/v8EjEDeRJ1eaavNmlQpMgQP1B5qICnFkKIsspYtcmlvOI4qHq5zKcvr+lNlTdQxg9wRGD2Lee1O164AMj9LS37GVM6ZAeedxcnwg5uyx9+7xhHKOR/8hxy5Ryml7znoIEa/fvp2KokgiOxyJg8R1tLg7u0oe9883U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786074142; c=relaxed/simple; bh=kPrc1eLVExVYSmnUuY1h92wKJPu3lLHVaK6LEWEjNx0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SOhY6GzrxgwOv4auAjN+z0j9e8UKz3CRbms1f/lkoImkknIV4z0CgHG21QXczQsUWNb6DBaRVSXqO2i1SVoM0mEp8ycSmj9aalS8PbpJBQySVh8IQwYMUiS161IJRr3BbqEmbNfDTFedYazqAWRUiuLV53zT4l8EYGlVXxSOHGU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=T4aMbqma; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T4aMbqma" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-8487214ad2bso4519317b3a.1 for ; Thu, 06 Aug 2026 20:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786074141; x=1786678941; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=s0xj+KD/qimT0ueOv1VDltK/D2NjZVGQBi4dt38+eZo=; b=T4aMbqmaZs9aYN35+qqb2n2qQ06/kW34n05bauKaRRXuIXZhPDtozn5PvdXGGyIeBj AKavA6tyGtvBR8Qwf+w1+JX4BxZWne6DU1YETc+dup5+L8xxnbtMmjy70/K4MHkBqQHj KmoHG8oVA4J/EoBkONIC0FTlSGurBTbVYy6DDu5f3pxwcKXVVeDHT474hgOYWmg8Z+Z4 Z+bK1BJI8zmjNK66JpR6hXMuws8HizOI/t8X/JzjxFLkyXmD06H5f2ekDjGbyMgoqpOG IQSJGqYxl1SxrfrgSz7g9+/MPfOJrafmOZP588CHREUbLSroij1T78ApW/Q9mRHE53X5 4fDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786074141; x=1786678941; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=s0xj+KD/qimT0ueOv1VDltK/D2NjZVGQBi4dt38+eZo=; b=GXyztbiLaniaCgCc4BSo/hGB6QZxZgOG7pDxlImgZtfIX+eoWDZFPMRvYwIjyF+cK8 2JRlAeFmsJPF0j4ZRyo7AWfbwofMWB0TmATfaxI2ND54dCWvvAZp3EVkmxHy/Munntmd 8/3hwAxr4RFlO/tEJDrRyUR48f0JsmtYgrlsEdb0VCI+qLJVLdgLjAckk3fhKydZmeIs b4HBpJWAq9RSTZwJCqhLmqOc+FwSkqVwsImm56/Qn4V061bZFcdr2/gH52oapEGdvfKX dDW3xCZL9+ygb17q/vILR7U/dm+6Af8Fu6GVNNFAB4cxqxOxusslYO/8klUP2TEtlA1O VoHg== X-Forwarded-Encrypted: i=1; AHgh+Rql9URxwWRnMN8UymNZcIIX0OjaGcYvxD80Sc5C0sqmcvpS04GjDrVb8NBW2D/clRgY0CnQLEr2pMk3KWw=@vger.kernel.org X-Gm-Message-State: AOJu0YzKz3kFEN4k4i782nBnlMG2dWFGs6UIGHQfkICcouTnUCCIUo+9 1GMG2Sy4RBrYMWnVQ8Jsg0VqpR1wlIjjVdgAIcJMHODxHBUX3obrkO1m X-Gm-Gg: AR+sD11Yel16DAEx+4Fk58p6WYAFAgpBMhCw1SQk/BPDMCGSEDDcWVchttcUFy5Ycy9 XzbDlbjA+wj5NByIGRKh6fYj/XDas0fXnQInZwWPyjh+CnqpNfKONak5FhL7FsLrcczLjnCx98i vtkO6AdUSIPQ9IVinkibaDMUhcIqgYulCQAoWU0WC8yA5nWDeP8McHj0n3idSA8RwMuM8w1e/zW 350JDj47j/aT2/x23U4sbUihqJLNC+t3SbUnldUhsCIr9ykKGTNG/eO3sBva5SFGZxod8ysQg3v r84EHpNzbt8GsykXWWzgT4qf0I43ZIUJVV3v9iy/5hD/kjOGFLJac43lmiCjzd5I7wQfWeCo0UA TrIRCGIwir0o6BRHE+ZX+JJtYsvtbyVWLFeYMpi9F31F3KMLa9DKuh6zQrd0bwrBZ7GfWoVqDGU 3dQIAhk1MCb506U4tfeDBAtOl3lj5J1gp7Zc0VCtEsBN1rCBAi3t+uxKYVFh/neeq6tTNiIPon X-Received: by 2002:a05:6a00:4c96:b0:848:4424:2b8e with SMTP id d2e1a72fcca58-84f5df36a39mr780203b3a.3.1786074140779; Thu, 06 Aug 2026 20:42:20 -0700 (PDT) Received: from osman.mioffice.cn ([43.224.245.178]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84f5a52060dsm278035b3a.38.2026.08.06.20.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2026 20:42:20 -0700 (PDT) From: Zhan Xusheng X-Google-Original-From: Zhan Xusheng To: Mete Durlu Cc: Zhan Xusheng , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Zhan Xusheng , Ilya Leoshkevich , linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/fair: Make is_core_idle() check all cpus in a core Date: Fri, 7 Aug 2026 11:42:11 +0800 Message-ID: <20260807034211.1148245-1-zhanxusheng@xiaomi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260806-fix_is_core_idle-v1-1-605119e55b25@linux.ibm.com> References: <20260806-fix_is_core_idle-v1-1-605119e55b25@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Thu, 06 Aug 2026 20:18:56 +0200, Mete Durlu wrote:=0D > Fix this by removing the check that skips the passed CPU when evaluating= =0D > idle_cpu(), ensuring is_core_idle() now correctly determines if the entir= e=0D > core (including the passed CPU) is idle.=0D =0D The skip is what lets a caller ask this from a CPU that is about to become= =0D idle, where idle_cpu() cannot be true yet.=0D =0D sched_balance_newidle() calls=0D =0D sched_balance_rq(this_cpu, this_rq, sd, CPU_NEWLY_IDLE, ...)=0D =0D so env->dst_cpu is this_cpu, and we are inside __schedule() with rq->curr=0D still the outgoing task. idle_rq() wants rq->curr =3D=3D rq->idle, so=0D idle_cpu(this_cpu) is false. __CPU_NOT_IDLE is 0, so the env->idle test in= =0D update_sg_lb_stats() does not filter CPU_NEWLY_IDLE out either. For every= =0D newidle balance the patch therefore gives:=0D =0D env->dst_core_idle false, so the misfit gate in=0D update_sd_pick_busiest() stops pulling=0D sched_use_asym_prio() false, so asym packing no longer applies=0D =0D s390 cannot show that: SD_ASYM_PACKING is set only by powerpc and x86 ITMT,= =0D SD_ASYM_CPUCAPACITY only by arm64 big.LITTLE and x86 hybrid.=0D =0D The other callers -- numa_idle_core(), select_idle_capacity(),=0D asym_fits_cpu(), should_we_balance() -- all establish idle_cpu(cpu) first,= =0D so there this only adds a redundant idle_cpu() per candidate, two of them=0D on the wakeup path.=0D =0D Since the complaint is really the name, would renaming it do the job=0D without touching behaviour? asym_fits_cpu() already words it as "the core= =0D has no busy siblings", and sched_use_asym_prio()'s kernel-doc treats @cpu's= =0D idleness as the caller's precondition.=0D =0D dst_core_idle may well want whole-core semantics as its comment says, but=0D that reads like a separate patch with numbers from an asymmetric-capacity=0D machine.=0D =0D Thanks,=0D Zhan Xusheng=0D