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 05F4DC433EF for ; Tue, 2 Nov 2021 11:42:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 98FDA60EDF for ; Tue, 2 Nov 2021 11:42:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 98FDA60EDF 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 C212F94000A; Tue, 2 Nov 2021 07:42:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB471940009; Tue, 2 Nov 2021 07:42:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A22FF94000A; Tue, 2 Nov 2021 07:42:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0067.hostedemail.com [216.40.44.67]) by kanga.kvack.org (Postfix) with ESMTP id 8D304940009 for ; Tue, 2 Nov 2021 07:42:46 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3FFB355426 for ; Tue, 2 Nov 2021 11:42:46 +0000 (UTC) X-FDA: 78763803132.08.3E939B7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf08.hostedemail.com (Postfix) with ESMTP id 75F0B30000A9 for ; Tue, 2 Nov 2021 11:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635853365; 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=xee5JhjhnGt3CxdHmyRlw/DMJ/pTVtpU9WjkRwoLrVc=; b=GE7BeJS6DxF7mOuRtRk6K/ddtYOrZyHnmKArQOh2tLDIz8IzoPIXjVIdMKlm3kLIdIdfBy qY7nZD7gD6lD+D/6s19RZOe6Wwe9k0CVCJQN0ba945cLoWxIZLAKXH4ISAsvxGX9TCtFm6 hNYxV/uxeeLeSOHW7y1NlsDpiA6CGcI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-086TAV2ZORKso4LGMarncA-1; Tue, 02 Nov 2021 07:42:43 -0400 X-MC-Unique: 086TAV2ZORKso4LGMarncA-1 Received: by mail-wm1-f69.google.com with SMTP id u14-20020a05600c19ce00b0030d8549d49aso616266wmq.0 for ; Tue, 02 Nov 2021 04:42:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:organization:subject :in-reply-to:content-transfer-encoding; bh=xee5JhjhnGt3CxdHmyRlw/DMJ/pTVtpU9WjkRwoLrVc=; b=spmTvzeMxqnTYuaCwMRIBBp99WdnHB0o34552RtN4BchUTkmowrSQzTTbgnhQFEl0u Xc9FKSMT8H5AEA9lKoknUCf4RiomwFtnW4FhFVnCuAhAHHOsj5d3Ax0kYS+WeDq0xdPs a9KsabLgHf/fizBb6i3NjTpXFUfSy2K//t6OeyrkROPrLRrYb3HKAK3Hsqr2eRkMHfX9 /WECZygVOYs4UcbdbPs1+SPnQPpQj6J57ZMC64GOwoJ05+dCOZkvinSlSOz4/JxeyVqk VpHnZe2kHM79TEkoiXJQf2CaOCHemmxhglSN3YYFpX/j8mBl+JF0tgWR8JVrAR8Uyu15 cmJw== X-Gm-Message-State: AOAM5337KBVl0nPuvVr7kYy8aB73ogOwTN/ZxIj3Gve7CeWKtUF2XPzG XpMNtFnpP0XYOV032aSdxESKK4TmVdfLOW5blTGBPQBO0ivTyLI3OcGl+OcmqUnKlUezdXb70q0 rDt4ui08YdGY= X-Received: by 2002:a5d:6085:: with SMTP id w5mr38727436wrt.122.1635853362697; Tue, 02 Nov 2021 04:42:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYlFsUlGRluXgAGhyhBxCMa89zjN2XsplD6uC5lnBgtaPtWkNjyIH27zVcWiuRjB5lpXwQzA== X-Received: by 2002:a5d:6085:: with SMTP id w5mr38727399wrt.122.1635853362447; Tue, 02 Nov 2021 04:42:42 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6810.dip0.t-ipconnect.de. [91.12.104.16]) by smtp.gmail.com with ESMTPSA id z18sm13052470wrq.11.2021.11.02.04.42.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Nov 2021 04:42:41 -0700 (PDT) Message-ID: <9fd0a86f-c012-4bb7-78eb-7413346448e0@redhat.com> Date: Tue, 2 Nov 2021 12:42:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 To: Mina Almasry Cc: Nathan Lewis , Yu Zhao , "Paul E . McKenney" , Jonathan Corbet , Andrew Morton , Peter Xu , Ivan Teterevkov , Florian Schmidt , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <20211028205854.830200-1-almasrymina@google.com> <2fede4d2-9d82-eac9-002b-9a7246b2c3f8@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v1] mm: Add /proc/$PID/pageflags In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: 8j58ky49xts1dj1pk4emnaunuiuy65un Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GE7BeJS6; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf08.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 75F0B30000A9 X-HE-Tag: 1635853355-389570 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: >> Bit 58-60 are still free, no? Bit 57 was recently added for uffd-wp >> purposes I think. >> >> #define PM_SOFT_DIRTY BIT_ULL(55) >> #define PM_MMAP_EXCLUSIVE BIT_ULL(56) >> #define PM_UFFD_WP BIT_ULL(57) >> #define PM_FILE BIT_ULL(61) >> #define PM_SWAP BIT_ULL(62) >> #define PM_PRESENT BIT_ULL(63) >> >> PM_MMAP_EXCLUSIVE and PM_FILE already go into the direction of "what is >> mapped" IMHO. So just a thought if something in there (PM_HUGE? PM_THP?) >> ... could make sense. >> > > Thanks! I _think_ that would work for us, I'll look into confirming. > To be honest I still wonder if eventually different folks will find > uses for other page flags and eventually we'll run out of pagemaps > bits, but I'll yield to whatever you think is best here. Using one of the remaining 3 bits should be fine. In the worst case, we'll need pagemap_ext at some point that provides more bits per PFN, if we ever run out of bits. But as mentioned by Matthew, extending mincore() could also work: not only indicating if the page is resident, but also in which "form" it is resident. We could separate the cases "cont PTE huge page" vs. "PMD huge page". I recall that the information (THP / !THP) might be valuable for users: there was a discussion to let user space decide where to place THP. (IIRC madvise() extension to have something like MADV_COLLAPSE_THP / MADV_DISSOLVE_THP) -- Thanks, David / dhildenb