From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753890AbbCPKuM (ORCPT ); Mon, 16 Mar 2015 06:50:12 -0400 Received: from plane.gmane.org ([80.91.229.3]:35384 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753770AbbCPKuI (ORCPT ); Mon, 16 Mar 2015 06:50:08 -0400 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: Thomas Martitz Subject: Re: [PATCH 10/21] userfaultfd: add new syscall to provide memory externalization Date: Mon, 16 Mar 2015 10:45:37 +0000 (UTC) Message-ID: References: <1425575884-2574-1-git-send-email-aarcange@redhat.com> <1425575884-2574-11-git-send-email-aarcange@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 87.234.237.148 (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrea Arcangeli redhat.com> writes: > > Once an userfaultfd has been created and certain region of the process > virtual address space have been registered into it, the thread > responsible for doing the memory externalization can manage the page > faults in userland by talking to the kernel using the userfaultfd > protocol. > > poll() can be used to know when there are new pending userfaults to be > read (POLLIN). > Hello, I'm wondering why a new syscall was chosen over a simple special file /dev/userfault (analogous to /dev/shm) to obtain an fd. In my book the special file has only advantanges: no additional syscall is needed, system admins can tweak access to this feature via normal file permissions, and signaling the availability of the feature in the kernel simply by the existence of the dev file. I already wondered the same for memfd(). Here I can perhaps follow that there is a need such fds before /dev is mounted (because PID1 might need it). But not for this case as devtmpfs should be mounted early enough. Not saying it's the wrong decision, but I want to learn about the rationale. Best regards.