From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) by kanga.kvack.org (Postfix) with ESMTP id 18B906B0089 for ; Thu, 5 Mar 2015 12:48:52 -0500 (EST) Received: by igal13 with SMTP id l13so47793114iga.5 for ; Thu, 05 Mar 2015 09:48:51 -0800 (PST) Received: from mx2.parallels.com (mx2.parallels.com. [199.115.105.18]) by mx.google.com with ESMTPS id 37si9273042iok.100.2015.03.05.09.48.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 09:48:51 -0800 (PST) Message-ID: <54F896E6.2010800@parallels.com> Date: Thu, 5 Mar 2015 20:48:22 +0300 From: Pavel Emelyanov MIME-Version: 1.0 Subject: Re: [PATCH 05/21] userfaultfd: add vm_userfaultfd_ctx to the vm_area_struct References: <1425575884-2574-1-git-send-email-aarcange@redhat.com> <1425575884-2574-6-git-send-email-aarcange@redhat.com> In-Reply-To: <1425575884-2574-6-git-send-email-aarcange@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrea Arcangeli , qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Android Kernel Team Cc: "Kirill A. Shutemov" , Sanidhya Kashyap , zhang.zhanghailiang@huawei.com, Linus Torvalds , Andres Lagar-Cavilla , Dave Hansen , Paolo Bonzini , Rik van Riel , Mel Gorman , Andy Lutomirski , Andrew Morton , Sasha Levin , Hugh Dickins , Peter Feiner , "Dr. David Alan Gilbert" , Christopher Covington , Johannes Weiner , Robert Love , Dmitry Adamushko , Neil Brown , Mike Hommey , Taras Glek , Jan Kara , KOSAKI Motohiro , Michel Lespinasse , Minchan Kim , Keith Packard , "Huangpeng (Peter)" , Anthony Liguori , Stefan Hajnoczi , Wenchao Xia , Andrew Jones , Juan Quintela > diff --git a/kernel/fork.c b/kernel/fork.c > index cf65139..cb215c0 100644 > --- a/kernel/fork.c > +++ b/kernel/fork.c > @@ -425,6 +425,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) > goto fail_nomem_anon_vma_fork; > tmp->vm_flags &= ~VM_LOCKED; > tmp->vm_next = tmp->vm_prev = NULL; > + tmp->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX; This creates an interesting effect when the userfaultfd is used outside of the process which created and activated one. If I try to monitor the memory usage of one task with another, once the first task fork()-s, its child begins to see zero-pages in the places where the monitor task was supposed to insert pages with data. > file = tmp->vm_file; > if (file) { > struct inode *inode = file_inode(file); > . > -- 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