Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1115456rdb; Tue, 19 Sep 2023 23:07:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGo/8P5mKdfq1mWcrSbTLwhwupFXim6HCByzYQ3OspjBMI2pdkF38/6GkY7PxZ5yPD2owU2 X-Received: by 2002:a05:6a00:2d16:b0:68f:b7f6:f1df with SMTP id fa22-20020a056a002d1600b0068fb7f6f1dfmr1999402pfb.5.1695190046370; Tue, 19 Sep 2023 23:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695190046; cv=none; d=google.com; s=arc-20160816; b=tVtU4AdQ0E2oVOR8e9N/3EF0AIW1Kg+sa+/4kopqibVzeeaHX9VKM9EShhtZQmcRMA jpPGA+bzDTKKqwA712jdqmffwTxj/Uw0hkA6MD0SXm6lXHkloeRkRMDfFoVVa7xKxm1u iqMTHvnk13Fx/xKosk4ZLza/m01Xoh5whP+DidJNNPT/2qAazocSmnqCufPdc6eSN3JV pOWA7sB04H6m4SwFM5eKc5pENVrcrsy7OQsKdQSkajfGUi96jfuLy9UPYbZZ448as9vy lfogSrrZrnNQko9NPUWeoC+eVYPWlYXeznanGmeksNibCtJgol2DD8QjkIPqlQ1lb2G1 K6gA== 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=g5QeAE66e6/eIPraNu6QOQyjX6nvU/9GMNBQ0Ke/KUk=; fh=aVJKnREZOg2XLhmUlQkbgscHvQVkot5ZlDSuOcAblpU=; b=Fd0ObiyBHjUlYPfS1W9+bLkb2xFIb382Hy8S5nrsiWRFQSPe6Uw0QgOcAdKYviemXd bvFbztafo99b2VHAf01AFGiBLr+wODcCmK2ARxBGmsYVW9j3ai2Yvg/eIBFuoOkvZgkK 2bAHhOxh2mYuxzSQUkURz7LkOqay8qUhxpVwCJJ7ce6LYdYgygvddof3O3i8+zSbInmv yJxnT03kHzxk4FKE2ox/oHtkLIStAiZNTr/+/5tzGq2uwOZXtCKt7C6SgVo49KZQKBrH zQwNJYjjygQ5z5lCktKvWLuGyNPB9RAznh6dWjhug7mDO63uGut595iNxtoxBbV8jWdf y3uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=fWxvIu7F; 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 cw2-20020a056a00450200b00690d42e334fsi1465011pfb.181.2023.09.19.23.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 23:07:26 -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=fWxvIu7F; 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 57F3C821A45F; Tue, 19 Sep 2023 08:47:38 -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 S233189AbjISPri (ORCPT + 99 others); Tue, 19 Sep 2023 11:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233178AbjISPrh (ORCPT ); Tue, 19 Sep 2023 11:47:37 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 598679C; Tue, 19 Sep 2023 08:47:32 -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=g5QeAE66e6/eIPraNu6QOQyjX6nvU/9GMNBQ0Ke/KUk=; b=fWxvIu7FKZoXqgsvtrDKoBVWxg kw8qbjMTOFnJw+ZYUoutIVucpU5xXpewuyIpcqBfRsvAu/vch2LaSP4urAsnkcwLCEEewFS1xI1nj K4qzrawhFqoD6GzNlrbIXNhCiwFHU8+ur54vvykDWwSBcD8ZUpTEFlFdCo4L15zKERXJHOsHTrp74 kA7l/SMsr2TeAY8dcLrx7KN/VrR5kSSx5mD1N3vSUa/SfDLAskEDjtwuRDBer6MWJmLiG7PAPc0Zx OpNbfZPORPzkE9W6GjoYj72CyIcN8WoPU21XIUCni7JCbQs1GaLJGuYQiob0DOjG3oY/uLk7k7Fdd gyMsohwA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qicwb-000Qwp-B1; Tue, 19 Sep 2023 15:47:21 +0000 Date: Tue, 19 Sep 2023 16:47:21 +0100 From: Matthew Wilcox To: David Laight Cc: Greg Ungerer , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-arch@vger.kernel.org" , "torvalds@linux-foundation.org" , Nicholas Piggin Subject: Re: [PATCH 09/17] m68k: Implement xor_unlock_is_negative_byte Message-ID: References: <20230915183707.2707298-1-willy@infradead.org> <20230915183707.2707298-10-willy@infradead.org> <6e409d5f-a419-07b7-c82c-4e80fe19c6ba@westnet.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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]); Tue, 19 Sep 2023 08:47:38 -0700 (PDT) On Tue, Sep 19, 2023 at 03:22:25PM +0000, David Laight wrote: > > Anyway, that's not the brief. We're looking to (eg) clear bit 0 > > and test whether bit 7 was set. So it's the sign bit of the byte, > > not the sign bit of the int. > > Use the address of the byte as an int and xor with 1u<<24. > The xor will do a rmw on the three bytes following, but I > doubt that matters. Bet you a shiny penny that Coldfire takes an unaligned access trap ... and besides, this is done on _every_ call to unlock_page(). That might cross not only a cacheline boundary but also a page boundary. I cannot believe that would be a high-performing solution. It might be just fine on m68000 but I bet even by the 030 it's lower performing.