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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B34D6C6FD18 for ; Tue, 25 Apr 2023 19:49:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236175AbjDYTt0 (ORCPT ); Tue, 25 Apr 2023 15:49:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236122AbjDYTtX (ORCPT ); Tue, 25 Apr 2023 15:49:23 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96E6C122; Tue, 25 Apr 2023 12:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=W2qCSuvha0AIH+zI7B+me9Xi6Al5DN+CF83LE1QcoqM=; b=twTKFQ7mfMKRbAYRnMQRU7KvCC iMubePOGbvKL8V4UmF1MF2soWuSgW9c0A/MgXLuKFA1bUTEc7sdSPynxdAB8RoRa5ZSVOndsd4y4R wVlii392REgQ8L1ueKClMPWGS53yRVT5im1yrpCHCN5SnmmoIBCNGhJMEq1x+jV6r6/RBF9KjfT1m STUxMfJP6vrEdwdN4+Um1JfLgI8Ri49dSXEMku7vP4Zl7lzouNKWKfV2Zmi9dSI9ZrCVJHFM9UnNb YOu+cNqhQ6D3ryVhqhJnXsoKnQQEK/q9ig/cHE4eJPPMT6IgV47aAedUXubHW5HPtad7FyOMIqj2Y y5d2wLRg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1prOf3-001khS-5g; Tue, 25 Apr 2023 19:49:13 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (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) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0B8A23000DC; Tue, 25 Apr 2023 21:49:10 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 89980241B9566; Tue, 25 Apr 2023 21:49:10 +0200 (CEST) Date: Tue, 25 Apr 2023 21:49:10 +0200 From: Peter Zijlstra To: Linus Torvalds Cc: Jens Axboe , Ingo Molnar , Will Deacon , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland Subject: Re: [GIT PULL] pipe: nonblocking rw for io_uring Message-ID: <20230425194910.GA1350354@hirez.programming.kicks-ass.net> References: <20230421-seilbahn-vorpreschen-bd73ac3c88d7@brauner> <6882b74e-874a-c116-62ac-564104c5ad34@kernel.dk> <2e7d4f63-7ddd-e4a6-e7eb-fd2a305d442e@kernel.dk> <69ec222c-1b75-cdc1-ac1b-0e9e504db6cb@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 25, 2023 at 10:20:31AM -0700, Linus Torvalds wrote: > But the more I look at it, the more I'm convinced that our pattern of > > old = READ_ONCE(rq->fence.error); > do { > if (fatal_error(old)) > return false; > } while (!try_cmpxchg(&rq->fence.error, &old, error)); > > (to pick one random user) is simply horribly wrong. The last time this came up I shared your view however Mark argued for the READ_ONCE() thusly: https://lore.kernel.org/all/Y71LoCIl+IFdy9D8@FVFF77S0Q05N/T/#u