From patchwork Mon Dec 5 17:30:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 13064856 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43438C4321E for ; Mon, 5 Dec 2022 17:30:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BFC928E0002; Mon, 5 Dec 2022 12:30:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BACCC8E0001; Mon, 5 Dec 2022 12:30:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A74B38E0002; Mon, 5 Dec 2022 12:30:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 957058E0001 for ; Mon, 5 Dec 2022 12:30:25 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 508981C63EF for ; Mon, 5 Dec 2022 17:30:25 +0000 (UTC) X-FDA: 80208941610.04.B171EFA Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf04.hostedemail.com (Postfix) with ESMTP id 930644001B for ; Mon, 5 Dec 2022 17:30:24 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=b4iFPk8e; dmarc=pass (policy=quarantine) header.from=zx2c4.com; spf=pass (imf04.hostedemail.com: domain of "SRS0=qbJv=4D=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=qbJv=4D=zx2c4.com=Jason@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670261424; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=4ElxRnkIjBHzAgajGGzltaINjdTXoXoQxedqqUtDsyc=; b=UmaoQLoZk6+BsF9/rHUCec9+9ZwlcFuknD+EMMv2I0EAJGLDQPmCp524xPtuwtMvw3J50d Xg+a0Pq7KLA/blf0HzrujXRbHpsddrTv6+vQ+Xrzm6NT7Ye83HLl90YbxOpD4DxhCl/e1P aykMZ52V2zL3L3wYIBDPdDP4PZEdT2U= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=b4iFPk8e; dmarc=pass (policy=quarantine) header.from=zx2c4.com; spf=pass (imf04.hostedemail.com: domain of "SRS0=qbJv=4D=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=qbJv=4D=zx2c4.com=Jason@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670261424; a=rsa-sha256; cv=none; b=AMsvwacVXVLY8gbvTDopgVDmg4qnKwttqIr52zFArwZvP1+wgN80H97Fl5O+r2duCUHyDC NzsWOtgRuEuJJfZtJjMm0rL06dRDQZ7kU+efSPcfaIPPNv0amX1T8jOubb6vzdv0t8/PA9 Gr3M0sgJGciGoUDJFO1ZntTnHsVdjbQ= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A46D061257; Mon, 5 Dec 2022 17:30:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4164FC433C1; Mon, 5 Dec 2022 17:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1670261419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4ElxRnkIjBHzAgajGGzltaINjdTXoXoQxedqqUtDsyc=; b=b4iFPk8etq9IanUvVfBSGkntQ1u628JEicMhdNYhLAXe4xoQX9QqOt+w8W+UPp9nMeggkY ik0sKiYjM+5vAAldQUgD65ea0IFl1koO5WOWbrMxOpw00C4D6zPFrfD1iD/Z/zoBDXazxy xc8VLIMrtPAZxy2wAEPQHsPSXs65nbI= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id b44d0242 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 5 Dec 2022 17:30:19 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: "Jason A. Donenfeld" , Eric B Munson , "Kirill A . Shutemov" , Vlastimil Babka , Andrew Morton Subject: [PATCH] mm: do not show ?? for VM_LOCKONFAULT pages Date: Mon, 5 Dec 2022 18:30:07 +0100 Message-Id: <20221205173007.580210-1-Jason@zx2c4.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 930644001B X-Stat-Signature: b75xbon5rm9xofbt7eh4krp5ot13sky8 X-Spamd-Result: default: False [4.04 / 9.00]; BAYES_HAM(-2.86)[91.14%]; R_MISSING_CHARSET(2.50)[]; IRL_BL_25(2.00)[52.25.139.140:received]; SUBJECT_HAS_UNDERSCORES(1.00)[]; MID_CONTAINS_FROM(1.00)[]; FORGED_SENDER(0.30)[Jason@zx2c4.com,SRS0=qbJv=4D=zx2c4.com=Jason@kernel.org]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; RCVD_NO_TLS_LAST(0.10)[]; DMARC_POLICY_ALLOW(0.00)[zx2c4.com,quarantine]; DKIM_TRACE(0.00)[zx2c4.com:+]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_SEVEN(0.00)[7]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[Jason@zx2c4.com,SRS0=qbJv=4D=zx2c4.com=Jason@kernel.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(0.00)[zx2c4.com:s=20210105]; RCVD_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(0.00)[+a:dfw.source.kernel.org]; TO_DN_SOME(0.00)[]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; SUBJECT_HAS_QUESTION(0.00)[] X-HE-Tag: 1670261424-329887 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: When VM_LOCKONFAULT was added, /proc/PID/smaps wasn't hooked up to it, so looking at /proc/PID/smaps, it shows '??' instead of something intelligable. This can be reached by userspace by simply calling `mlock2(..., MLOCK_ONFAULT);`. Fix this by adding "lf" to denote VM_LOCKONFAULT. Cc: Eric B Munson Cc: Kirill A. Shutemov Cc: Vlastimil Babka Cc: Andrew Morton Fixes: de60f5f10c58 ("mm: introduce VM_LOCKONFAULT") Signed-off-by: Jason A. Donenfeld Acked-by: Vlastimil Babka --- fs/proc/task_mmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 8a74cdcc9af0..60851e96530b 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -667,6 +667,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) [ilog2(VM_RAND_READ)] = "rr", [ilog2(VM_DONTCOPY)] = "dc", [ilog2(VM_DONTEXPAND)] = "de", + [ilog2(VM_LOCKONFAULT)] = "lf", [ilog2(VM_ACCOUNT)] = "ac", [ilog2(VM_NORESERVE)] = "nr", [ilog2(VM_HUGETLB)] = "ht",