Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp508115lqi; Thu, 7 Mar 2024 04:04:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV+o7rASQiQALjovwn44ynUPSHfV6xDjF74e5Vh7Oler0vsI4bEkl7UoQHv2LjuoQUFhamIcqUmh7S4r0ezv3gvzrepTpQovGGEp1UeRQ== X-Google-Smtp-Source: AGHT+IHLBJL05wkMxdmfajmS+fOliCZMIYLPuJB19eGpuEZ+SeBguVYZBvuzslgqOfgDPavd2nrc X-Received: by 2002:a17:906:7ca:b0:a45:aacb:349b with SMTP id m10-20020a17090607ca00b00a45aacb349bmr4977376ejc.16.1709813064875; Thu, 07 Mar 2024 04:04:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709813064; cv=pass; d=google.com; s=arc-20160816; b=OT2cI1GYQpnFllYbur5OHzgWmPrXAN7rvnhpw02SjMu/5qlFH8foi8oS+UsZ0mZ3K8 I/o7bP/fd+tdiQFFqVE3ZpDOr4HMNi1uSpizzVOyNNlf9S4fqouZCNBH9PA5lYv2xcTS 7ox4VB1OQ42pV8/xeQ5IL+jM/QB22/9fG/BHKbyy3FDpzr3Z0Eql+wJwLVnNY8WbXRM/ XNRNR9FG+YSinlOdslZROtQcjOAW770xgLQ/uxrsEWVuP1E7dL9lGmp3I1G9vftQXiD1 AB0QQgTlO+2qAPCWKkAwa+jpTnpFuZ72FGCRK59vn6X/VEgAGU447g/N4r6jOnQ4UNxu nJ0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=thread-index:thread-topic:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject :references:in-reply-to:message-id:cc:to:from:date; bh=Zmu5uMIZDi7UNA1wCNOlWfc1y0uv4VP1QuGxQKiV3nw=; fh=NbQL9aypssUAPqYRWwU2IsPGjFey30rgkoE3g8G6t9o=; b=JG7SY0yO5mU6K8IOxNf386EstJgipxe50AD7JZtWt315hRWQV4zICvvk3vEfzppR+Y VdSK+70P3VwbY+JSiYNa1w4anWpytbh89JCy1DfzbeRXedvk6ndaL1a0Rz0xkDKzfPs0 2k781oXWBpd+4Yy6bbv+gomqwW3tHDGAJ3BGoQ/UomBBNR7DUgii+CKr+NDM2h2qGw0j WyosaSyBNk4ibNfC1QD2FChPe6oYoesuCySkpmJn4I7e5UF/jXXyf86XOaAFkuPd2CSs 8iVfNMt8O1Cg3bipyUO2Irsem2Z+ZXPwFa+JrZ5sAgtZqZ1kah6nF/gwd01T0i4ibz2Q f+aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-95492-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95492-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d19-20020a1709061f5300b00a3d991c4f5dsi6722206ejk.954.2024.03.07.04.04.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 04:04:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95492-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-95492-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95492-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id CEC3B1F26F96 for ; Thu, 7 Mar 2024 11:53:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C097512CD80; Thu, 7 Mar 2024 11:51:13 +0000 (UTC) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 691AE12AAF3; Thu, 7 Mar 2024 11:51:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.201.40.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709812273; cv=none; b=RkHPpsCHQyDahZjsGzTUPRaaamQ5v8ZPIq8PRWZyl0iVCg7x+Yb5tPhJ9iyAmEhQEc3Lz2Z+6NYX0XYEIHRZfDr/0vtmkCnSe6nH7xeCDCuY/GtaLmOitN93dKZEdTcYq9vfvF0gbEyAO1t2ymcfZmiGfxIUob3fHkcr4LUNeuQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709812273; c=relaxed/simple; bh=Zmu5uMIZDi7UNA1wCNOlWfc1y0uv4VP1QuGxQKiV3nw=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=YEDSYFMdPfddg84lxETVyegVO7h4XZkRZVHMmFrH82aWHozXpdigenmZBwG27xnTyHh+Eo2lNx4x7QADwNz5Bd15dJAVjiEN3HUt5/SxTc2z2JIcsDllJmOal8d+5FG9cuNk2YVHsyD/NrnXTLRBtlu+4Js0tOlkNveKlOZxG9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nod.at; spf=fail smtp.mailfrom=nod.at; arc=none smtp.client-ip=195.201.40.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nod.at Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nod.at 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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== ----- 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