Received: by 10.223.185.116 with SMTP id b49csp304341wrg; Fri, 2 Mar 2018 19:48:56 -0800 (PST) X-Google-Smtp-Source: AG47ELsY6kk43pdMmzYYMbibJDsnfj+Nw0XiLWS70K+ZYVORpsK9guntpBgtwv13kk2Eny4e7clQ X-Received: by 10.98.204.69 with SMTP id a66mr7784260pfg.33.1520048936158; Fri, 02 Mar 2018 19:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520048936; cv=none; d=google.com; s=arc-20160816; b=L5DjizSvTvgJv8aVDKSAYvAUCLpiEqnEtDzPibyq2AOhoRDfVfWzx4lDLI7QoD9zew pbpWwnTGctSNduvy8aoBs2aVlYLZHMP8Td+LsxW4F91jDLtyzGJpZqggrW58CoXTwrvb AEyfxH5BagiTpOk8Usc71zO1grjQ9j9Bt5Qil3WvL6gnE+V9vQwkSGLJIRDe0qExknz8 X0aF0VsCNQi8bmgj70bJAvJtV8IRTTIx/kjLsH3JVx//babwvNTMq2VTRa5IdmoemC0G vL8PQzo9DTBfasdYQpCrhq/E8Lx6DhLlvz81aOSpUJD7uFi6ZynRMj8yNu1pFfYMid17 eniA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=MnfyTBG5cB4NEmIqoSGE9PDBVdl0CExCsFJdId7sSNk=; b=LS03/+EoGE8y89ESeeD2Bc/Gh43dE7SuC1SW9Lz8lnOEguNdqSGJq6nG4z+0HHc32O wVwaHokkRXTL+d9O4AKq17PJ9/Y5QNOGbthIP8q4ntp2lgWtJlG9rgxJyGSSgBj5akmN n53re7jV6Z/RFnpJzyXap2EKbNATf2cyzYpszXgkQhRKSIDpTeehdt7DTG67W3pc+6TW RHUIH2NCiV6cS/DXjHvQ/Zwfr9GNAyRyT7vYFD1KH+HQ+7b3mL546huDXUkUd/6ZSnPa zhftQPUxGNdou+88Vx9eI/exycbLj9w03qolxGfiGmgF/6g1/YXMubt11a68Or2kuMQr 79JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si4912726pgc.593.2018.03.02.19.48.41; Fri, 02 Mar 2018 19:48:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934757AbeCBXiy (ORCPT + 99 others); Fri, 2 Mar 2018 18:38:54 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52824 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934410AbeCBXiv (ORCPT ); Fri, 2 Mar 2018 18:38:51 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.71]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EFDB91299; Fri, 2 Mar 2018 23:38:50 +0000 (UTC) Date: Fri, 2 Mar 2018 15:38:49 -0800 From: Andrew Morton To: Mike Rapoport Cc: Andrea Arcangeli , Pavel Emelyanov , linux-mm , linux-api , lkml , crml Subject: Re: [PATCH 0/3] userfaultfd: non-cooperative: syncronous events Message-Id: <20180302153849.d9d7b9a873755c6f5e883d0d@linux-foundation.org> In-Reply-To: <1519719592-22668-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1519719592-22668-1-git-send-email-rppt@linux.vnet.ibm.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Feb 2018 10:19:49 +0200 Mike Rapoport wrote: > 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. "might be desirable" is a bit weak. It might not be desirable, too ;) _Is_ it desirable? What are the use-cases and what is the end-user benefit?