From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 722E4C25B0D for ; Tue, 16 Aug 2022 04:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=cXNHUnudUM+govlYonLK9+0PWLTF8VqVZdLnnweRvqc=; b=IOty/pi/CSIVIY OJNzqYjvHNXnYk64X/h0B0AUFE1O/RGQH5ZVebSoEUvSbrntfrUxd9ZD+XV33lYRJ04Hsu+gPMVAD pBNXL8IuCoVKrXNa2RSgJYwisAFiCYYgch0/shK0desCD7Lnhpx8r3gulZY2dkTipBqf9q6mWyl4n tk9lQ0/c4UulLFPhM57d61fZve3L9Uik8QE5pbpJ4e0LuGuKNtCrBnUu1DSafzYNRuktCObZxJ1Zq pLM/3bRpMXJsL57quvoa/XHxxfrwAaLjUQGSkErTjuMYShhgzaFaGRAT/q7EmGpxBEPX9fXWPuvw1 98ISidf/QDPOcftjKv4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNnzG-00AOv2-Ce; Tue, 16 Aug 2022 04:15:30 +0000 Received: from helcar.hmeau.com ([216.24.177.18] helo=fornost.hmeau.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNnzC-00AOoK-1F for linux-arm-kernel@lists.infradead.org; Tue, 16 Aug 2022 04:15:27 +0000 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1oNnyh-00BTJZ-RG; Tue, 16 Aug 2022 14:14:56 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Tue, 16 Aug 2022 12:14:55 +0800 Date: Tue, 16 Aug 2022 12:14:55 +0800 From: Herbert Xu To: Hector Martin , Linus Torvalds Cc: tj@kernel.org, will@kernel.org, peterz@infradead.org, jirislaby@kernel.org, maz@kernel.org, mark.rutland@arm.com, boqun.feng@gmail.com, catalin.marinas@arm.com, oneukum@suse.com, roman.penyaev@profitbricks.com, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, marcan@marcan.st, stable@vger.kernel.org Subject: Re: [PATCH] workqueue: Fix memory ordering race in queue_work*() Message-ID: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220815175810.17780-1-marcan@marcan.st> X-Newsgroups: apana.lists.os.linux.kernel X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220815_211526_084735_44E80663 X-CRM114-Status: GOOD ( 11.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hector Martin wrote: > > This has been broken since the dawn of time, and it was incompletely > fixed by 346c09f80459, which added the necessary barriers in the work > execution path but failed to account for the missing barrier in the > test_and_set_bit() failure case. Fix it by switching to > atomic_long_fetch_or(), which does have unconditional barrier semantics > regardless of whether the bit was already set or not (this is actually > just test_and_set_bit() minus the early exit path). test_and_set_bit is supposed to contain a full memory barrier. If it doesn't then your arch is broken and needs to be fixed. Changing this one spot is pointless because such assumptions are all over the kernel. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel