Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp413208lqo; Thu, 16 May 2024 09:38:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUlvY8fOCTJuatJG2Ujw2zTvg8WB1dX5CoN5x60s/WWN0IQUAimc+HN0bzf7uvFvVLXboicV4OE5C1+ZItR3WnNBzJfGS8e1W1sJeCU8w== X-Google-Smtp-Source: AGHT+IGlXDjx2/CZ9ycBn3lE4htWmt+CF2i+rJlhojA3Qfj7cFnYmgBImrM9+jgyLSgIywJaZ8L9 X-Received: by 2002:a05:6512:b88:b0:523:8c7a:5f6 with SMTP id 2adb3069b0e04-5238c7a06e3mr4813205e87.51.1715877514935; Thu, 16 May 2024 09:38:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715877514; cv=pass; d=google.com; s=arc-20160816; b=ZbfhTg6hNN5TU7no2WNxauG+51IQe+d0zvhXJVp/x+VENA0+Quqrok0Y6ozMJvNeiX Q9v4yZW7a4T2ERSG8TXmMeUt//lvrQN6D+Flg03mdNHwXDUMRB0kEDLIWw4fnPYLjqPd Gx6TCop/3bYodZM1t+/BopsSE1OogVHiaVWEI8rW498hyd4PwZpsuid3ShDLBjYZsohY 797Qw7WFeKBEb9QtERFLtzK8Q4pa6QIXqpVr2oKWMzqG+BmOmUFhQGxcAaeWXvsGx+jX 9EOYog5J/xeeeUinJ3UnmsY17IR9H/G0wn6ZiQ1unfWBzSTuMQlTUolB+D82xIDmv6R6 K9IQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=mL2ixIV4yHVtZCx+rAwU6k84asoS2aeQfzHRCssL2Vs=; fh=k+5xLVeRMEhRv3iONYxg0fAqTOVEDbk0hD+dhDCmMFQ=; b=sb8XzrKPO75bABfduK2DtuVPC776MnWtyxwLtzKAqVYgO6KOtaz/hBOg3lQ/u5LDsy 7QHNUAK6lhLPId4gQ86LggM4l6BE7e61bWjDZMIJHX06n8NUwidBQw+YneF9INV0eGuI V6ej94kUY8Ty0aHWiAR+WdK/UC1u/aOCwUZnGdPVy97VbUW2hvBuqHK/DqXVrQsYudWb NJwvP2DHfMgiIiyuqbOFG2jC3wycJ3t+NinVlB7MS9r5QyUr8PJsznjlrSaxPvlOo7Qs rBgYtq6p7DgXretkzfdnodt/2yMZbLteX3QCYfSCEws3FWjxVTzvlZ9igaMWp3MBj8Cc pQlQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YUOJPQPb; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-181326-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181326-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733beacb5bsi8661219a12.51.2024.05.16.09.38.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 09:38:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181326-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YUOJPQPb; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-181326-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181326-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A66361F2192A for ; Thu, 16 May 2024 16:38:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86FB34C90; Thu, 16 May 2024 16:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="YUOJPQPb" Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 579278821; Thu, 16 May 2024 16:38:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715877510; cv=none; b=qX2gGFyF+f29Z0GgxsAoZoMNwoL383mhD7ZbqAHiE3Hz1vZguHQ0JEksXJ1MK2z9Rr4ZxEhB5AA+AEqTmmA44XOjuaSSxVnvy0vvSo4BX0vnHFukvY42oP/LiZp1o61bj1UtBztCZmbJBIMK0fjzkgdB6PxbKEFXL1W3A2bfBp0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715877510; c=relaxed/simple; bh=YjsP4L4icgq/Y6Q4/G0kLiCQWYTDum7px1qoh4b1Pb0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=DexYgErVdDxkeyCF4yfbEaikmu07ysmnfR6I1szBRRj1af5F6FC7da8QWQgWWIIQjq4eMHWJwxH3OEXVVCu0B5gab/MjgM+zz8Cyrkoqo/QvdFdLLSKwtbSwwILfQxkXH4tMSBQgdN7YvAa7vMBvGhY8t4W1b6f0BVwkB9kW3jU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=YUOJPQPb; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44GGVJPB018436; Thu, 16 May 2024 16:38:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type; s=pp1; bh=mL2ixIV4yHVtZCx+rAwU6k84asoS2aeQfzHRCssL2Vs=; b=YUOJPQPbEYYFutYkCQkc99kuAzU85sKyDTb5lNqcEvXtXgFiFGUz6oDCIM/AFZhuFvw5 Vliki+kqlrj1/3rUvInswqS29sd2toZB5dCXMp6JBSopfiaS7TigHb2KYoO3lebNHj3l e915XGpmEuh2MLI3K0VX1U85Qwg9nv1mkOxP5LWw8UdUEd9LG70L90cK45uFsg9ufi/f kpq0A//RvtbAMEaMoCqtL6O4WzCKSBKfVa7NLO++GZI0OcALtwnjbDDaEWCVPVEAOrmX Tx8npJ0Jb0ppTNVzS5CFYVHwzn72lVarLxz7nbYtZiFmiStAECedqR8oe248VOIP8ZKV dQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y5m9mr9us-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 May 2024 16:38:12 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44GGcB5H031698; Thu, 16 May 2024 16:38:11 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y5m9mr9un-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 May 2024 16:38:11 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 44GG032q006027; Thu, 16 May 2024 16:38:10 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3y2nq32jtn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 May 2024 16:38:10 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 44GGc6Yu50463124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 May 2024 16:38:08 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9E542004E; Thu, 16 May 2024 16:38:06 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E71C2004F; Thu, 16 May 2024 16:38:06 +0000 (GMT) Received: from tuxmaker.linux.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTPS; Thu, 16 May 2024 16:38:06 +0000 (GMT) From: Sven Schnelle To: Ingo Molnar , Peter Zijlstra Cc: Valentin Schneider , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Heiko Carstens , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/core: Test online status in available_idle_cpu() In-Reply-To: (Sven Schnelle's message of "Wed, 08 May 2024 09:31:01 +0200") References: <20240429055415.3278672-1-svens@linux.ibm.com> Date: Thu, 16 May 2024 18:38:06 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 5pjcHBMCZzEwX7JOBh20VbQir2_jpalz X-Proofpoint-ORIG-GUID: FE1He3IUYj5Qu-s1LFpWnP_-O3LLwCPE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-16_07,2024-05-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 malwarescore=0 spamscore=0 impostorscore=0 phishscore=0 bulkscore=0 clxscore=1011 mlxlogscore=673 lowpriorityscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405160118 Sven Schnelle writes: > Valentin Schneider writes: > >> On 29/04/24 07:54, Sven Schnelle wrote: >>> The current implementation of available_idle_cpu() doesn't test >>> whether a possible cpu is offline. On s390 this dereferences a >>> NULL pointer in arch_vcpu_is_preempted() because lowcore is not >>> allocated for offline cpus. On x86, tracing also shows calls to >>> available_idle_cpu() after a cpu is disabled, but it looks like >>> this isn't causing any (obvious) issue. Nevertheless, add a check >>> and return early if the cpu isn't online. >>> >>> Signed-off-by: Sven Schnelle >> >> >> So most of the uses of that function is in wakeup task placement. >> o find_idlest_cpu() works on the sched_domain spans, so shouldn't > deal with >> offline CPUs. >> o select_idle_sibling() may issue an available_idle_cpu(prev) with > an >> offline previous, which would trigger your issue. >> >> Currently, even if select_idle_sibling() picks an offline CPU, this > will >> get corrected by select_fallback_rq() at the end of >> select_task_rq(). However, it would make sense to realize @prev > isn't a >> suitable pick before making it to the fallback machinery, in which > case >> your patch makes sense beyond just fixing s390. >> >> Reviewed-by: Valentin Schneider > > Thanks for the review! Ingo/Peter, gentle ping, are you planning to > take > this patch? Ping? Thanks, Sven