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 6ED28E7716C for ; Thu, 5 Dec 2024 12:20:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE8976B0083; Thu, 5 Dec 2024 07:20:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C98526B0085; Thu, 5 Dec 2024 07:20:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5FAA6B0088; Thu, 5 Dec 2024 07:20:44 -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 978E46B0083 for ; Thu, 5 Dec 2024 07:20:44 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id F177181524 for ; Thu, 5 Dec 2024 12:20:43 +0000 (UTC) X-FDA: 82860813672.16.C896A4F Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf26.hostedemail.com (Postfix) with ESMTP id 63226140010 for ; Thu, 5 Dec 2024 12:20:30 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="DWDe/r8m"; spf=pass (imf26.hostedemail.com: domain of alx@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alx@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733401227; a=rsa-sha256; cv=none; b=de7o/NpMI3pubHPv3ul5owuU7Vfmli/eF9jXSFx9fHj6rnj6X6xKc9b6FHn1aD2oSipbnr n3TUcT3G7xeHXyEe03fRjCiqj7hkm2Ck0CaIa/j1JJUgYj7vBSJfCsBXPOvRBtWstxCsq1 BXLQVpaDknrjtjePZNLg21CHBMtzFAc= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="DWDe/r8m"; spf=pass (imf26.hostedemail.com: domain of alx@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alx@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733401227; 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=R2Q3Vd16IxoqFPmKuzb2EDwH4oB6mzXIDAYNQPV/gu0=; b=bfa3K6YqYo1YQH77ub5beNSfjYKfLvq3WuFzC3lxYuJolTvXyNkbU1Lg/XFBYNYtb26o4Z 5ODCBSitMsjLXU+lhZ1ciYdTVk7hbdpQTEQbN+R+FwCagBSzR3hGzxj8qceUyxgInhDcLL O1JYbrTBotBu4m9yuPypez/Pe0jXM5M= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 6439E5C6AA4; Thu, 5 Dec 2024 12:19:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F432C4CEDC; Thu, 5 Dec 2024 12:20:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733401241; bh=y34b6wYkBZZ5f99sqZ7IgaZjYWtssYY5QToz/7RxTao=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DWDe/r8mQPxAnIDvWBLLtGrT6TTRxaMeXtDKcHHaC3kSyBISSosGTqN9F7Z67RJ1e DjLxEBzFcxK6dyTVMX/UJMyDybVrnzzaWels88O/979GkPonvNl/Bs5DsBZ+CQTkO8 gFaz06M1atrds5PmMArmnWfUmM6nTd8S5Er5jOyDJnj997wW7101zloOEuz6NpmxKh 9Gnrys8Ds4h02eYW/gnQp0hGtL426JVQa8NCzQV3RDBIpbiMOE0IIaGiOVUZhUIsO0 Sq0wujSN8P7ZtaeqSKmnJCKC9O6gRQfxQG6Dh90IBhCR+hwzp/opYprp3aOmMxW7xI ZjZbbZ9TX1nEA== Date: Thu, 5 Dec 2024 13:20:37 +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 Subject: Re: [PATCH man-pages v4] madvise.2: add MADV_GUARD_INSTALL, MADV_GUARD_REMOVE description Message-ID: <20241205122037.7u2lbjix6mawoepr@devuan> References: <20241205104125.67518-1-lorenzo.stoakes@oracle.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wxud6xyyvr3usroj" Content-Disposition: inline In-Reply-To: <20241205104125.67518-1-lorenzo.stoakes@oracle.com> X-Rspamd-Queue-Id: 63226140010 X-Stat-Signature: 7fgu1ykksr1m8ow5g8g5jcuc7xif6do6 X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1733401230-123669 X-HE-Meta: U2FsdGVkX1+6ZMVV0RARr/mdQgsQkRQO8QAKnYExjm3gW9URV7lQETLPhea/bokHfvG7GmMUr18WddGKavBRANuP1cPytmK8yu3vuxyxuwbEvgQhBNfjJzIxfiV/L/Zcm82UyF2QcH19l8ez1PMxxDRRB/URR1VOsbeXeVtyy4pVuR4L6IVWI/Qu9GJVWWiybDYSwsM1rDtZ/SE1IunmnJWs/pwhxli/gl1O71e+EOiyzHOtggPZWP+rpvLUI3wms8Av1I1YI/VcXfC+yfkcAaOaJJXh9S7LO0DNKupNfygvDxneprs36eqdPkAuSCOazQFcx37z/N7USYD1gZQRB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z8k33ERBKlU+3fn8dKZk65zaV7RPMsvT2KVmkxt917rlsIrZKp+Xmd1efq3qsdoq9jPQSVC3cvz0MZb0h1Msw6VSrdMtLAOOsnCUFrLXFx9lCj0X/4ziEqBcbCPy0QdtSDJRiw62cgfmqNL4Iz+CyG+RGCPnBzjpGUPcG51tdIvurFHRL 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: --wxud6xyyvr3usroj Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH man-pages v4] madvise.2: add MADV_GUARD_INSTALL, MADV_GUARD_REMOVE description MIME-Version: 1.0 Hi Lorenzo, Jann, > Subject: Re: [PATCH man-pages v4] madvise.2: add MADV_GUARD_INSTALL, MADV= _GUARD_REMOVE description We use uppercase after the prefix, so s/add/Add/. On Thu, Dec 05, 2024 at 10:41:25AM +0000, Lorenzo Stoakes wrote: > Lightweight guard region support has been added to Linux 6.13, which adds > MADV_GUARD_INSTALL and MADV_GUARD_REMOVE flags to the madvise() system > call. Therefore, update the manpage for madvise() and describe these The right amount of inter-sentence space is two. See this: > operations. >=20 > Reviewed-by: Jann Horn Thanks for the review! > Signed-off-by: Lorenzo Stoakes Thanks for the patch! I've applied it, with some minor tweaks. See comments below. Here's the diff that I applied when amending your patch: diff --git i/man/man2/madvise.2 w/man/man2/madvise.2 index adb372424..fa24f6bf6 100644 --- i/man/man2/madvise.2 +++ w/man/man2/madvise.2 @@ -678,7 +678,8 @@ .SS Linux-specific advice values the process can be killed at any moment when the system runs out of memory. .TP .BR MADV_GUARD_INSTALL " (since Linux 6.13)" -Install a lightweight guard region into the range specified by +Install a lightweight guard region +into the range specified by .I addr and .IR size , @@ -686,22 +687,27 @@ .SS Linux-specific advice values .B SIGSEGV signal being raised. .IP -If the region maps memory pages they will be cleared as part of the operat= ion, +If the region maps memory pages +they will be cleared as part of the operation, though if .B MADV_GUARD_INSTALL -is applied to regions containing pre-existing lightweight guard regions, +is applied to regions +containing pre-existing lightweight guard regions, they are left in place. .IP -This operation is only supported for writable anonymous private mappings w= hich -have not been mlock'd. +This operation is supported +only for writable anonymous private mappings +which have not been mlock'd. An .B EINVAL error is returned if it is attempted on any other kind of mapping. .IP This operation is more efficient than mapping a new region of memory .BR PROT_NONE , -as it does not require the establishment of new mappings, -instead regions of an existing mapping simply have their page tables +as it does not require the establishment of new mappings. +Instead, +regions of an existing mapping +simply have their page tables manipulated to establish the desired behavior. No additional memory is used. .IP @@ -740,12 +746,15 @@ .SS Linux-specific advice values operation is applied to them. .TP .BR MADV_GUARD_REMOVE " (since Linux 6.13)" -Remove any lightweight guard regions which exist in the range specified by +Remove any lightweight guard regions +which exist in the range specified by .I addr and .IR size . .IP -All mappings in the range other than lightweight guard regions are left in= place +All mappings in the range +other than lightweight guard regions +are left in place (including mlock'd mappings). The operation is, however, > --- > v4: > * Reference function chapters as per Alejandro. > * Minor rewording as per Alejandro. >=20 > v3: > * Don't describe SIGSEGV as a fatal signal as per Jann. > https://lore.kernel.org/all/20241202165829.72121-1-lorenzo.stoakes@oracle= =2Ecom >=20 > v2: > * Updated to use semantic newlines as suggested by Alejandro. I've broken lines a little bit more, even though they were correct, just for having shorter lines. > * Avoided emboldening parens as suggested by Alejandro. > * One very minor grammatical fix. > https://lore.kernel.org/all/20241129155943.85215-1-lorenzo.stoakes@oracle= =2Ecom >=20 > v1: > https://lore.kernel.org/all/20241129093205.8664-1-lorenzo.stoakes@oracle.= com >=20 > man/man2/madvise.2 | 93 ++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 93 insertions(+) >=20 > diff --git a/man/man2/madvise.2 b/man/man2/madvise.2 > index 4f2210ee2..7d682fa40 100644 > --- a/man/man2/madvise.2 > +++ b/man/man2/madvise.2 > @@ -676,6 +676,91 @@ or secret memory regions created using > Note that with > .BR MADV_POPULATE_WRITE , > the process can be killed at any moment when the system runs out of memo= ry. > +.TP > +.BR MADV_GUARD_INSTALL " (since Linux 6.13)" > +Install a lightweight guard region into the range specified by > +.I addr > +and > +.IR size , > +causing any read or write in the range to result in a > +.B SIGSEGV > +signal being raised. > +.IP > +If the region maps memory pages they will be cleared as part of the oper= ation, > +though if > +.B MADV_GUARD_INSTALL > +is applied to regions containing pre-existing lightweight guard regions, > +they are left in place. > +.IP > +This operation is only supported for writable anonymous private mappings= which I missed this before. It was the same misplacement of only. :) Have a lovely day! Alex --=20 --wxud6xyyvr3usroj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmdRmpQACgkQnowa+77/ 2zJY+xAAieljvP/aSshuj1XcPWP/V8ZMZNaHtrGNpA+kruAcE74fkTOyTOwSgneA oQNL6J17uUjvaIKrWl0UYCBkBKGRbyDaCi53Npo4QGo0ZPdyVUAZWAXr6rz18iYu dY0XMvojnuvqyxYJ8qDcMNLcU4F3Xhi6zYM2npEDdR3/9gZ4/B7AcxJLo7QmZM1q oafNRJxYvORcBxENz0iEl30Zp1afIvYPcDZ8MrP+yLcSIrmz0GroE1HwMYfd3+ki 9xdXEB1pmZhy/3BXWmy73qOjOAUET68p7VQVBVQ5tXc1VVtNL66klL8bY8nyqvvI jKaT4CYtM/ZCWtiHNigbQXIhq5pXavlW0avqGydVwzbcDBTXxJAauRooVSBpMED0 Ic0LYVRMcgon2Wmg2A782e8NLibR4XtCUJM4KJzhF8CkT4psoGJ1iktcS4HipzsS EVFma7VWdSuMVreKzwxeWdHE3txRTxfQzHV7/S8alutSXHaJ+tovkw/ILSVfFNxO J89YyqNt8qp8Ez9LBb/Nu2l+dcYxNsZi6szKsIgBF8/+xB5Of18H9AIRORmF1Tus 3Ul5/LwG5N/MQXxYDYw4xUr59/oOwqDNbLMBiRZ+RSgsTDR1Ps0UVy5190lc9rFT cW7P8T2o5uyYUc8uhlRC1/hv3l+fotaWxFBB6gkJ1XgWyLyWiCM= =cPIw -----END PGP SIGNATURE----- --wxud6xyyvr3usroj--