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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB9E5C433F5 for ; Wed, 6 Oct 2021 15:46:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5F08F60F9D for ; Wed, 6 Oct 2021 15:46:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5F08F60F9D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D76DF6B006C; Wed, 6 Oct 2021 11:46:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D26A7900002; Wed, 6 Oct 2021 11:46:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C15386B0073; Wed, 6 Oct 2021 11:46:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id B2B426B006C for ; Wed, 6 Oct 2021 11:46:52 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6E6FF2FD7B for ; Wed, 6 Oct 2021 15:46:52 +0000 (UTC) X-FDA: 78666440664.06.7FEA50B Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [142.44.231.140]) by imf24.hostedemail.com (Postfix) with ESMTP id 0C281B001574 for ; Wed, 6 Oct 2021 15:46:51 +0000 (UTC) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mY985-00AWZP-As; Wed, 06 Oct 2021 15:46:49 +0000 Date: Wed, 6 Oct 2021 15:46:49 +0000 From: Al Viro To: David Hildenbrand Cc: Matthew Wilcox , linux-mm@kvack.org, Kent Overstreet , Johannes Weiner , linux-fsdevel@vger.kernel.org Subject: Re: [RFC] pgflags_t Message-ID: References: <106400c5-d3f2-e858-186a-82f9b517917b@redhat.com> <21ce511e-7cde-8bdb-b6c6-e1278681ebf6@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21ce511e-7cde-8bdb-b6c6-e1278681ebf6@redhat.com> X-Rspamd-Queue-Id: 0C281B001574 X-Stat-Signature: ino6hq7jkomzkamc9144tsjubsokp3ac Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=none; spf=none (imf24.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 142.44.231.140) smtp.mailfrom=viro@ftp.linux.org.uk X-Rspamd-Server: rspam06 X-HE-Tag: 1633535211-767921 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: On Wed, Oct 06, 2021 at 05:32:39PM +0200, David Hildenbrand wrote: > It feels to me like using __bitwise for access checks and then still > modifying the __bitwise fields randomly via a backdoor. But sure, if it > works, I'll be happy if we can use that. __bitwise == "can't do anything other than bitwise operations without an explicit force-cast". All there is to it. Hell, the very first use had been for things like __le32 et.al., where the primitives very much do non-bitwise accesses. They are known to be safe (== do the same thing regardless of the host endianness). Internally they contain force-casts, precisely so that the caller wouldn't need to.