Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5332166rdb; Sat, 16 Sep 2023 12:06:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRQW5e9QANOaqssiGGOl4Q8oAwCJQQKia11ePdtuSJhPcBVpvBpR+D3JmVmZD12VSr9K9b X-Received: by 2002:a17:902:934c:b0:1bd:f1a7:8293 with SMTP id g12-20020a170902934c00b001bdf1a78293mr3554718plp.69.1694891163821; Sat, 16 Sep 2023 12:06:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694891163; cv=none; d=google.com; s=arc-20160816; b=xx5a9iIv/mTCzCj3h5WadOJsNT7W4n71lJWXuyx6c3jbNpIm3JFglg6XrXlKNExaQa n9J4nzErO+TIJAE+HL8macCNINjpfUDuPz28DFLdpIckA9bZlIAPbCMyD+lXYsOG0jOt efGIPpKYYJO5m348drcOQQLozSwTcR++5hXdH+Gps2v6FVU46dAfKBl5VgPNiWRDu3c2 lPO1xbGpA15kKMhzMmTXassWxYYTBO3A7rDfwJ99n7FMz52iu0/zzcvJln9VsDhyTydj TGEoAYTKDhwV/9eE6U5OPPE+FTz3fs/BbV2wYY7wEtEvv60/A0281cwsbOwP/FZWl1bX BlaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=w48b1gTGXHiaqxwJXgXOFHKSen7VOnpQ1+UdzbtV8mQ=; fh=xzc49AGP2UuUySg4emyxVK77JVslpo47pwHCiiC+VqY=; b=ix0Lyvl0LlTK2g0RbKckFxg0qUOI2Tvh6KbZ7zJMmfzXz3JpcaYyvRMOjuwKDQE2xg 0/jKFyRwp32A7w2x7H79TTbQSeYmX4mASMFKofhK3XnJs2xFVZHOgKXq6XNpovFrXC3j GYUBr1hSLa8e/BnLNJvQvvyIi6mKrZPhmesysthLfEc6OTdbgoMVU1Ld3mJrzIxiqRwt zkudzXtvJmq20LBWEh0H7V1il7S5MzMmImUpPCSezV4ERCVyKzLquGH7UC6/CoICX31k OxYkhz7/jZGc2o1tN8s0Ibp6RZfTa/uhiRGi5XCqfXgZmhnYg1FSAQA1vZnXaA7Qv7+N dFzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mSUuCOpl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id v10-20020a170902d08a00b001b9eb349550si5179847plv.391.2023.09.16.12.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 12:06:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mSUuCOpl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id CF4E28087B7A; Sat, 16 Sep 2023 09:00:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239033AbjIPP7t (ORCPT + 99 others); Sat, 16 Sep 2023 11:59:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbjIPP7j (ORCPT ); Sat, 16 Sep 2023 11:59:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C32BC114; Sat, 16 Sep 2023 08:59:34 -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=w48b1gTGXHiaqxwJXgXOFHKSen7VOnpQ1+UdzbtV8mQ=; b=mSUuCOplScq5spGBc4yY1EjuuG C+5Ns+4ln0AVgDoLmm4dW2C3bau1nzQZSkJRoTq+kJi4tZNl1mPhkXfvuMSjRgc9NM1zrCZuomzJm 5Lc9LWVh1e5QLAuTK3Hx8tnZ/DdaVqJpU6X0ZBs5/kt3I/pUJgkz2fQNhred2Y9uy4XvQze7BT+C1 5npTOgn387mrIi6cQLGkUARogmX8+2Vpe8/1gpB8fw3S/HP/sSKuR74sr7xuHWSCzpkLrQksiQLBp b0N1qW+pkcz7JwohapppuB0nK9KYwRtxp8wIFD9mBTK6GEWEYrBzu4HwP8JO1CA10ObpqeXMl13qE yXT1oZ5Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qhXhk-00H0Wr-8s; Sat, 16 Sep 2023 15:59:32 +0000 Date: Sat, 16 Sep 2023 16:59:32 +0100 From: Matthew Wilcox To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, Nicholas Piggin Subject: Re: [PATCH 08/17] alpha: Implement xor_unlock_is_negative_byte Message-ID: References: <20230915183707.2707298-1-willy@infradead.org> <20230915183707.2707298-9-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 16 Sep 2023 09:00:22 -0700 (PDT) On Fri, Sep 15, 2023 at 07:01:14PM -0700, Linus Torvalds wrote: > On Fri, 15 Sept 2023 at 17:38, Matthew Wilcox wrote: > > > > On Fri, Sep 15, 2023 at 05:27:17PM -0700, Linus Torvalds wrote: > > > On Fri, 15 Sept 2023 at 11:37, Matthew Wilcox (Oracle) > > > wrote: > > > > > > > > + "1: ldl_l %0,%4\n" > > > > + " xor %0,%3,%0\n" > > > > + " xor %0,%3,%2\n" > > > > + " stl_c %0,%1\n" > > > > > > What an odd thing to do. > > > > > > Why don't you just save the old value? That double xor looks all kinds > > > of strange, and is a data dependency for no good reason that I can > > > see. > > > > > > Why isn't this "ldl_l + mov %0,%2 + xor + stl_c" instead? > > > > > > Not that I think alpha matters, but since I was looking through the > > > series, this just made me go "Whaa?" > > > > Well, this is my first time writing Alpha assembler ;-) I stole this > > from ATOMIC_OP_RETURN: > > > > "1: ldl_l %0,%1\n" \ > > " " #asm_op " %0,%3,%2\n" \ > > " " #asm_op " %0,%3,%0\n" \ > > Note how that does "orig" assignment first (ie the '%2" destination is > the first instruction), unlike your version. Wow. I totally missed that I'd transposed those two lines. I read it back with the lines in the order that they should have been in. Every time I read it. I was wondering why you were talking about a data dependency, and I just couldn't see it. With the lines in the order that they're actually in, it's quite obvious and totally not what I meant. Of course, it doesn't matter which order they're in from the point of view of testing the waiters bit since we don't change the waiters bit. > Does any of this matter? Nope. It's alpha. There's probably a handful > of machines, and it's maybe one extra cycle. It's really the oddity > that threw me. I'll admit to spending far more time on the m68k version of this than the alpha version ;-)