Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2217489rdb; Sun, 11 Feb 2024 18:03:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWwhr+6bpCs5Wtu1ozEFTTk8uJZzsJoJO4O54olFoKNh9bvp4qBHqfzksOldbs2NKrPG19bX2+8dSKLryoR2LMatefL/nN+Qf0J4xPN+A== X-Google-Smtp-Source: AGHT+IFkwHliL6WXuIbs8IOTv6iymtANU85U3KJ7Wewr8pkLaO8UARM7/yCLyTK6wLV9Otbwa5b4 X-Received: by 2002:a05:6359:4113:b0:176:5b4f:492b with SMTP id kh19-20020a056359411300b001765b4f492bmr6139179rwc.12.1707703404672; Sun, 11 Feb 2024 18:03:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707703404; cv=pass; d=google.com; s=arc-20160816; b=XV/9vfQT+h13460HLQPYIvd5/AhFgScd3v8Z1qqi4ksmzR/DXb9MsZPrdk4o2L71BB 65pq+EBMF8+10G2FxlAc8GZnix574LtvnZHsJQ392GvJfytzGQWQhsGLxnzZGGCRqzNQ b0z/qY2qsWd7u83nKEhbDPTubnr4BqwLy/T4+FWC0qHmO6CHo6dhIlHvZEz3ugUIXcJG 7FPqsH6/cUgKR/TS2YM94QWg5INtyPfVg/hj1zOaKT/8X0VhY6TXljSHAfrK6FygMc5f O7UWghVwZfGgIGIqG7oIKOGMuF+9rlKEwnj5G5r5zwARkiXlG5q/eT8/7UGextOiB2p7 cm5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=ky0Zs4VZOUMFAlfL9lg8Xsh6o3CkG3kYccx+L1xGrlQ=; fh=Uj6i34ztuubg9CGIxz2ppQqNjYJbC3nfhnk4PONom68=; b=0oTdr8mDMhIDXe5cIu4kALSOepCbPij5G/eFr7mJYDWbqdFSTpZxLk+kvIGiBDJRRn X/djyW+WGdxnuPVfA3AhIjqpc032ppli7zhamyeL6dMnh3F4BZEZdzSM+EhAB4M4m80L EhdzCRg5V53nCQs9g/BF3qGW3iTZ9dUUQQtVUljZZZp4rL50FO/IMVruvMKykQSuRPv2 FgxFKu2Au7eDlpRuG5Hu2kvNJkWM/9aaY2traSXkDsOgLwCci9du8+rQo/8WuaBIPECl uRhlI5vpGLGYgrk2Ptj2F5HIqAVjRttcb23QXvlVwpc6MgI87/zE7C+zhsfKsl01W060 6w9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-61061-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCWALXuQLT6vm695V/obGQlFCsSbAPDdxsiVEAkBXuTxk+qAaK59FmnYR5eWiRDfiOMOB+DXJtt8X6YBhrPJMi9qe7mS1OC+Zahb3GA3tQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f22-20020a056a0022d600b006e0e5ab8580si145728pfj.374.2024.02.11.18.03.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 18:03:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61061-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-61061-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 262C8287CD6 for ; Mon, 12 Feb 2024 02:01:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 734261FD7; Mon, 12 Feb 2024 02:00:51 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0892217C2; Mon, 12 Feb 2024 02:00:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707703251; cv=none; b=I4Nv1FBCepaOfAyXDEmdMB3TzRCliLYcDqYMKIPFAEEKD7kPIA4gdTUk5hnBcrYJPDCRdWtoqS3chN90xr/FbqD2nN78rc7LCQuNMDqfzbY4jjqNqY1EezKBDpt2L2/DTFP7r7Hms9t95t+oel3AdegGVehZ2/A0Zp74DPe4Yz0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707703251; c=relaxed/simple; bh=6Lf06nnCwCLxaCHtDslobILzwXHZSIpo66gcQObBuEo=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=IifZjXZeo27JALVm9EgPwJDFq+05dZykjqc7G3aZWLUnBxJ+CbVJCtO3kJkFTl005oF+aohZBODMOPeo74h1MnbRIwM1n9ADhmZbcXrCItZH5tdXfgLCrxCfr3YmVMTX8UUylE5ySuWafuuhwknZqKGqOwtq9IdVjrsFQFgtEqA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 22A1BDA7; Sun, 11 Feb 2024 18:01:27 -0800 (PST) Received: from [10.162.40.23] (unknown [10.162.40.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0AA2A3F762; Sun, 11 Feb 2024 18:00:43 -0800 (PST) Message-ID: Date: Mon, 12 Feb 2024 07:30:40 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Anshuman Khandual Subject: Re: [PATCH] fs/proc/task_mmu: Add display flag for VM_MAYOVERLAY To: David Hildenbrand , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20240208084805.1252337-1-anshuman.khandual@arm.com> <20240208124035.1c96c256d6e8c65f70b18675@linux-foundation.org> <2e7496af-0988-49fb-9582-bf6a94f08198@redhat.com> Content-Language: en-US In-Reply-To: <2e7496af-0988-49fb-9582-bf6a94f08198@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 2/10/24 04:01, David Hildenbrand wrote: > On 08.02.24 21:40, Andrew Morton wrote: >> On Thu, 8 Feb 2024 17:48:26 +0100 David Hildenbrand wrote: >> >>> On 08.02.24 09:48, Anshuman Khandual wrote: >>>> VM_UFFD_MISSING flag is mutually exclussive with VM_MAYOVERLAY flag as they >>>> both use the same bit position i.e 0x00000200 in the vm_flags. Let's update >>>> show_smap_vma_flags() to display the correct flags depending on CONFIG_MMU. >>>> >>>> Cc: Andrew Morton >>>> Cc: David Hildenbrand >>>> Cc: linux-kernel@vger.kernel.org >>>> Cc: linux-fsdevel@vger.kernel.org >>>> Signed-off-by: Anshuman Khandual >>>> --- >>>> This applies on v6.8-rc3 >>>> >>>>    fs/proc/task_mmu.c | 4 ++++ >>>>    1 file changed, 4 insertions(+) >>>> >>>> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c >>>> index 3f78ebbb795f..1c4eb25cfc17 100644 >>>> --- a/fs/proc/task_mmu.c >>>> +++ b/fs/proc/task_mmu.c >>>> @@ -681,7 +681,11 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) >>>>            [ilog2(VM_HUGEPAGE)]    = "hg", >>>>            [ilog2(VM_NOHUGEPAGE)]    = "nh", >>>>            [ilog2(VM_MERGEABLE)]    = "mg", >>>> +#ifdef CONFIG_MMU >>>>            [ilog2(VM_UFFD_MISSING)]= "um", >>>> +#else >>>> +        [ilog2(VM_MAYOVERLAY)]    = "ov", >>>> +#endif /* CONFIG_MMU */ >>>>            [ilog2(VM_UFFD_WP)]    = "uw", >>>>    #ifdef CONFIG_ARM64_MTE >>>>            [ilog2(VM_MTE)]        = "mt", >>> >>> Reviewed-by: David Hildenbrand >> >> I'm thinking >> >> Fixes: b6b7a8faf05c ("mm/nommu: don't use VM_MAYSHARE for MAP_PRIVATE mappings") >> Cc: > > I'm having a hard time believing that anybody that runs a !MMU kernel would actually care about this bit being exposed as "ov" instead of "uw". > > So in my thinking, one could even update Documentation/filesystems/proc.rst to just mention that "uw" on !MMU is only used for internal purposes. > > But now, I actually read what that structure says: > > "Don't forget to update Documentation/ on changes." > > So, let's look there: Documentation/filesystems/proc.rst > > "Note that there is no guarantee that every flag and associated mnemonic will be present in all further kernel releases. Things get changed, the flags may be vanished or the reverse -- new added. Interpretation of their meaning might change in future as well. So each consumer of these flags has to follow each specific kernel version for the exact semantic. > > This file is only present if the CONFIG_MMU kernel configuration option is enabled." > > And in fact > > $ git grep MMU fs/proc/Makefile > fs/proc/Makefile:proc-$(CONFIG_MMU)     := task_mmu.o Ahh! you are right, completely missed that. > > > So I rewoke my RB, this patch should be dropped and was never even tested unless I am missing something important. Fair enough, let's drop this patch. I found this via code inspection while looking into VM_UFFD_MISSING definition, booted with default configs which has CONFIG_MMU enabled. But this was an oversight, my bad.