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 552F7C433EF for ; Wed, 6 Oct 2021 15:32:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 02D536103D for ; Wed, 6 Oct 2021 15:32:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 02D536103D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 71E376B006C; Wed, 6 Oct 2021 11:32:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6CE9D900002; Wed, 6 Oct 2021 11:32:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5953A6B0073; Wed, 6 Oct 2021 11:32:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id 49CA96B006C for ; Wed, 6 Oct 2021 11:32:51 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0642A32072 for ; Wed, 6 Oct 2021 15:32:51 +0000 (UTC) X-FDA: 78666405342.28.5771643 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 9B92530008CC for ; Wed, 6 Oct 2021 15:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633534370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cvEph9NgYeijJljCcohhAoNZxQThplIO11/fqs6syHU=; b=Hy38fZpPTHJ6gF8LqAD5LqVjMoFf4cHFNPAByONAnZH0HZu+LQVWYUvNVyR2YtReizkFbp 0NEm4eAVIAy8+0ejFI92iApBUwmQCbcK3yLHP671HDA16hkGaCO827piKElxzWQIJYm3m9 unYRxcT75w/ybEfbCflm9+tkVdkmDS0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-6AcLQQ_vO0ueBN3FoidmYg-1; Wed, 06 Oct 2021 11:32:49 -0400 X-MC-Unique: 6AcLQQ_vO0ueBN3FoidmYg-1 Received: by mail-wr1-f70.google.com with SMTP id r25-20020adfab59000000b001609ddd5579so2366034wrc.21 for ; Wed, 06 Oct 2021 08:32:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=cvEph9NgYeijJljCcohhAoNZxQThplIO11/fqs6syHU=; b=zS6RsEMDHzetNiNSSjlJsUdK5+I8cin1b3ejpcsNa14Yuo+hymu88TEl+zY8WBBfon qF+MZiUbZk+Rb+my+Tpq+nb3of8Ci0HfALh+WwtelbswQjeJlrDMy2mv19ng6JPz80mG BBVYpDueR3UwDimn5hVcmdJX3LrP3ltezXlsrNf7oVeBfSDZl15TliWmIR26BzduRUiE +KN8l99E8rhe0s70v7/QFN9ZQ5tpcSTbqrIB385CvwjO2Emj8HANO91i2pqPKh4cesd8 D2+kmCd2Auc6GYFHlF2HszVZGfmqV6p9W6g0mMJ0qqF7XjlBwwOiZFEeN4ccDxzNh+i/ jiyw== X-Gm-Message-State: AOAM530i/5qXZOYOL9B5fQ+AphOl8h40QtLdkHps/R/NvwaTVnnV3e9+ jciuWWnZJA1KDo0XxdemlBXZelDu+Fv52PMeEHeiH7qT5ztitVZLIGsP2nTO3kk3AiZipK8Pp4c zCM8lyufH1Cc= X-Received: by 2002:a05:600c:c3:: with SMTP id u3mr10512165wmm.137.1633534368121; Wed, 06 Oct 2021 08:32:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQnWEw8OnSFw6c/U83DcmKnf11Gs3w7WwRutSUaaTj+DpRwg4WZxidh4QqDP/vn7/V76Xlcw== X-Received: by 2002:a05:600c:c3:: with SMTP id u3mr10512139wmm.137.1633534367951; Wed, 06 Oct 2021 08:32:47 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6529.dip0.t-ipconnect.de. [91.12.101.41]) by smtp.gmail.com with ESMTPSA id i3sm5558725wrn.34.2021.10.06.08.32.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Oct 2021 08:32:47 -0700 (PDT) Subject: Re: [RFC] pgflags_t To: Al Viro Cc: Matthew Wilcox , linux-mm@kvack.org, Kent Overstreet , Johannes Weiner , linux-fsdevel@vger.kernel.org References: <106400c5-d3f2-e858-186a-82f9b517917b@redhat.com> From: David Hildenbrand Organization: Red Hat Message-ID: <21ce511e-7cde-8bdb-b6c6-e1278681ebf6@redhat.com> Date: Wed, 6 Oct 2021 17:32:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9B92530008CC X-Stat-Signature: 4bzbgaz18wx8j51rmettswkqb79zg4e8 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Hy38fZpP; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf09.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-HE-Tag: 1633534370-669435 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 06.10.21 17:28, Al Viro wrote: > 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... 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. -- Thanks, David / dhildenb