Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp329583lqo; Wed, 8 May 2024 00:31:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVL7Z1V0JubdFfaTaJ9IqYyPiwhR1Cwzh17Cacwnfxkh2IGuCuaxn81VlQwsziItzSzv4RtkxAyJ7Algx2qCQI50JBslT2Pk3lwTqs3ew== X-Google-Smtp-Source: AGHT+IEMeMlQdk0kILuBQbXC0nzXnWg3xoiF6S4GBjMSIYhGmL3CiyJ+Re3DjT2R4Ry4bP0dzAJI X-Received: by 2002:a17:90a:d503:b0:2b1:af14:a92d with SMTP id 98e67ed59e1d1-2b6166c39bfmr1984958a91.27.1715153493338; Wed, 08 May 2024 00:31:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715153493; cv=pass; d=google.com; s=arc-20160816; b=RCh3GjtnLfONIkmd9CQ2kcuBqdiR3RoRQ9en0DiLKbWCR4588/4PS3f7avbwFFX1ON l+jorddry1p198y6JObk34ZrVcme4Bt5o4uO8saHT6oLQnooXkkmd6PCq2qEvcuJb4DA TQgMPt8eZuOsP+/KO3H0pruj+wi5wgssF2t1oA2462RkHjz404lzSLWm4SFuBlKmg4dW M2ljjXuivs1OcEX5z7dq/lmSvAVTbZHrQISNOSWVc+tthkaC0ALxSoZCSw3/jQTfsOgT qCFA5KNJfrWS5V7f7e5+s1O6Gu41Dvz5gCVWLYv4xlNOu+MHoD/2jqTAOAvNj43LBFDb uSGA== 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=t2f0wotfwBV4tNtAR6+IXWVQwGTlmNIE9DFhCSDIK2w=; fh=LnGIUOCmv8MIjfUVmC6HbWIpoHIIB3vp1Rz+JjKYPds=; b=AyGWQ6MTCEfB7v2dJC721ag09cePmu880KwYevdJdUnrsAKL6Os3QOLO9zQs1zTVM5 Hj1dDk8S2Q4aiXCg/Il9z/id5z1qt9RHJI+PKE40dvGnZNeBFa090tG/lV7Adf5ZckFT 6r/j8tQnMbRHp5Z8/5b3y3rRtu2XFmLX5BoKlmaVI78gnu2t0mhnRtrgtXfjJC8BCVKA p1Sbos/M4Al/ZAwY6VsorIw3Sddyfu2KuJyvm/wB1RTq/twDrnLlk/jW96o/GHmFF8I/ MDCGdYKYDufbmGdUqiHvbkAFXssfRE++6YFvXYwM5XjiCAwHP06H7hFigO89f3n2iuVt ky+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=qKZTgCAt; 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-172813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628a5c7dbsi830556a91.47.2024.05.08.00.31.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 00:31:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=qKZTgCAt; 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-172813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172813-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3CE9128170F for ; Wed, 8 May 2024 07:31:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D34132C6B9; Wed, 8 May 2024 07:31:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="qKZTgCAt" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 A32B32BB0F; Wed, 8 May 2024 07:31:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715153484; cv=none; b=Fy/NvOLNjlZT0nhvan/1agmIPNW2s1Fm5pDE13vNjJBurMgOYjoh1Q0kOmGM1sN4qwH+i3TIG/iq403haNHxBBKfD8EYXHOV66jFUOcwYoL4NQr+gATcChUVE3PhZyMags0Zt5nJmbqfexdGzpfTxiI5SSWEFBATybZcowawqD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715153484; c=relaxed/simple; bh=2/B1AvDbPYoRKpM4N7vRpJx55synkX9n2MdyVbBvh5U=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ECZuNnH8Ee9wkgAok8YsRl9nD6TfSQtCSeVCj2lvYXjqCOTDhutknL8JlL2iCVf/fHM8bbGL1R6DO5OHorugxYI2dcvWXdYlkAlpvC2TsBrw003adaNV4OKKZelFu1S1+x5wdqXK35PDi5ecMh17CuD6Irba148r3i4gdsao1p4= 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=qKZTgCAt; arc=none smtp.client-ip=148.163.158.5 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 (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 448734Ro022337; Wed, 8 May 2024 07:31:07 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=t2f0wotfwBV4tNtAR6+IXWVQwGTlmNIE9DFhCSDIK2w=; b=qKZTgCAty/huNtPFxKZoHg4PrWfmka98WU0x4npDvhynFuVqUAIElOoH5ClGX2kcWaiJ GC82o3658dWz5nvcNjT41/MWJkOy4jMxCRWJRpzNxUdRwAZLkzBA0qlbvM8TA74f7WVK KRkZNRKnjbRXh6G8lHdd1aPKkDUis2MSGIO5exb9IMR6VmX0D2AKFhUHtdvN+czNlksS j9BEzaM2zxhJRQQfgmS2wqV1VUL8tFT+O4BiUipCru3S6Ujb6LgwF09Xw+tw01/AhNwF LadpIOvfl8ZIoohcBGF291xC4fozK602BCo/2sG/vnVKSDKTT2DWTwzxXEud3hJhd59z jQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y04nnr2ta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 May 2024 07:31:07 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 4487V6wP002988; Wed, 8 May 2024 07:31:06 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y04nnr2t5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 May 2024 07:31:06 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 4484VvXI026664; Wed, 8 May 2024 07:31:05 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3xysfwkcwp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 May 2024 07:31:05 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4487V2fg25101004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 May 2024 07:31:04 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E8D9E20043; Wed, 8 May 2024 07:31:01 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B9842004E; Wed, 8 May 2024 07:31:01 +0000 (GMT) Received: from tuxmaker.linux.ibm.com (unknown [9.152.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTPS; Wed, 8 May 2024 07:31:01 +0000 (GMT) From: Sven Schnelle To: Valentin Schneider Cc: Ingo Molnar , Peter Zijlstra , 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: (Valentin Schneider's message of "Thu, 02 May 2024 17:57:50 +0200") References: <20240429055415.3278672-1-svens@linux.ibm.com> Date: Wed, 08 May 2024 09:31:01 +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: zL9zjBJQejBI0Pl9aBSvDVgQHV1GXQ6J X-Proofpoint-ORIG-GUID: 7EJyJOe8lqN3UDWbP2TUSCtlnI3kCFJr 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-08_04,2024-05-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=560 impostorscore=0 clxscore=1015 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405080054 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?