Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4885453rdb; Fri, 15 Sep 2023 15:51:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0ULiiPeGfbMgI83Bfn60HasJd56lf3aN3f2e2Uuxj+lM1LdxaggC/KSfdrf49YQtoEk8j X-Received: by 2002:a17:902:e886:b0:1bf:349f:b85c with SMTP id w6-20020a170902e88600b001bf349fb85cmr3161115plg.1.1694818264233; Fri, 15 Sep 2023 15:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694818264; cv=none; d=google.com; s=arc-20160816; b=Kn9wVzijUMr3Nw3+f6qB3ubL3uYOt3IWYfgFLPTRzBYa6v8pldcBufzf3mDZD+V9vj zWF+ywLMCsGOrIIFS7zJhZEjQxbL/IMcz5Y57vH5u4x+5OOLfAxnrC5kNnZUiEFSQdf/ k+5jN2Tpv85qzZzgiJlnr96V5Q5wwaF6h8uwxOJl/T5P8dQbExw2cHAslXiYamRw2Ad7 Ev/vG1j21euy6m9xX7ucMCO6Oi99IqVe1gBMbmfBT+EnL/wtcLBAeFSj21xRYOcTa92k sjI8G1dUg7H+6/f4dGalvWQLrT4z8EpTr0vswWgORjtnMlp52VDZlvZ8LCo1EmKOtdcL yQiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NoYAPE+UO7xNrTZ3UFo3zibiwdFupzttBoXxylMj4Qw=; fh=Exu8p2J0bt/MoYkEByA/Woj5EWTdUoRsvJYmK88z1hY=; b=aZlapefOA9WGa+cVBwvReNnxxPVZCjV8E8kJwnDItyQCX5uUXA+rb5+lD3+6J3B9f1 a4h9ulog4a7/WgnwtTdY5GtDRonedm0vhc2OKfeNFz88E+xahmoB0nPyyGM4JXZvdNTz lq/QCc34iD7wun8yHMF64jxSRPZD4c5TOSRh3AaOarxXBmERclluTd8cXL4trSHH1Wq9 gWtAmZxAt5peSopiE+zXgpzIs7LJCegEKRDqLhJO7ympAF7ZRuGLu7xHpu9VqGQ6pTXh kASyjE79ZX13MtdiDrnZRkmJ9UHdMUUaqAbZD892TyyLw524qy4s296EO+Tu1z3O/2au ZPNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=H9LvAtog; 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 f9-20020a170902684900b001c43cd8b2d5si1259435pln.592.2023.09.15.15.51.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 15:51:04 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=H9LvAtog; 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 279D083711A2; Fri, 15 Sep 2023 11:38:27 -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 S236684AbjIOSiC (ORCPT + 99 others); Fri, 15 Sep 2023 14:38:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236587AbjIOShX (ORCPT ); Fri, 15 Sep 2023 14:37:23 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B165210E6; Fri, 15 Sep 2023 11:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=NoYAPE+UO7xNrTZ3UFo3zibiwdFupzttBoXxylMj4Qw=; b=H9LvAtogpvwX8ITigBgif20y3d Ksa3CrrVI3uaFqgH46vcGpzQGIbqqcgmmazDLvlAPd3WywSfgjryFPPXaF/5s/4Ksm1o5DXsq6PHT d118mcjKIzIS1RtLFAt/4I2kRM0niTEAbsc1MW/RuESCl87qFg73uDcHMTGKkeUONBGbDyBj5jrsx b7tUYeKMv4Ax9ha9W5IXgD9GUjlHlk+FnXw2zD9DZkL6avroCIGOqicNVMtEulxTb6/tsGEDX+11x OQIhNrD9uxgZFfv2F5U8xcBzdADdQizHw/96XJotDdOexdkjT2PlWFuT773ZhaL83QnsJwAtKgnsI hEgaBaCw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qhDgk-00BMIy-3W; Fri, 15 Sep 2023 18:37:10 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, torvalds@linux-foundation.org, Nicholas Piggin Subject: [PATCH 13/17] s390: Implement arch_xor_unlock_is_negative_byte Date: Fri, 15 Sep 2023 19:37:03 +0100 Message-Id: <20230915183707.2707298-14-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230915183707.2707298-1-willy@infradead.org> References: <20230915183707.2707298-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE 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]); Fri, 15 Sep 2023 11:38:27 -0700 (PDT) Inspired by the s390 arch_test_and_clear_bit(), this will surely be more efficient than the generic one defined in filemap.c. Signed-off-by: Matthew Wilcox (Oracle) --- arch/s390/include/asm/bitops.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index 2de74fcd0578..c467dffa8c12 100644 --- a/arch/s390/include/asm/bitops.h +++ b/arch/s390/include/asm/bitops.h @@ -201,6 +201,16 @@ static inline void arch___clear_bit_unlock(unsigned long nr, arch___clear_bit(nr, ptr); } +static inline bool arch_xor_unlock_is_negative_byte(unsigned long mask, + volatile unsigned long *ptr) +{ + unsigned long old; + + old = __atomic64_xor_barrier(mask, (long *)ptr); + return old & BIT(7); +} +#define arch_xor_unlock_is_negative_byte arch_xor_unlock_is_negative_byte + #include #include #include -- 2.40.1