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 BF544C369D3 for ; Wed, 23 Apr 2025 10:05:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C94086B008A; Wed, 23 Apr 2025 06:05:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C1B8F6B0092; Wed, 23 Apr 2025 06:05:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABDB56B0099; Wed, 23 Apr 2025 06:05:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 891596B008A for ; Wed, 23 Apr 2025 06:05:49 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 886B21C7675 for ; Wed, 23 Apr 2025 10:05:50 +0000 (UTC) X-FDA: 83364877260.10.ABAF9FD Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf17.hostedemail.com (Postfix) with ESMTP id C4F384000E for ; Wed, 23 Apr 2025 10:05:48 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=PQ7KwXhd; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf17.hostedemail.com: domain of alx@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=alx@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1745402749; a=rsa-sha256; cv=none; b=gtJ5JJtJ79UW4ZjPTnyeQMbKU5mgB7G00asJt2NdAQBCBiE+b3HnVPBfLc6QpzMbekmgNZ cOULeHm9GGQDXisku7QdA0AgMf2gTR9KW/OOhK/tVz+x9R2wigyoC0//3DPP5laIlWwm/i XYVRFXPs/rStaKuS0iOTBHVuZfKyzjY= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=PQ7KwXhd; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf17.hostedemail.com: domain of alx@kernel.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=alx@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1745402749; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=wx9sRjuU5+YA3mn/HunvjBotwD4S1fPU+d5d4fasS7Q=; b=CzJCJexKaqTTZovmbCl4UKbNKhX0yV7B3os5asAhspAGKKiHTNSNsEHk80GEveQK6H61IP xU6F/3UYNEF5iFPEIG8QrgS0Wgbe/AKYMCzx32d3d8Wa74Gw+sUnr0ygD1CChL3G7H56GJ hc8l80uurKIxiSeogHu6xKTA4giyL8o= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 4F12044E22; Wed, 23 Apr 2025 10:05:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB8EFC4CEEC; Wed, 23 Apr 2025 10:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745402747; bh=DfsVIgNgdjnQ52KGbTB2k7GrberIq5ZMaZDqr7qHW08=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PQ7KwXhd7y8LsFJr/I39b0DEpPleA7VIu8j/QsgwMWGDxvi8sHEzVxC2cRKFSP7pZ wlinE9yV6WR9pPIVbW3k9hRGiE+vrBqLwbUiOmeQBE9wBfoNGofAtkz9hKSOPQhm92 14gk5KbRkltTWO6ZI3mWqNArRdJZYSGYqoWVD9bSOjD7FQB/eWymylMELtnxZeB4Pb M8ExgP7Xq+99Wq/dTZcbOpSp6PsyIGeDk9p9WVSSaoNpdFt+Uvy13SuMIBQE26cjOz zo3LP6iODuKpu8wlIRgVEatA8SDna5I8BKP9FtLMW+3C7wR13D4AmUj4GzFQ0878c+ uzSMv8+76FG2w== Date: Wed, 23 Apr 2025 12:05:42 +0200 From: Alejandro Colomar To: Lorenzo Stoakes Cc: linux-man@vger.kernel.org, Suren Baghdasaryan , "Liam R . Howlett" , Matthew Wilcox , Vlastimil Babka , Jann Horn , linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH] madvise.2: update MADV_GUARD_INSTALL, MADV_GUARD_REMOVE description Message-ID: References: <20250317210653.273728-1-lorenzo.stoakes@oracle.com> <4f3180f4-c18b-4494-a619-2c22a69411aa@lucifer.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vnt25pqpdmdbqiu4" Content-Disposition: inline In-Reply-To: <4f3180f4-c18b-4494-a619-2c22a69411aa@lucifer.local> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C4F384000E X-Stat-Signature: hijpunxqomsdkfwdo48qc317z6n4e6m1 X-Rspam-User: X-HE-Tag: 1745402748-51256 X-HE-Meta: U2FsdGVkX1991mhRenLwv381u++UNAzmhC1dPzlWAB7enRvduBiA4iQO8NXE52Zp+WZO+iqjON6IQaxGsvn6LGzlQtDppGP1MXrDg+O/Bdi+EY3Tmf+lCH2fcKeGo8nqVNvFdpNS7xvx7wovsLEGeFRhOu3KVKIhBTZ5iZ+vnDZVtKUm/jicZjmbID7LbNfq+mmt+iy9lZq7Z4WO1I+DIA+8yVCFmegK2n6IjXFLWX/E6h4HEuAM5OkF/IXlP5req5xv9h+NK4l5DzZp2DVoPry7fyaYhwDFvaqW0u73rOpVZXNHwFYKH1IoHKz/FFubB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7O/PIJUuQ/yDIqZ0cep+DjW1wLReNi+3OEgx6TQyItu2SX/yYj1utfQthg= 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: List-Subscribe: List-Unsubscribe: --vnt25pqpdmdbqiu4 Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable From: Alejandro Colomar To: Lorenzo Stoakes Cc: linux-man@vger.kernel.org, Suren Baghdasaryan , "Liam R . Howlett" , Matthew Wilcox , Vlastimil Babka , Jann Horn , linux-mm@kvack.org, Andrew Morton Subject: Re: [PATCH] madvise.2: update MADV_GUARD_INSTALL, MADV_GUARD_REMOVE description References: <20250317210653.273728-1-lorenzo.stoakes@oracle.com> <4f3180f4-c18b-4494-a619-2c22a69411aa@lucifer.local> MIME-Version: 1.0 In-Reply-To: <4f3180f4-c18b-4494-a619-2c22a69411aa@lucifer.local> Hi Lorenzo, On Wed, Apr 23, 2025 at 10:37:57AM +0100, Lorenzo Stoakes wrote: > Hi Alejandro, >=20 > Sorry for being slow on this, LSF and workload has held me up a bit, will= apply > your feedback and send a v2 soon. No problem. Take as much time as you need. :) Have a lovely day! Alex >=20 > Thanks, Lorenzo >=20 > On Sun, Mar 23, 2025 at 09:15:36PM +0100, Alejandro Colomar wrote: > > Hi Lorenzo, > > > > On Mon, Mar 17, 2025 at 09:06:53PM +0000, Lorenzo Stoakes wrote: > > > Lightweight guard region support has been extended in Linux 6.15, > > > permitting the use of these features for file-backed and read-only > > > mappings. > > > > > > Update the description for these operations in the madvise manpage to > > > describe the changed behaviour. > > > --- > > > man/man2/madvise.2 | 37 +++++++++++++++++++++++++++---------- > > > 1 file changed, 27 insertions(+), 10 deletions(-) > > > > > > diff --git a/man/man2/madvise.2 b/man/man2/madvise.2 > > > index bd2b90b7a..37492c8cf 100644 > > > --- a/man/man2/madvise.2 > > > +++ b/man/man2/madvise.2 > > > @@ -697,9 +697,22 @@ is applied to regions > > > containing pre-existing lightweight guard regions, > > > they are left in place. > > > .IP > > > -This operation is supported > > > -only for writable anonymous private mappings > > > -which have not been mlock'd. > > > +Prior to Linux v6.15 This operation was supported > > > > We don't use 'v' for version numbers. > > > > alx@devuan:~/src/linux/man-pages/man-pages/contrib$ grep -rho 'Linux [= 1-6][^ ]*' | wc -l > > 7679 > > alx@devuan:~/src/linux/man-pages/man-pages/contrib$ grep -rho 'Linux v= [1-6][^ ]*' | wc -l > > 13 > > > > (Oh, well, I need to fix those 13 places.) > > > > Also, there should be a comma (and lowercase): > > > > Prior to Linux 6.15, > > this operation ... > > > > > +only for writable anonymous private mappings. > > > +Since Linux v6.15 both anonymous and file-backed > > > > A comma here too. > > > > > +mappings are supported, including read-only mappings. > > > > I'd break the line after the comma (and put 'mappings ...,' in the > > previous one). > > > > > +.IP > > > +The mapping must not be mlock'd, > > > +nor can they map hugetlb ranges > > > > mapping is singular, but they is plural. Did I misunderstand, or is it > > a typo? > > > > > +or special mappings > > > > I think there should be some punctuation here, but let's revisit after > > the rest of the paragraph is revised. > > > > > +for example, > > > +mappings marked with kernel-internal flags such as > > > +.B VM_PFNMAP > > > +or > > > +.BR VM_IO , > > > +or secret memory regions created using > > > +.BR memfd_secret(2) . > > > > The space should go before (2), not after. > > > > > +.IP > > > An > > > .B EINVAL > > > error is returned if it is attempted on any other kind of mapping. > > > @@ -756,19 +769,23 @@ and > > > .IP > > > All mappings in the range > > > other than lightweight guard regions > > > -are left in place > > > -(including mlock'd mappings). > > > -The operation is, > > > -however, > > > -valid only for writable anonymous private mappings, > > > +are left in place. > > > +The operation is supported on those mappings > > > +permitted by > > > +.B MADV_GUARD_INSTALL > > > +in addition to mlock()'d mappings, > > > returning an > > > .B EINVAL > > > error otherwise. > > > .IP > > > When lightweight guard regions are removed, > > > they act as empty regions of the containing mapping. > > > -Since only writable anonymous private mappings are supported, > > > -they therefore become zero-fill-on-demand pages. > > > +Anonymous private mappings therefore become > > > > I'd put 'therefore' as the first word in the sentence, followed by a > > comma. > > > > > +zero-fill-on-demand pages, > > > +and file-backed mappings are repopulating with the > > > > repopulat{ing =3D> ed}? > > > > > +memory contents from the up-to-date contents of the > > > +underlying mapped file. > > > + > > > > We can't have blank source lines. That results in a diagnostic. > > > > > .IP > > > If any transparent huge pages are encountered in the operation, > > > they are left in place. > > > -- > > > 2.48.1 > > > > > > > Have a lovely night! > > Alex > > > > -- > > --=20 --vnt25pqpdmdbqiu4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmgIu28ACgkQ64mZXMKQ wqmbjw/+LFZNq+iAzNgmmBd8za4l1U1q3PFyeliAAMVxrP2BLHBJFDz2Ir4KLoxX +FGQJPtb1tPPXK6mt/K+/QwwLJDX9R5y79/YIB+x+VkePPlUtx7QqetxQXYfRqqE R1cqOM5DK6TTsXpJkiRLAMvPMzf5Kmj4hP7NajXbpuapJyPiuWzAx6hM7AjaMQG1 NedhPqiL3reMQrRHbh0IhuxPiy8tivyAltE+WcDe1Cy/m882l0YQCF2VOVBwoi56 eQ0VfA4ZYFJuoNAWJ/2APb2U+QNbF/t3D6qZsWSV4t6z2rXXbUWdCaUM38h8wR7e JRaO1Fk7SASBL/m6IyIKwezDan26elKPiSaluJz0pqMCZN3WgMiXftfCNfrV4Wf6 2wDhLKORSrtPC1S7HT1jeBHffVWdzWS9h0aY3C4ZUej1MXtdwfzemGN9/1AGGAOI Wyo67wgNumARd63a0O/ESAEfEFjXj07JGqzkuFo6MwOfA+LPuX8V99nM+SzgnOEm edSs+CRLP+iCjvS0uacqNbF3zf7gcCHGTnuaatq2m1YGx6D/OjxkgQKaoTTmer/V ivrGIGN6QQKLUBDxqJIaeSUQMEUz1dIa0S06LpALjuLVDg0/1hlM9Maea0TmbVMc Jr2irTfVdizRN0gukQwENv8bNU5e+tRWu8X83YmBP+yR14egS/Q= =I05U -----END PGP SIGNATURE----- --vnt25pqpdmdbqiu4--