Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1153090rdb; Wed, 20 Sep 2023 00:40:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8rnHKB53tCRDADVKV5gO+6nS6iCWrdzNrrBOhZ76vvketoEUs9dm7W5KyI+N8eBAHg742 X-Received: by 2002:a05:6a20:cea3:b0:14b:f86f:d9c3 with SMTP id if35-20020a056a20cea300b0014bf86fd9c3mr1542634pzb.61.1695195630829; Wed, 20 Sep 2023 00:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695195630; cv=none; d=google.com; s=arc-20160816; b=rUnZhv1KqJ71bC0s/H14QHM+lQoxOlDml/dnwCk44MeU1NZ/TeBuVTih9dxykNxao4 mqp/Tv+P9X2CREb130biWHlabkaO4pg9hvsxQ4C9a0iagVKG/Jcve06edHkeKudOTswZ H6UUS/B18FU8JKbd5s5R53vZV0u9JIuw3UdGT8aN/Y4/m+pOJcAHP4uopxPtbk0aWFtD A6bph4qR/1gYflAh4KkcrIrywBsAI8L+3lql3qlTIu/7w+bZcSxS2o0lcCqsjvf/wLtA 6Ckw++EUfT7wm6xiErYgY1mlUFgeubujw0jLSo1/FEAkKNgOTcoFTV/6YDPPIJuiirSP fF0A== 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:ironport-hdrordr:ironport-data; bh=AR+MR+aj4wCfZ9BB5j8lcpyPlZubKYYx0XWzE26q4EE=; fh=+GC255zxq40hnriy2wNDVBlj65mIcc2ZiuJnbdqP1+g=; b=rS60D/4MbzTPm1vrkCluFL28CF5eQje/WWnWzG7/+1iIpC0TeaZLIpdGZRsPepHNm/ cczWLA4Yko1DzhE/fnjGf3iPE8Tfng9YH3o+/I6cDGXCRfGYlCVQRnqekskL1OFWYqWs DH/PXfl6+8L8iyRiVKq1sNlmdu6s4We2GDY7ZoYvDQt9Ukn4iCqVWKQcqEA6Dsk78lU3 RITwX6X1X06iJCgVqB/PwPI2xuws2wQ3owfnIH7orwOKi34ovSZSLq7bKE5DF6PHg0ms 2uY1ixyoczkmKy8rKqSGVWDaLF6Vek9Xe4wUc5MpnjyrY+7qU6y3zFeUKsoYPlFZwLEW ng6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id lc15-20020a170902fa8f00b001b8c47563e7si11068391plb.28.2023.09.20.00.40.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 00:40:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 97B4E80A21B7; Wed, 20 Sep 2023 00:16:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233602AbjITHQO (ORCPT + 99 others); Wed, 20 Sep 2023 03:16:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233567AbjITHQM (ORCPT ); Wed, 20 Sep 2023 03:16:12 -0400 Received: from icp-osb-irony-out2.external.iinet.net.au (icp-osb-irony-out2.external.iinet.net.au [203.59.1.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1C4A993; Wed, 20 Sep 2023 00:16:03 -0700 (PDT) X-SMTP-MATCH: 1 IronPort-Data: A9a23:XOu7eKvTXW8iBOuehyK7C8uvTufnVHxfMUV32f8akzHdYApBsoF/q tZmKVkyQEty1hlBgm0KGI+zxf6LyZfVzubXKHJtqTc3CSgiRfPtXbyxNl33Mz6ZMvrNRUdm6 9R2QtTbJajYdFeFzvuWGuan9SMUOZ2gHOKmU7aVYHgpHGeIdQ964f5ds79h6mJXqYXha++9k Yuai9HSPlajxwl1Pgo8g05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKEpfNatI88thW5 gr05OrREmvxp3/BA/v5yeyjKhVirrT6ZWBigVIOM0SuqkQZ/HRqis7XOdJEAXq7hQllkPgh4 +ROkaWPZzt4Ba/jmrowCzpDTgNHaPguFL/veRBTsOSglhycNSKyk7M2ShtsCOX0+M4qUScQs 6ZCdnZXNkDra+GemdpXTsFjnMksMc/kMZkSoFl/wCrFC/s6B5vERuPD+Le02R9s2JwRQa6BP ZNxhTxHc0nJXgVsOlMtB7kbruSEgGm4ImIBgQfAzUYwyy2JpOBr65DBOcTUdpquTMRanlqwr 2nb+23zRBodMbS31juB9mOEh+nBhyr3VYseUrqi+ZZChFyV23xWCxAMU1a/iee2h1T4WN9FL UEQvC00osAa8E2tU8m4UQa0rWCJujYCVNdKVe438geAzuzT+QnxLmwFSCNRLdU8v88eWzMnz BmKksnvCDgpt6eaIVqB8a2KpDe+IgARLGkfdWoKShYD79D/oYY1yBXVQb5LFra0gdL0Hxn/x jmLqG41gLB7sCIQ//jruA6C2Wjy48KRHkgp/grWGGmi60VweeZJerCV1LQS1t4YRK7xc7VLl CFV8yRCxIji1a2wqRE= IronPort-HdrOrdr: A9a23:EEVSbKwHnZStNrEIjHS/KrPxceskLtp133Aq2lEZdPU1SL3kqy nKppkmPHDP6Ar5NEtOpTnCAtjnfZqkz+8X3WBJB8bBYOCEghrNEGgB1/qZ/9SIIUSXnYQw6U 4HSdkYNDSaNzlHZKjBjjVQXOxQueWvweSDgaP3yH9pXRtrcchbnnlEIzfeOEkzaA5YCZ8+DZ b03Ls3m9MMQwVuUu2LQnEZW+DCotfPko7qJQUBGwMqgTP+/Q+A2frzDhyR3hIVVjVSzPM56G DA1wTy+6WktJiAu2Ph/l6W54lTkNvlwN5EGMHJkNEcLnH2hh+vf5kJYcz8gBkl5MuUwBIBlt 3UphcpOM5+r0nWYnq+rXLWqmzdOXIVmgTf9WM= X-Talos-CUID: =?us-ascii?q?9a23=3Ac1ftf2txNmga8BbjyaJu4dSW6It1WUze6E7vDXP?= =?us-ascii?q?pMmRGSuO4EXyLpYFdxp8=3D?= X-Talos-MUID: =?us-ascii?q?9a23=3A8R4XtQ+LKed1SuVxQbwxhIeQf9g16pm2K0AJq5o?= =?us-ascii?q?tnvuHGSpgfGbC1R3iFw=3D=3D?= X-IronPort-AV: E=Sophos;i="6.02,161,1688400000"; d="scan'208";a="464740721" Received: from 58-6-226-208.tpgi.com.au (HELO [192.168.0.22]) ([58.6.226.208]) by icp-osb-irony-out2.iinet.net.au with ESMTP; 20 Sep 2023 15:15:57 +0800 Message-ID: <1b677562-929c-62f7-353d-80af3c30c7c4@westnet.com.au> Date: Wed, 20 Sep 2023 17:15:56 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH 09/17] m68k: Implement xor_unlock_is_negative_byte Content-Language: en-US To: David Laight , 'Matthew Wilcox' Cc: "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-arch@vger.kernel.org" , "torvalds@linux-foundation.org" , Nicholas Piggin References: <20230915183707.2707298-1-willy@infradead.org> <20230915183707.2707298-10-willy@infradead.org> <6e409d5f-a419-07b7-c82c-4e80fe19c6ba@westnet.com.au> From: Greg Ungerer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 20 Sep 2023 00:16:17 -0700 (PDT) On 20/9/23 01:57, David Laight wrote: > From: Matthew Wilcox >> Sent: 19 September 2023 16:47 >> >> 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 then the 'firmware' silently fixed it up for you a few 1000 > clocks later... > >> 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. > > I do remember managing to use 'cas2' to add an item to a linked list. > But it is so painful so setup it was better just to disable interrupts. > For non-smp that is almost certainly ok. > (Unless the instructions are slow because of synchronisation.) > Otherwise you need to use 'cas' on the aligned word. > Assuming coldfire even has cas. It doesn't. See CONFIG_CPU_HAS_NO_CAS in arch/m68k/Kconfig.cpu for how m68k deals with ColdFire and early 68000 parts not having it. Regards Greg > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) >