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 502B9CE79A8 for ; Tue, 19 Sep 2023 15:47:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233179AbjISPri (ORCPT ); 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: Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org 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.