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 591B4C28B30 for ; Sun, 23 Mar 2025 20:15:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1CC4A280002; Sun, 23 Mar 2025 16:15:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17D76280001; Sun, 23 Mar 2025 16:15:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 043D5280002; Sun, 23 Mar 2025 16:15:41 -0400 (EDT) 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 DA53D280001 for ; Sun, 23 Mar 2025 16:15:41 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id AE35DAB436 for ; Sun, 23 Mar 2025 20:15:43 +0000 (UTC) X-FDA: 83253921366.06.D3EA551 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf13.hostedemail.com (Postfix) with ESMTP id D8D172000F for ; Sun, 23 Mar 2025 20:15:41 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=P2qqlkmT; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf13.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=1742760942; a=rsa-sha256; cv=none; b=rShlIJ5XAXrgvWtrm+oAQbDlpoSybgfsYYFMbpb/XKIe0sLoVbMAy9R35yKWmBI5DLmkFy OhDSiDnrFxQ6EjOq+JJyvNulYY4w8IcINsf/6BE312KTJD1yCeJbEo4UN8I+dwC1CNNqfd eoQbgLX78412b1Ez4wnS0gC6kGHv+c8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=P2qqlkmT; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf13.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=1742760942; 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=mIw7ATrJXjDf1BhJNNNz+0YEwAVy73QOPuEKAPUQ73M=; b=kBv4kYodCtxStU3l+7HTSHUP+0nRBWQqWdUZ+4qpX9KJ0N59XSCe+dZwabP+J5G2ozSDs3 MgIeVkpV3+0kxOej5wFqWRgbUQXybOMYFTFgyOajtHAkG3G7NfRb/uCoEKwQx+n4tl7zR/ 33TrjopaqMP6TtvgrWp2tdGRJQsP7pE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 2C60F40C00; Sun, 23 Mar 2025 20:15:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81B71C4CEE2; Sun, 23 Mar 2025 20:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742760940; bh=SVk4j6TBdSCuy29JCC0t8p2C7ceZdG1F++o+hktnNLs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P2qqlkmTW7rpRTfiSOkHmnRuXb7mKKXk5SsG2h/QsHlsyVTatbFkBcbn1Q4CAKB/L zx1wiln2ldD813GvaN0WNWZcvjgpr9Eb4YDiwgT+QXIK+7Hi3UpAOEjSJMywRXRmji 4AkKlbbQVO1hIQA2g4bXE/dLM8ldOEJDgaoRfY9qwcAbr/ftv75jYPeTacLUGI9uT/ jEk2We+tUN4FJtK63mnRNXsX8tvclAhqu2LjowFfJQ4eYXsE63hN48MG0SfZXKye8w wAi+KVCFUj/uRuLnhShNbg9cFQPxX5+A1LF6JtJbWXTcP1PPaEurU4FKNG0Fz97xgT QBvmV+xDhYmCg== Date: Sun, 23 Mar 2025 21:15:36 +0100 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2r3ocp75ythhsiff" Content-Disposition: inline In-Reply-To: <20250317210653.273728-1-lorenzo.stoakes@oracle.com> X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D8D172000F X-Stat-Signature: e5iqqz1gr3f1hyw4js3uat6k7rat1ahy X-HE-Tag: 1742760941-623513 X-HE-Meta: U2FsdGVkX18aSaVJhMCQpLYCsARbKjzW0vsP2UJnlHbwbByWnQtmHcFeDrKzqfyCDK9uypo7YNPqBDvUt2D8WRKXukTy8a8io7gOpLoy2tT4vWCPKHxxtQcXcnDNn0ZEUdhuAljvYfbmyFLG1SuuyMRMaVRuQLmCwupkas+q1f78vRoRhKPTVpS6vQnyZzUSfTjV9lfAazWNCzxxgK/KRXCkPSPZiYkQ2W4VKzEfQJ/wDxRGFciXC/3tdw9RrBk1kI5QAgg7wmLCEUJEMG1HBu+m8MJtz7XkRlD1JH7xuV0t+SX/6CbpeUPiQQ7of3kz6eXl5w2pDxpuGcD1LgGy+tAiSFzXzP5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F9FXqLB/HP2PmYMpGI= 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: --2r3ocp75ythhsiff 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> MIME-Version: 1.0 In-Reply-To: <20250317210653.273728-1-lorenzo.stoakes@oracle.com> 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. >=20 > 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(-) >=20 > 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. > --=20 > 2.48.1 >=20 Have a lovely night! Alex --=20 --2r3ocp75ythhsiff Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmfga+IACgkQ64mZXMKQ wqmX9Q/+IdfXW+4OfBHbmYKJj2Z5k6+Atdh5Z+IhN2fa6ijTXBC9V97r3QeqXhzI DaG74efMckeg9iMq348FNT0SPnbItsadTtbnVj59pkdXVhmtczHF6kfpLVHoapVX pLr0jVVqQx0bCg9bdyclbNkRDYAmO9IBzm4QV/5PmLXqC8VcvG1fVXQoBBEzAQbO c8LF35EnI7xrF8j3Tr26dqI2sN7LeiQeQyLCWZvN4Q4Z6mYd0P2+nIU+CYfjyta0 Y4xNdNQwGKKDo4pwZZS4XdjkjIuwMLDg0ueChRCDZQJJYQA75K7pcQSb02fccnvA NJTv4gjjr7MdHUJbPDFg4dCFfVLKBSgNFFXOt1TW+ThKBSZyqmmHYZE+973XPD2/ NanJWFLn2VgKsv8L6/jW9xMzqoWZ+yh7DX2PaVUZpHxCJJjrxSfwYMAytjMv0hUB 6k0LKGqQb9yn8h5RDf6Pk4w+4FjcgGkjbLTIEExTG2NyY5GiRTnUhFM4KXSLfLqc 5V05xW8eP1jfiPKagNJ+nLWnC1ztul3ENf4wBEXyR5hPsaazDm+zO/RTODQRGJat rDgLM/1C22NR4FZPnyFWJNozH05BiJTy5kOctHQUuNzif//HOzZ8oNyUEHwmCUXu 7OfEqiXmjk6nevdOkWqlFAL/pNh/ec8Eor7kUFJAjzuIdsozK5o= =PTgC -----END PGP SIGNATURE----- --2r3ocp75ythhsiff--