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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2836C54E49 for ; Thu, 7 Mar 2024 11:51:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1849D6B016C; Thu, 7 Mar 2024 06:51:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 10F2B6B016D; Thu, 7 Mar 2024 06:51:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF0816B016E; Thu, 7 Mar 2024 06:51:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DA8CA6B016C for ; Thu, 7 Mar 2024 06:51:12 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3A3F8121191 for ; Thu, 7 Mar 2024 11:51:12 +0000 (UTC) X-FDA: 81870077184.23.3C7F2F8 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by imf09.hostedemail.com (Postfix) with ESMTP id 238B8140008 for ; Thu, 7 Mar 2024 11:51:09 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf09.hostedemail.com: domain of richard@nod.at designates 195.201.40.130 as permitted sender) smtp.mailfrom=richard@nod.at ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709812270; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zmu5uMIZDi7UNA1wCNOlWfc1y0uv4VP1QuGxQKiV3nw=; b=DeRhqUCLcSiC1TyG5h91l97dZFwcogm6EtckkPEwgOOryrGT0F2Q9h3WIhsaw9bO22FbJO OQutcpzoIV68NxMaXMZW1skBV4azRUoMXQbKMMC5pwe8SpipKNq54LgYmYmlhSrbdYumi3 CZbJIsM3vw//nZQav8O21Tth4wDbQ9M= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf09.hostedemail.com: domain of richard@nod.at designates 195.201.40.130 as permitted sender) smtp.mailfrom=richard@nod.at ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709812270; a=rsa-sha256; cv=none; b=f6ahvGp+1pLSQohZG7JlBs0bmOjFLqPqOSuTcwUh2E2lpSmstYbx11xZ4M6ECd3cpVZz0A ftW5a3d8PMYBdvMkn9QP4hLO5Ry94N7KjtBHKNx3XkdWxE5DMFWnp1f/IRLzRoZDBjD/PW pss1Jgr1E+wKJQF2PCJIY7x+TYQutTs= Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 84821644CE90; Thu, 7 Mar 2024 12:51:08 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Tmxdw1VxKfDn; Thu, 7 Mar 2024 12:51:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id EB46A644CE95; Thu, 7 Mar 2024 12:51:07 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lkpkYE8omJqX; Thu, 7 Mar 2024 12:51:07 +0100 (CET) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id B2713644CE90; Thu, 7 Mar 2024 12:51:07 +0100 (CET) Date: Thu, 7 Mar 2024 12:51:07 +0100 (CET) From: Richard Weinberger To: David Hildenbrand Cc: linux-mm , linux-fsdevel , linux-kernel , Linux Doc Mailing List , upstream+pagemap , adobriyan , wangkefeng wang , ryan roberts , hughd , peterx , avagin , lstoakes , vbabka , Andrew Morton , usama anjum , Jonathan Corbet Message-ID: <1525238492.23321.1709812267495.JavaMail.zimbra@nod.at> In-Reply-To: <7d9321db-a3c1-4593-91fa-c7f97bd9eecd@redhat.com> References: <20240306232339.29659-1-richard@nod.at> <1058679077.23275.1709809843605.JavaMail.zimbra@nod.at> <7d9321db-a3c1-4593-91fa-c7f97bd9eecd@redhat.com> Subject: Re: [PATCH 1/2] [RFC] proc: pagemap: Expose whether a PTE is writable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: proc: pagemap: Expose whether a PTE is writable Thread-Index: Q0zWB5x1mF33ot5wjbCf6WpNKPSWOg== X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 238B8140008 X-Stat-Signature: tunwumccfos4iwd8r1j36e1s7tr6ted4 X-HE-Tag: 1709812269-178110 X-HE-Meta: U2FsdGVkX19hMl3aEXELJP4UZIhV2m+JMnYO9o9qfQOdrUprAKE3HoetaFUkGbHJrmaksaFLeVj0GkiFVkO4Ir2Z4Zpu4v13l2pkJdUvOsiC/86orGNp/DK+F8S4wrScEJtP5AH0Hyxg0SDsgf7t0JQyXFO2GsQ/isOCwMd70EDewC97MbybY/otbRGp1fcYgiLdzTLlyQrCBSl6Eztwl1oQsDIRMq3KmTyyK4AiMXiP6pmlZYy+JogOq/Rq5AxID4qbyLVdHmzo8lOYHk+4WsFg6j55FnIoVdCchi6X1pQRdkp7tAYg+UJHxe1IgAGF6sYIZQdocZ4M0d9FKz1efW5RJYg7S8Gu+yHhRVB/tXxTkQ55qHMWxoe24GsG4Hm26Em/dpZawamC7+SiOEsCzwNKfV4JCCYT5l1SBBWAeF+1FxTCelk6ImH5PZocqbDW0RAstVH0LTpwq9Nmy5BAuRrZ56tMavCC2pormxrAGW8gNVqfLqWwmewFCYHP1c4DidAEB7bFYKHJvk9xXhdSMEjDEjuJZ+CoF4ZnM+hg2YZE2Aofm4kNJeDo/trrU7Sk3wpoKfcVRLPb35a7bt3gXwtU3U8GX1XS92+UVHhkpDlSc29QT4YP3CuwrZ7zQlcvXq5ahtvj8bLfdL/n14LChKgm3z2b27evsOMfTRrM8J/voRlZdq/Mt8dEZwNvyy57m3I8FjdqlkZTg+DcnbbcTJfS3YvQC9W5QbmiXFMHhKLzLhlt055RtknzAfo3UHjPQzierkLl3ZTAWewAJpHDXYFIOcbW+G7tkk9xmuCfX9xCxvzAeC/nvooilmpeinYX6o18l2CM0/Y= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000051, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: ----- Urspr=C3=BCngliche Mail ----- > Von: "David Hildenbrand" >> I'm currently investigating why a real-time application faces unexpected >> page faults. Page faults are usually fatal for real-time work loads beca= use >> the latency constraints are no longer met. >=20 > Are you concerned about any type of page fault, or are things like a > simple remapping of the same page from "read-only to writable" > acceptable? ("very minor fault") Any page fault has to be avoided. To give you more background, the real time application runs on Xenomai, a real time extension for Linux. Xenomai applies already many tweaks to the kernel to trigger pre-faulting o= f memory areas. But sometimes the application does not use the Xenomai API correctly or there is an bug in Xenomai it self. Currently I'm suspecting the latter. =20 >>=20 >> So, I wrote a small tool to inspect the memory mappings of a process to = find >> areas which are not correctly pre-faulted. While doing so I noticed that >> there is currently no way to detect CoW mappings. >> Exposing the writable property of a PTE seemed like a good start to me. >=20 > Is it just about "detection" for debugging purposes or about "fixup" in > running applications? It's only about debugging. If an application fails a test I want to have a tool which tells me what memory mappings are wonky or could cause a fault at runtime. I fully understand that my use case is a corner case and anything but mainl= ine. While developing my debug tool I thought that improving the pagemap interfa= ce might help others too. Thanks, //richard