From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754018AbcEPPZ1 (ORCPT ); Mon, 16 May 2016 11:25:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32821 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752948AbcEPPZ0 (ORCPT ); Mon, 16 May 2016 11:25:26 -0400 Date: Mon, 16 May 2016 17:25:22 +0200 From: Oleg Nesterov To: Andrew Morton , Andrea Arcangeli Cc: Linus Torvalds , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 0/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Message-ID: <20160516152522.GA19120@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 16 May 2016 15:25:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Sorry for delay. So this is the same patch, just I added the helpers for get/put mm->mm_users. I won't mind to change userfaultfd_get_mm() to return mm_struct-or- NULL, or perhaps instead we should simply add the trivial helper which does atomic_inc_not_zero(mm->mm_users) into sched.h, it can have more callers (fs/proc, uprobes). Testing. I have found selftests/vm/userfaultfd.c and it seems to work. Oleg.