From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753174AbdJGOoT (ORCPT ); Sat, 7 Oct 2017 10:44:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34226 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145AbdJGOoR (ORCPT ); Sat, 7 Oct 2017 10:44:17 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F37D985547 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=aarcange@redhat.com Date: Sat, 7 Oct 2017 16:44:15 +0200 From: Andrea Arcangeli To: Prakash Sangappa Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-mm@kvack.org, rppt@linux.vnet.ibm.com, mhocko@suse.com Subject: Re: [PATCH] Userfaultfd: Add description for UFFD_FEATURE_SIGBUS Message-ID: <20171007144415.GG16918@redhat.com> References: <1507344740-21993-1-git-send-email-prakash.sangappa@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1507344740-21993-1-git-send-email-prakash.sangappa@oracle.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 07 Oct 2017 14:44:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Prakash, On Fri, Oct 06, 2017 at 07:52:20PM -0700, Prakash Sangappa wrote: > Userfaultfd feature UFFD_FEATURE_SIGBUS was merged recently and should > be available in Linux 4.14 release. This patch is for the manpage > changes documenting this API. > > Documents the following commit: > > commit 2d6d6f5a09a96cc1fec7ed992b825e05f64cb50e > Author: Prakash Sangappa > Date: Wed Sep 6 16:23:39 2017 -0700 > > mm: userfaultfd: add feature to request for a signal delivery > > Signed-off-by: Prakash Sangappa > --- > man2/ioctl_userfaultfd.2 | 9 +++++++++ > man2/userfaultfd.2 | 17 +++++++++++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2 > index 60fd29b..cfc65ae 100644 > --- a/man2/ioctl_userfaultfd.2 > +++ b/man2/ioctl_userfaultfd.2 > @@ -196,6 +196,15 @@ with the > flag set, > .BR memfd_create (2), > and so on. > +.TP > +.B UFFD_FEATURE_SIGBUS > +Since Linux 4.14, If this feature bit is set, no page-fault events( space after events? > +.B UFFD_EVENT_PAGEFAULT > +) will be delivered, instead a > +.B SIGBUS > +signal will be sent to the faulting process. Applications using this > +feature will not require the use of a userfaultfd monitor for handling > +page-fault events. > .IP > The returned > .I ioctls > diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2 > index 1741ee3..a033742 100644 > --- a/man2/userfaultfd.2 > +++ b/man2/userfaultfd.2 > @@ -172,6 +172,23 @@ or > .BR ioctl (2) > operations to resolve the page fault. > .PP > +Starting from Linux 4.14, if application sets > +.B UFFD_FEATURE_SIGBUS > +feature bit using > +.B UFFDIO_API > +.BR ioctl (2) > +, no page fault notification will be forwarded to > +the user-space, instead a > +.B SIGBUS > +signal is delivered to the faulting process. With this feature, > +userfaultfd can be used for robustness purpose to simply catch > +any access to areas within the registered address range that do not > +have pages allocated, without having to deal with page-fault events. ",without having to listen to userfaultfd events." may be more clear. > +No userfaultd monitor will be required for handling page faults. For ^ typo: userfaultfd > +example, this feature can be useful for applications that want to > +prevent the kernel from automatically allocating pages and filling > +holes in sparse files when the hole is accessed thru mapped address. > +.PP Maybe also mention that "The UFFD_FEATURE_SIGBUS feature is implicitly inherited through fork() if used in combination with UFFD_FEATURE_FORK."