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 124CDC433F5 for ; Wed, 6 Oct 2021 15:28:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9F89061027 for ; Wed, 6 Oct 2021 15:28:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9F89061027 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 240716B006C; Wed, 6 Oct 2021 11:28:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F0396B0071; Wed, 6 Oct 2021 11:28:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E000900002; Wed, 6 Oct 2021 11:28:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0248.hostedemail.com [216.40.44.248]) by kanga.kvack.org (Postfix) with ESMTP id F02B46B006C for ; Wed, 6 Oct 2021 11:28:48 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AF7391802F499 for ; Wed, 6 Oct 2021 15:28:48 +0000 (UTC) X-FDA: 78666395136.23.2B2A947 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [142.44.231.140]) by imf28.hostedemail.com (Postfix) with ESMTP id 70C7A9001355 for ; Wed, 6 Oct 2021 15:28:48 +0000 (UTC) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mY8qb-00AWPX-Kh; Wed, 06 Oct 2021 15:28:45 +0000 Date: Wed, 6 Oct 2021 15:28:45 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <106400c5-d3f2-e858-186a-82f9b517917b@redhat.com> Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=none; spf=none (imf28.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: rspam04 X-Rspamd-Queue-Id: 70C7A9001355 X-Stat-Signature: fokzzsdnczf4aexx9ypn817x4dw411j6 X-HE-Tag: 1633534128-522627 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:23:49PM +0200, David Hildenbrand wrote: > On 06.10.21 17:22, Al Viro wrote: > > On Wed, Oct 06, 2021 at 03:58:14PM +0100, Matthew Wilcox wrote: > > > David expressed some unease about the lack of typesafety in patches > > > 1 & 2 of the page->slab conversion [1], and I'll admit to not being > > > particularly a fan of passing around an unsigned long. That crystallised > > > in a discussion with Kent [2] about how to lock a page when you don't know > > > its type (solution: every memory descriptor type starts with a > > > pgflags_t) > > > > Why bother making it a struct? What's wrong with __bitwise and letting > > sparse catch conversions? > > > > As I raised in my reply, we store all kinds of different things in > page->flags ... not sure if that could be worked around somehow. What of that? Inline helpers with force-casts for accessing those and that's it... Use of __bitwise is simply invisible to compiler - it doesn't get past the preprocessor on non-sparse builds. So it's not like you'd disrupt the atomic accesses, layout, etc.