Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1374504ybg; Tue, 2 Jun 2020 08:18:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9Ddu8OLRzfoVlzV508q0jiHu22V40jmqIxZ6jCjhSrAGizEPNyGq/ZtICO/E6zYvEp3tT X-Received: by 2002:a50:a7a5:: with SMTP id i34mr26313021edc.55.1591111119721; Tue, 02 Jun 2020 08:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591111119; cv=none; d=google.com; s=arc-20160816; b=HAcN9fBNSeZ4kn1o7Ioc4T/tNnsWKllW78mQpa7Nut0Vl0E50w2oB37uWof0nqHoxz bG8kFl9yYde7TofMV++0ZxYxKMsrRDGyHhtBRK2g6V9g2RPTGpfyuMunSz0OYV+Oyrjr WpDJvnI3qekeMrbwh2HFSzzkZc+vs6iepUlgY44tj3+bwuXZsvpLnW6svD3u+NJRYYJ6 BN6euuafpMZLi65x2gQ5mn4Vz9hZfzLgSQfRsGKhCgKSykOKrxVMeny0Ppv+xl7WKg0S G0z4pKDjeIshSGnpjrtYt41DfFlVqzcUmivea3lFoclvKUwPxj67ynKFSc9KF6AtHiJl whLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4KmAR/zHaD1DqBJ6Dg+gYmbguIMOABO1yI8kuQaGV5Q=; b=eGc9aDsq9ZSSui0I/lmzIFug44jC0ynI2o949YRtT3SB4Ydxj/rGj6PqDOEu8y/M+f c/kMzwsKJRUcbjceJxEmMZnZSk3ylig6ml6sX21yvT+5WosbXl0j55iAC6IhaFyHSnjx WPpUycOvl0WY7Aa2VB2WH34s0R/vBaNLKc+7Tax439+8A0zdqy3zbyamavYeB/rbxlJX Li+edsHQTxJ+GDJKb3ZN6rXCYpZupOtlljL0cUZMBrc+62Llcb+rWZYDSdrouul55EO5 LS2/B+vr1OXJ1b1te3Fzrf8ZXwnupANyLePIRrB9Bk9Xkh3Ahi06ZhNRlAdjtWi07d91 aGyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fUjlbRWj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm20si953402edb.457.2020.06.02.08.18.15; Tue, 02 Jun 2020 08:18:39 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=fUjlbRWj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726261AbgFBPQL (ORCPT + 99 others); Tue, 2 Jun 2020 11:16:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:35196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbgFBPQK (ORCPT ); Tue, 2 Jun 2020 11:16:10 -0400 Received: from localhost (lfbn-ncy-1-324-171.w83-196.abo.wanadoo.fr [83.196.159.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F2E0D20659; Tue, 2 Jun 2020 15:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591110970; bh=uD50gjeRCke3xI9ptDSmBKRgTyqnBCJf/ONhGVmapuU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fUjlbRWjEvt5bHb3gxXmOsU9FYt6taYPjvjrqpaJu3GcALFBb16k4R5sJayjroY3O 3MwnClqmPSMMKL58bAKM8D+ZTMjUYshowTK2rffheUvRlkWvARmUJX+FnB+Itj2Yic akY36VY6dcjssdOwAsvIK2EGqAdjTgjqlZ/CWT7Q= Date: Tue, 2 Jun 2020 17:16:07 +0200 From: Frederic Weisbecker To: linux-kernel@vger.kernel.org Cc: linux-tip-commits@vger.kernel.org, "Peter Zijlstra (Intel)" , Ingo Molnar , x86 Subject: Re: [tip: sched/core] sched: Replace rq::wake_list Message-ID: <20200602151606.GA26002@lenoir> References: <20200526161908.129371594@infradead.org> <159100513859.17951.5366888281495604529.tip-bot2@tip-bot2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <159100513859.17951.5366888281495604529.tip-bot2@tip-bot2> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 01, 2020 at 09:52:18AM -0000, tip-bot2 for Peter Zijlstra wrote: > The following commit has been merged into the sched/core branch of tip: > > Commit-ID: a148866489fbe243c936fe43e4525d8dbfa0318f > Gitweb: https://git.kernel.org/tip/a148866489fbe243c936fe43e4525d8dbfa0318f > Author: Peter Zijlstra > AuthorDate: Tue, 26 May 2020 18:11:04 +02:00 > Committer: Ingo Molnar > CommitterDate: Thu, 28 May 2020 10:54:16 +02:00 > > sched: Replace rq::wake_list > > The recent commit: 90b5363acd47 ("sched: Clean up scheduler_ipi()") > got smp_call_function_single_async() subtly wrong. Even though it will > return -EBUSY when trying to re-use a csd, that condition is not > atomic and still requires external serialization. > > The change in ttwu_queue_remote() got this wrong. > > While on first reading ttwu_queue_remote() has an atomic test-and-set > that appears to serialize the use, the matching 'release' is not in > the right place to actually guarantee this serialization. > > The actual race is vs the sched_ttwu_pending() call in the idle loop; > that can run the wakeup-list without consuming the CSD. > > Instead of trying to chain the lists, merge them. > > Signed-off-by: Peter Zijlstra (Intel) > Signed-off-by: Ingo Molnar > Link: https://lore.kernel.org/r/20200526161908.129371594@infradead.org Looks good, thanks :)