Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3913776rwb; Tue, 16 Aug 2022 10:50:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR5kc6MF1wqO9YtHMzAPDOVOp6pNVRrebwxXsPm+XCTh5VoTMhvFZvFEMo/apZ8K8R/0rNG0 X-Received: by 2002:a17:90b:38c9:b0:1f7:28bb:aa1a with SMTP id nn9-20020a17090b38c900b001f728bbaa1amr33321526pjb.204.1660672256959; Tue, 16 Aug 2022 10:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660672256; cv=none; d=google.com; s=arc-20160816; b=cSZ78YIMRQuHQswIICeTJ9L6d4XTvCFZAO0DZRCd8tG433a9YB9ynRdL04wrwZWmdI 3FsTrHvIVY4hJKrFKl24iumxjye7dNxnpM52LsKLkHKdbJTLiW1X9ioI7MZU3kSYQLnR mHHM/8dbx1MCvvwIw6u9xQlLd1kdR8cBGHwhXVfdr2NLbp4SlRZCsJw2iSCB/Alw6B+S hN8SjuKaV54VtcPAsHotN4tO+xcYv/LsbQm8rvfBy5gqG9OlNOpLpvHG27bKo7yzvmfE 4kNYyAIEtQnSTUg8HmJWiweM/IFgD7MTHIAX7X41a2wnX61EWaTmm+uyR47MNYiu2VxD qg9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=j8SjbcbuW/hqdPMvG4aWiydnbpp+f9ZFcTiRL0CuZ8A=; b=uvcDU2Pt5WplDsXmctddNISsZS2Ko8jHe5U9iwO0B3Jylm9zHSOijUyveeeukmvmx/ I1pt2FukkBEXezXNGOuHYtjBODEe1DeY4HiFL2PB774/+OuOTMnpaee5gWWjPozHskct 1Si33EixCnKjo5VLUi+/7A6NvD4BK6EHe5+XTpmo/yvDJkQoNCH9nhCNkSDCUQCWR3JX 3SBZ3FSD9xL8WUo+tBLxYhO6BEjiPgSbOBjHSCw+j8BrjR537+FJjd1bNqa3AMhcnXmq sPDgcdpsUtw6CqBobP9zVhRk2/CUYZUwfjMM6vvBNi7VNqjMzsh30KYO62deGhEFTSzP pncQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b="NDT/wfyL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22-20020a1709029b9600b0016be593d1f7si11953060plp.313.2022.08.16.10.50.40; Tue, 16 Aug 2022 10:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b="NDT/wfyL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236083AbiHPRWA (ORCPT + 99 others); Tue, 16 Aug 2022 13:22:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234836AbiHPRV7 (ORCPT ); Tue, 16 Aug 2022 13:21:59 -0400 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EC1A7C301; Tue, 16 Aug 2022 10:21:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 03A7241A42; Tue, 16 Aug 2022 17:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1660670515; bh=b4EG0LTa8HIU16A9LTbhnmpSiFXMqiYjr5/PwslTjn8=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=NDT/wfyLBeksVX2whoG656IQBELw8GrtdHHV+e91oqOaTh4aoCoJMqrimcMRgCKMm jcPpxORLtiwU3jdv6kY4lb55rhK3SnU5u1d+ViIbpE214Gx0s6jL3euXb1ZUcCmhqN hP6mAI8e2e2qYlB9F3LLuUKfbb02+QKOr+/idlac/vUYib2MgR6/sPAWyHNQsMJTy4 M/dk7OBEaK4kb2/93j6+4ny+f0Hd4mctuYhUIj/zJacFroP12Rh3t19U58un/RGvRB Zoi8N98LHEmAz3ocSL2lfxyODbctXAaeyrzL81rVK9vPMT1CMn58xSMgum03QxIQ+r lfGz7DmjJG3uQ== Message-ID: Date: Wed, 17 Aug 2022 02:21:48 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] workqueue: Fix memory ordering race in queue_work*() Content-Language: es-ES To: Tejun Heo , Herbert Xu Cc: Linus Torvalds , 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, stable@vger.kernel.org References: From: Hector Martin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/08/2022 01.26, Tejun Heo wrote: > Hello, > > On Tue, Aug 16, 2022 at 12:15:38PM +0800, Herbert Xu wrote: >> Tejun Heo wrote: >>> >>> Oh, tricky one and yeah you're absolutely right that it makes no sense to >>> not guarantee barrier semantics when already pending. I didn't even know >>> test_and_set_bit() wasn't a barrier when it failed. Thanks a lot for hunting >>> down and fixing this. Applied to wq/for-6.0-fixes. >> >> Please revert this as test_and_set_bit was always supposed to be >> a full memory barrier. This is an arch bug. > > Alright, reverting. FYI, Linus applied the alternate fix directly to his tree already, so this is fixed on M1 either way. However, you may want to pay attention to the discussion about the subtlety of the workqueue code pairing test_and_set_bit() not with clear_bit(), but rather atomic_long_set(), since it *could* imply it is still broken or might be broken in the future, on other architectures. - Hector