Message ID | 20231004165317.1061855-13-willy@infradead.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23E1FE7C4F8 for <linux-mm@archiver.kernel.org>; Wed, 4 Oct 2023 16:53:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 347EF6B0273; Wed, 4 Oct 2023 12:53:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F7DC6B0274; Wed, 4 Oct 2023 12:53:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1980D6B0275; Wed, 4 Oct 2023 12:53:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 0ABCC6B0273 for <linux-mm@kvack.org>; Wed, 4 Oct 2023 12:53:27 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id DCAC11403BC for <linux-mm@kvack.org>; Wed, 4 Oct 2023 16:53:26 +0000 (UTC) X-FDA: 81308374812.28.D244C21 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 1D3731C0013 for <linux-mm@kvack.org>; Wed, 4 Oct 2023 16:53:24 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=VOk2evtN; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696438405; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aiOK8Ht5TYsSZN2/F06YkBbUJBHTCETngx448aYGRJo=; b=xcUqXTAF4mZnkiJSqTS9gidP3o6kKfL93En2nIxOvW043KWcZNUzN+bXApj45ViBzbUkFd /vtdNdWlwcVa3Xn/Qme5htufOcUa4r68AaIr7xfBCD6MPKLOPrqGE2amYfCRkLTp50stBB 1chzRXgJnX86KqY2Pn88fUVuwA65Xb0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696438405; a=rsa-sha256; cv=none; b=ZSDtccV57oO2yyPQM/6dmfzPwO8PYHaKxj2qgbC1VoHH6nPjt7qX1VPxrl2rGDoA5B4tu0 vbl9gX2UgdoSH6yk1/POzpfyLcyZ2R03u1NROBFJ9+x2rMts18BJ7Egd4RnYOU9xgMY0I+ mrw0A/k77+gW1nx8umpRqXYCGRW5ynQ= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=VOk2evtN; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=aiOK8Ht5TYsSZN2/F06YkBbUJBHTCETngx448aYGRJo=; b=VOk2evtNHuqg7ndh/VFc13jshQ 7Aq6JXqhdYoVvDjQrEneZ41ZwtOlizK9UoWsy42xy8NW3bUCNb3FM1Lnu/ipD7yoFi3JwlBWmBL9x QzfQgpXzrCBdr//gmxpCSLCzvgrpfK096UuAuYhHfitjA2uMljoQgeqWetGTlvfEYKoWf6dBMtmqN FNDJJdV9A88mGDAmIf14M2txfGBLtO4K6EU7at4YJB+4ni1EBNFCm+6C2/joXW2lKFFXN3w7Sbn/L 1o6SwpwpoUxRpJUIeguhYRCDOyQgh9vvfjUqn/3PeR8zhwrl4RRlWzioFMBcJWIp8FWcO/PedaqLM NGcjEprg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qo57g-004SFl-Cg; Wed, 04 Oct 2023 16:53:20 +0000 From: "Matthew Wilcox (Oracle)" <willy@infradead.org> To: Andrew Morton <akpm@linux-foundation.org> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, torvalds@linux-foundation.org, npiggin@gmail.com Subject: [PATCH v2 12/17] riscv: Implement xor_unlock_is_negative_byte Date: Wed, 4 Oct 2023 17:53:12 +0100 Message-Id: <20231004165317.1061855-13-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231004165317.1061855-1-willy@infradead.org> References: <20231004165317.1061855-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D3731C0013 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: qfai3awehk7grfck8anqbhrriowemsyb X-HE-Tag: 1696438404-183070 X-HE-Meta: U2FsdGVkX1/DJwaIWU1ZSjBR/hqu9k7lJuvbCciDNZWFlmxWnYB/lVOjTjw2luivb7A7zp3WDJVQ1RyW9I+XMRplg2iKmALCUP5DPSgMplPJdV6vNypF2BmKc3vOToxvlG7oY71C6DsDB6DmJAG6vCDSi4DJ/YgUP/XGAngbOLMY+i9Hb+eudrS7jgmmYZ8VAB7wzgBNCA8Hk/6OeX2Cj13VlQcWI8UB+XnuhTHVLrMs+nKuN/9Hr99TdV9Py44ZRoduMfXW9ZNJ0AQyjv5/TpVsYxVfyl37zbmgRcgz3DnBusXOpVU7ujaVqxwhe8vtThe+efRViZz7seeStCTPMOLBHkdyi2I1juaT0zUEpMROnOLP9i/U7OttcqvqhVc8SKcfLGpErCxoOna+vFMMMnH8pbkR7AbCnfnnfxmDOQY3KB8VZGMFmNeZwyhC/L0KYoq6oXbCphDgV8TcWd/ZWkG+Uf9L68JnR3XedBG+oKW4HheLZiwnuaYLR+JaL58muifuAfoWy24wepeJxlE8TXhjRavdAKp3K0PAHpM2Y/MIn2T1BNEsgVToNzBWpRFdMqPRysfuHbYVy/K5Ey3tSkN2zU5nzRGXq3+edz9mzZv0ojptZ5TuZaMhgJh6QGoYd0QYMpL4Am0I11b/4K2pBIpXp/M4TJ7m9jQ0ovKLKo7s+I502YiNQ/Su3WjbwWIC3fMAtk++B73Z3hY2/U4PE+8UjGzGQ/KT62rfMym/507JGu6tXn1KtaxRmUfFFQk9IYR1fDWmSSVM2vnRZ0Ity2HxrbAz87fdvzb/D6kO+dvWQYbLjm7PHGiEbyFdgYPM5lh/pK9SKUwmCe5AdTwaGpH9BXh/cAYRBClmM9fQtN1LWGh/GyE9ivZoqin3IVnCknvrEReuUNBgj8LtX6xnX10mW1M+5MHbg0pEv7lD2UgFiuucp6rp1xZwjNQ2I7m6ahxkTijJkD/PASQPUN8 9+JVIVmZ Pkucl9W9RZ0uCn9FF472GrT/lTV90ECMZR6+4+uUTu0rXv/fJkIkNM3hH7xipLLHuiEuOi5yiGrwLIAcHqj/PwYRXK8/QrwfflYHiA6WnDd7Py2Hq5NogbyXNlFwxL5DCNnWDAzSM+y8LWhxslHzTJZh9mVR+Km1gXcF9tdlWEzjDUKsfyHs5/oQOhhtWe42Cu5SjGlqkW6udOMi/21LGY6w2FiX/Ua1TmUHc X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Add folio_end_read
|
expand
|
diff --git a/arch/riscv/include/asm/bitops.h b/arch/riscv/include/asm/bitops.h index 3540b690944b..15e3044298a2 100644 --- a/arch/riscv/include/asm/bitops.h +++ b/arch/riscv/include/asm/bitops.h @@ -191,6 +191,19 @@ static inline void __clear_bit_unlock( clear_bit_unlock(nr, addr); } +static inline bool xor_unlock_is_negative_byte(unsigned long mask, + volatile unsigned long *addr) +{ + unsigned long res; + __asm__ __volatile__ ( + __AMO(xor) ".rl %0, %2, %1" + : "=r" (res), "+A" (*addr) + : "r" (__NOP(mask)) + : "memory"); + return (res & BIT(7)) != 0; +} +#define xor_unlock_is_negative_byte xor_unlock_is_negative_byte + #undef __test_and_op_bit #undef __op_bit #undef __NOP
Inspired by the riscv clear_bit_unlock(), this will surely be more efficient than the generic one defined in filemap.c. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- arch/riscv/include/asm/bitops.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)