Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1431869AbdDYQaP (ORCPT ); Tue, 25 Apr 2017 12:30:15 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53589 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1176028AbdDYQ3c (ORCPT ); Tue, 25 Apr 2017 12:29:32 -0400 From: Mike Rapoport To: "Michael Kerrisk (man-pages)" Cc: Andrea Arcangeli , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-man@vger.kernel.org, Mike Rapoport Subject: [PATCH 5/5] usefaultfd.2: add brief description of "non-cooperative" mode Date: Tue, 25 Apr 2017 19:29:08 +0300 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1493137748-32452-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1493137748-32452-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042516-0012-0000-0000-00000516B267 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042516-0013-0000-0000-00001833E485 Message-Id: <1493137748-32452-6-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-25_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704250296 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1303 Lines: 32 Signed-off-by: Mike Rapoport --- man2/userfaultfd.2 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2 index dc37319..291dd10 100644 --- a/man2/userfaultfd.2 +++ b/man2/userfaultfd.2 @@ -89,6 +89,20 @@ them using the operations described in .BR ioctl_userfaultfd (2). When servicing the page fault events, the fault-handling thread can trigger a wake-up for the sleeping thread. + +It is possible for the faulting threads and the fault-handling threads +to run in the context of different processes. +In this case, these threads may belong to different programs, +and the program that executes the faulting threads +will not necessarily cooperate with the program that handles the page faults. +In such non-cooperative mode, +the process that monitors userfaultfd and handles page faults, +needs to be aware of the changes in the virtual memory layout +of the faulting process to avoid memory corruption. +.\" FIXME elaborate about non-cooperating mode, describe its limitations +.\" for kerneles before 4.11, features added in 4.11 +.\" and limitations remaining in 4.11 +.\" Maybe it's worth adding a dedicated sub-section... .\" .SS Userfaultfd operation After the userfaultfd object is created with -- 1.9.1