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 X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AC8CC43214 for ; Mon, 26 Jul 2021 07:11:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 08E2260F46 for ; Mon, 26 Jul 2021 07:11:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 08E2260F46 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 77D936B0033; Mon, 26 Jul 2021 03:11:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72E018D0002; Mon, 26 Jul 2021 03:11:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61C4E8D0001; Mon, 26 Jul 2021 03:11:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 45F376B0033 for ; Mon, 26 Jul 2021 03:11:45 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E80488249980 for ; Mon, 26 Jul 2021 07:11:44 +0000 (UTC) X-FDA: 78403868928.14.BC40D05 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 26DBB300B3CC for ; Mon, 26 Jul 2021 07:11:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627283502; h=from:from: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=UxZD54M+2X15RdHVUN51d7n66Bvp24nWS/YYICKELtg=; b=KpMob0UQEcTNklZL3AjVqckOjEGN5/SvIOnXZQt/30y9xrhv9VcCuT1fdmIvHmXxT13gf8 9D7P1nOFpOc+WKSXgos0fJ+OlOy/K0NHPTwnJLPSjhkBv7ntvg1Op9TSFEwrUdU90BxtBy HQPDjKbpFC4ikVQfd2EcgfhZk7R18Rg= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-52-KdeEsYtsPHGhGo_NWEI_3w-1; Mon, 26 Jul 2021 03:11:40 -0400 X-MC-Unique: KdeEsYtsPHGhGo_NWEI_3w-1 Received: by mail-wr1-f72.google.com with SMTP id u26-20020adfb21a0000b029013e2b4a9d1eso4358416wra.4 for ; Mon, 26 Jul 2021 00:11:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=UxZD54M+2X15RdHVUN51d7n66Bvp24nWS/YYICKELtg=; b=ETQFUczWUrnDmpfxUHB9A9tHBI0fXH7nd85lmOvQnLTccEhAKQp/En0EvfVHyOmj2O amTJU04XYdP3djGsEe18JRSlUS2dJoI85tCyykK59f/F5riwEkLOpFnS2qdtI4rnQBtE a7BVe2kFxImuzjC0qmwPTyIU1QY4JT08UCnx+jGD5kbkzsgaUWVo25YmbfLfw7bEGGJB GbnanxVvi9AU7eMkWnovWt5O11dTB9xMMxNbMn71roA6UBhUjOV10Vg3asdl06dXi4e+ RBedYwEqx3FB7rN4m4MYXa1dDcdS3mXaE4b09qtz1K8YY/ilHf1xEPJ6ehAsxADNGL9I 3dKw== X-Gm-Message-State: AOAM5339nsXuaEcC3nUH4K93Sdtc+4jZrz/I0EdeWC5j1Tv282KyJuIq 2AXZmxvfH58YUkbUJGxl+W5V7NdLxxRMptnlnbzBlOyPGysyWfYC1p7ieZw1N0nUt/EgDNGz98L qQ4ryB8Y+Rq5x/DIhTaUlvz+EmjT/PK46l2srgGY5wyBwvU2Iu9l7fwG36Mc= X-Received: by 2002:a1c:7314:: with SMTP id d20mr24979136wmb.156.1627283499378; Mon, 26 Jul 2021 00:11:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH+NQkwO85JH+ShDKhtzyyG8CINi3dIsR0mvgcBcMNSLHJu0AjSyd3HNaYH+zxfF/BnekRSA== X-Received: by 2002:a1c:7314:: with SMTP id d20mr24979089wmb.156.1627283498852; Mon, 26 Jul 2021 00:11:38 -0700 (PDT) Received: from [192.168.3.132] (p4ff23b33.dip0.t-ipconnect.de. [79.242.59.51]) by smtp.gmail.com with ESMTPSA id 125sm11520392wmb.12.2021.07.26.00.11.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Jul 2021 00:11:38 -0700 (PDT) To: "Alejandro Colomar (man-pages)" , Pankaj Gupta Cc: linux-man@vger.kernel.org, Michael Kerrisk , Andrew Morton , Michal Hocko , Oscar Salvador , Jann Horn , Mike Rapoport , Linux API , Linux MM References: <20210712083917.16361-1-david@redhat.com> <51ec094e-e402-d8a4-d65f-24b8d7929707@gmail.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v1] madvise.2: Document MADV_POPULATE_READ and MADV_POPULATE_WRITE Message-ID: <6c7543e4-23c8-8f2d-dc89-480be13738b3@redhat.com> Date: Mon, 26 Jul 2021 09:11:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <51ec094e-e402-d8a4-d65f-24b8d7929707@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KpMob0UQ; spf=none (imf09.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 26DBB300B3CC X-Stat-Signature: an1aggtq4p3k5e6eqr9ncm3851ii359f X-HE-Tag: 1627283502-481789 Content-Transfer-Encoding: quoted-printable 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: Hi Alex, >>> --- >>> man2/madvise.2 | 80 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ >>> 1 file changed, 80 insertions(+) >>> >>> diff --git a/man2/madvise.2 b/man2/madvise.2 >>> index f1f384c0c..3ec8c53a7 100644 >>> --- a/man2/madvise.2 >>> +++ b/man2/madvise.2 >>> @@ -469,6 +469,59 @@ If a page is file-backed and dirty, it will be w= ritten back to the backing >>> storage. >>> The advice might be ignored for some pages in the range when it is= not >>> applicable. >>> +.TP >>> +.BR MADV_POPULATE_READ " (since Linux 5.14) >=20 > s/$/"/ Thanks! >=20 >>> +Populate (prefault) page tables readable for the whole range without= actually >=20 > See the following extract from man-pages(7): >=20 > $ man 7 man-pages | sed -n '/Use semantic newlines/,/^$/p'; > Use semantic newlines > In the source of a manual page, new sentences should be > started on new lines, and long sentences should split into > lines at clause breaks (commas, semicolons, colons, and so > on). This convention, sometimes known as "semantic new=E2=80= =90 > lines", makes it easier to see the effect of patches, which > often operate at the level of individual sentences or sen=E2=80= =90 > tence clauses. Thanks, something like the following (also limiting to 80 characters per page) work? " Populate (prefault) page tables readable for the whole range without actu= ally reading. Depending on the underlying mapping, map the shared zeropage, preallocate memory or read the underlying file; files with holes might or might not preallocate blocks. " >=20 >>> +reading. Depending on the underlying mapping, map the shared zeropag= e, >>> +preallocate memory or read the underlying file; files with holes mig= ht or >>> +might not preallocate blocks. >>> +Do not generate >>> +.B SIGBUS >>> +when populating fails, return an error instead. >>> +.IP >>> +If >>> +.B MADV_POPULATE_READ >>> +succeeds, all page tables have been populated (prefaulted) readable = once. >>> +If >>> +.B MADV_POPULATE_READ >>> +fails, some page tables might have been populated. >>> +.IP >>> +.B MADV_POPULATE_READ >>> +cannot be applied to mappings without read permissions >>> +and special mappings marked with the kernel-internal >>> +.B VM_PFNMAP >>> +and >>> +.BR VM_IO . >>> +.IP >>> +Note that with >>> +.BR MADV_POPULATE_READ , >>> +the process can be killed at any moment when the system runs out of = memory. >>> +.TP >>> +.BR MADV_POPULATE_WRITE " (since Linux 5.14) >=20 > s/$/"/ Thanks! --=20 Thanks, David / dhildenb