From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-983322-1519719611-2-6622972747087626038 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no ("Email failed DMARC policy for domain") X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.249, ME_NOAUTH 0.01, RCVD_IN_DNSWL_HI -5, T_RP_MATCHES_RCVD -0.01, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='209.132.180.67', Host='vger.kernel.org', Country='CN', FromHeader='com', MailFrom='org' X-Spam-charsets: X-IgnoreVacation: yes ("Email failed DMARC policy for domain") X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: linux-api-owner@vger.kernel.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=arctest; t=1519719611; b=qvOzoNs2rZkHihu1dGFlOCsd5YJXKj25BxwS87l4badmUx3 NE58pj193h0faWyOgbO9yaknS/HD+0KsNkW17A6c1GAxRmHKZWb7AL1LWNGAu9/j cpmu9KPg9l4ZeT2KcO2e/5Q1ShBUEM8kOicPd8J8STYJ9DemGyRkGPAiuQD+MhPQ M0ChqU9DV4qWCA2uwt7EkaZKvT9c0j49pSq+pD7YpB4ZS/oplf9pnqZYd2bbpReJ /4Ouv8W/3M9Hn6YFswB7wtjE45gZlv36yTZoRIXP3kqoRwDyQsrA7OihUIG3bcPz MQMXZKwEwpbkr/bKs0YqVWj2pF3nA0KuzyqILjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:date:message-id:sender :list-id; s=arctest; t=1519719611; bh=5qrHL2V6pqti0d6XMvQXJKIf7O nT1ixS/5dm6h8ufR0=; b=ofKnJF/m/M57RCgnifj/oQm9ZB0c6H7DTkU7b24Tmt BBcFfBCJO2evtiZge2Fdgs05SJ9J2aHZI0eJbvBzc5XGFNqrgAcyFcKgFob5hI2l t7zT5lz38cNl5iath9Mhp54sbMn5wQ/GoyESqlDiIkdhFgJIhk3ZpWYw6ivHkCO7 SHOX7G4LSF0YseqhDiTDDqioCYgdZ0IylUYn2DQS44u4X77Pcu8lX2z2Cey0Zzom REK4gq6x3Fqj5lSnW2+r8C2dTpaVdQkULJPeCBzQClj9drNJp4DomSF/trgWSxDW 6xEaILy6g64oEAulNrIrRkJ+eJsloFguHojnDbdl1++w== ARC-Authentication-Results: i=1; mx6.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=fail (p=none,has-list-id=yes,d=none) header.from=linux.vnet.ibm.com; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=linux-api-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=linux.vnet.ibm.com header.result=pass header_org.domain=ibm.com header_org.result=pass header_is_org_domain=no Authentication-Results: mx6.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=fail (p=none,has-list-id=yes,d=none) header.from=linux.vnet.ibm.com; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=linux-api-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=linux.vnet.ibm.com header.result=pass header_org.domain=ibm.com header_org.result=pass header_is_org_domain=no Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbeB0IUF (ORCPT ); Tue, 27 Feb 2018 03:20:05 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36190 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752098AbeB0IUD (ORCPT ); Tue, 27 Feb 2018 03:20:03 -0500 From: Mike Rapoport To: Andrew Morton , Andrea Arcangeli Cc: Pavel Emelyanov , linux-mm , linux-api , lkml , crml , Mike Rapoport Subject: [PATCH 0/3] userfaultfd: non-cooperative: syncronous events Date: Tue, 27 Feb 2018 10:19:49 +0200 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18022708-0040-0000-0000-00000438442A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022708-0041-0000-0000-000020DA6EEC Message-Id: <1519719592-22668-1-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-27_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802270100 Sender: linux-api-owner@vger.kernel.org X-Mailing-List: linux-api@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: Hi, These patches add ability to generate userfaultfd events so that their processing will be synchronized with the non-cooperative thread that caused the event. In the non-cooperative case userfaultfd resumes execution of the thread that caused an event when the notification is read() by the uffd monitor. In some cases, like, for example, madvise(MADV_REMOVE), it might be desirable to keep the thread that caused the event suspended until the uffd monitor had the event handled to avoid races between the thread that caused the and userfaultfd ioctls. Theses patches extend the userfaultfd API with an implementation of UFFD_EVENT_REMOVE_SYNC that allows to keep the thread that triggered UFFD_EVENT_REMOVE until the uffd monitor would not wake it explicitly. Mike Rapoport (3): userfaultfd: introduce userfaultfd_init_waitqueue helper userfaultfd: non-cooperative: generalize wake key structure userfaultfd: non-cooperative: allow synchronous EVENT_REMOVE fs/userfaultfd.c | 191 +++++++++++++++++++++++++++++---------- include/uapi/linux/userfaultfd.h | 14 +++ 2 files changed, 158 insertions(+), 47 deletions(-) -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f198.google.com (mail-qk0-f198.google.com [209.85.220.198]) by kanga.kvack.org (Postfix) with ESMTP id 1A0206B0006 for ; Tue, 27 Feb 2018 03:20:04 -0500 (EST) Received: by mail-qk0-f198.google.com with SMTP id g127so14748452qkc.14 for ; Tue, 27 Feb 2018 00:20:04 -0800 (PST) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id w198si4758968qkw.123.2018.02.27.00.20.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 00:20:03 -0800 (PST) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1R8JGMe144861 for ; Tue, 27 Feb 2018 03:20:02 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gd23c3xhb-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 27 Feb 2018 03:20:02 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Feb 2018 08:20:00 -0000 From: Mike Rapoport Subject: [PATCH 0/3] userfaultfd: non-cooperative: syncronous events Date: Tue, 27 Feb 2018 10:19:49 +0200 Message-Id: <1519719592-22668-1-git-send-email-rppt@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Andrea Arcangeli Cc: Pavel Emelyanov , linux-mm , linux-api , lkml , crml , Mike Rapoport Hi, These patches add ability to generate userfaultfd events so that their processing will be synchronized with the non-cooperative thread that caused the event. In the non-cooperative case userfaultfd resumes execution of the thread that caused an event when the notification is read() by the uffd monitor. In some cases, like, for example, madvise(MADV_REMOVE), it might be desirable to keep the thread that caused the event suspended until the uffd monitor had the event handled to avoid races between the thread that caused the and userfaultfd ioctls. Theses patches extend the userfaultfd API with an implementation of UFFD_EVENT_REMOVE_SYNC that allows to keep the thread that triggered UFFD_EVENT_REMOVE until the uffd monitor would not wake it explicitly. Mike Rapoport (3): userfaultfd: introduce userfaultfd_init_waitqueue helper userfaultfd: non-cooperative: generalize wake key structure userfaultfd: non-cooperative: allow synchronous EVENT_REMOVE fs/userfaultfd.c | 191 +++++++++++++++++++++++++++++---------- include/uapi/linux/userfaultfd.h | 14 +++ 2 files changed, 158 insertions(+), 47 deletions(-) -- 2.7.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org