From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) (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 8DE7F1AA781 for ; Wed, 8 Jan 2025 08:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.60.130.6 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736323853; cv=none; b=rhgJyxEMP3HA9u4AvDDhtle5qAzOWcQPlQHs0OtUxxbpjDUknC8MqyNgvXxFaKUTK90G+UxDlXNmlwUAse/AZxT3yizC+o7kvJsTu8RZP2y/UcWKu0gin11RLRDgnJauBvsV9P3vqzBVjRRTa9TSwxhv1VRT93OM+SP4r9/EMRk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736323853; c=relaxed/simple; bh=ahRek78NrD893DQW9l3GQ+8CiFlWuzQvANwgfscZRoU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kH4/Ykxz6bUZGp8AMwBGD5TN5bKpb3RVTHlx9dJea+h7F9e8pxGy3JR7lF+rCVLa7OwxPywUPar+Gm5NxnR2T1unMKmIySH/Q03OufemP98NQ0esw/KF59f36bX1+0Rbo4xGfMNfH8n9+nQkPvMoj/Rp4zT27Ih3Z85MGQguefk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=cSdTWG+R; arc=none smtp.client-ip=178.60.130.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="cSdTWG+R" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3BbNGLg2o5raCNSGcEWjn5f4gh1Vq2hKrggldsd0Vt4=; b=cSdTWG+RLNRgNDDJNeusqK6i9f n4UNftWb6ERvzV5UUx1jG94pXLBCeDqmeD4oRi6C8yqgZmujBFuhUIprlyP8Fbnn15qXz0fPxhbO8 8tgTh1EHjQPlRU1uBOLZ6byMAIExxSbawYMCwXI8UKd4EBOoRG5DO6c/kmZUf6IYDFCXlwzx5+RFw 7XrSBMIV+7O+GZDPo48rjHGdW4guH2+VyePxJVFo0s2nsFGhJNNAW3kJDj3GOIJUXaih5g4MamHOB 2DoWEfdK5ncPh86mxMkA9puKAsAiRnT4ESX5k+2cf+loCv4S26d9z7h+NubLLI0J0j8vttDgcHb26 DOf3hxcQ==; Received: from [58.29.143.236] (helo=[192.168.1.6]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1tVR9F-00D38c-AB; Wed, 08 Jan 2025 09:10:41 +0100 Message-ID: Date: Wed, 8 Jan 2025 17:10:36 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] sched_ext: Replace rq_lock() to raw_spin_rq_lock() in scx_ops_bypass() To: Andrea Righi Cc: tj@kernel.org, void@manifault.com, kernel-dev@igalia.com, linux-kernel@vger.kernel.org References: <20250108025521.85877-1-changwoo@igalia.com> From: Changwoo Min Content-Language: en-US, ko-KR, en-US-large, ko In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Andrea, Thank you for the review and suggestion! On 25. 1. 8. 16:16, Andrea Righi wrote: > Can we include the warning here? In this way people that are hitting the > same warning can search for it and find this fix. Sure. I will add the warning message. > > Moreover, we can also add: > > Fixes: 0e7ffff1b811 ("scx: Fix raciness in scx_ops_bypass()") Will add this in the next version. > Maybe we can also do this here since we're already holding the rq lock and > irqs are disabled: > > /* resched to restore ticks and idle state */ > if (cpu == smp_processor_id() || cpu_online(cpu)) > resched_curr(rq); > >> >> - rq_unlock(rq, &rf); >> + raw_spin_rq_unlock(rq); >> > > And remove the following: > >> /* resched to restore ticks and idle state */ >> resched_cpu(cpu); This optimization makes sense. I will change it as suggested with one minor change: I will flip the order in the if condition as follows since cpu_online() is more commonly true: /* resched to restore ticks and idle state */ if (cpu_online(cpu) || cpu == smp_processor_id()) resched_curr(rq); Regards, Changwoo Min