Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3824759pxb; Tue, 17 Nov 2020 04:42:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzq8BtU6lCGgqniX9UkbSdDF5QHsYhtaVazGUoxo832u260EcChQqYrHJr9hiQkVwP4d111 X-Received: by 2002:aa7:cd41:: with SMTP id v1mr4097881edw.147.1605616944789; Tue, 17 Nov 2020 04:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605616944; cv=none; d=google.com; s=arc-20160816; b=XXw40CVu8EjgPn362SKr3LRSopzrOuKgSJsirIZy4DaCPj0j5cR7girmpOc33xP4Bo m//O+5L3cObDIaPFmzy4WT6R/hMW5281xwzkmWyAoIc54STlFbE4MI6LlK7ejsYuG2Dl uHR6Q+eoE+a+4ZNC/Vwf/DoD2DXEECEf3FhHLn2M1QwYEq5LA8B+BGPhcJs9CU1daDgG 7xmLNQW8HsTiBY9ibWUN1/FP7NVSJ8UDw5T4kTEwv2phdO5g02NoaLbhAr0Fryel+Xaa Rt7Di+clLlQUBX+HuEFijlhasLM2vtxTqZACBtRscajNDPhQdjilKeUwYBUYKTBUr6ih 1s0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=9EOPT3A+Cmjo2mgWriaUSHzejxYcLU9jXOqF5b+Fhoo=; b=aNAQ6iNeLkU2wuBt3gRkh3NTqeC8Ad3KROO1INxw0eyVoXE6yARU4FwM9qi3mtjAh+ inGeJmgUXAPVwjyuk3E11Q9/6eSH7gtOMXGViP4zZ9kY0MauTVx3TjeQwbT1QxqGlfVP R1fE5SisKf1VeqTXM7L02rh3XfMlomc43xQEQM6KMTpGXIf4OhwkMHX9K6SiEZxnTxC3 C+TU6Ckk/RfLFRGObsk/Isy4GsXZqiZwe0RCVMaNuUZ+B78xdSnACE5sE30vnot/C97p WF4U7N1f727t2MCyAILnv669JvweYlA+QjCdjwi1WlnLxdn67CIAvF9CgJuLJCAqmKVz 99cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si14360354edq.430.2020.11.17.04.42.01; Tue, 17 Nov 2020 04:42:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726360AbgKQMkF (ORCPT + 99 others); Tue, 17 Nov 2020 07:40:05 -0500 Received: from outbound-smtp31.blacknight.com ([81.17.249.62]:35171 "EHLO outbound-smtp31.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725779AbgKQMkE (ORCPT ); Tue, 17 Nov 2020 07:40:04 -0500 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp31.blacknight.com (Postfix) with ESMTPS id E7BAAC0EE8 for ; Tue, 17 Nov 2020 12:40:02 +0000 (GMT) Received: (qmail 18795 invoked from network); 17 Nov 2020 12:40:02 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 17 Nov 2020 12:40:02 -0000 Date: Tue, 17 Nov 2020 12:40:00 +0000 From: Mel Gorman To: Peter Zijlstra Cc: Will Deacon , Davidlohr Bueso , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched: Fix data-race in wakeup Message-ID: <20201117124000.GY3371@techsingularity.net> References: <20201116091054.GL3371@techsingularity.net> <20201116131102.GA29992@willie-the-truck> <20201116133721.GQ3371@techsingularity.net> <20201116142005.GE3121392@hirez.programming.kicks-ass.net> <20201116193149.GW3371@techsingularity.net> <20201117083016.GK3121392@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20201117083016.GK3121392@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 09:30:16AM +0100, Peter Zijlstra wrote: > > sched_psi_wake_requeue can probably stay with the other three fields > > given they are under the rq lock but sched_remote_wakeup needs to move > > out. > > I _think_ we can move the bit into the unserialized section below. > > It's a bit cheecky, but it should work I think because the only time we > actually use this bit, we're guaranteed the task isn't actually running, > so current doesn't exist. > Putting the bit there has the added advantage that if the bit existed on its own that it would be very special in terms of how it should be treated. Adding a bit adjacent to it would be potentially hazardous. > --- > Subject: sched: Fix data-race in wakeup > From: Peter Zijlstra > Date: Tue Nov 17 09:08:41 CET 2020 > > > > Fixes: c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu") > Reported-by: Mel Gorman > Signed-off-by: Peter Zijlstra (Intel) Thanks, testing completed successfully! With the suggested alternative comment above sched_remote_wakeup; Reviewed-by: Mel Gorman -- Mel Gorman SUSE Labs