From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793AbcEQUeZ (ORCPT ); Tue, 17 May 2016 16:34:25 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36163 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbcEQUeX (ORCPT ); Tue, 17 May 2016 16:34:23 -0400 Date: Tue, 17 May 2016 22:34:20 +0200 From: Michal Hocko To: Oleg Nesterov Cc: Andrew Morton , Andrea Arcangeli , Linus Torvalds , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 1/1] userfaultfd: don't pin the user memory in userfaultfd_file_create() Message-ID: <20160517203420.GG12220@dhcp22.suse.cz> References: <20160516152522.GA19120@redhat.com> <20160516152546.GA19129@redhat.com> <20160516172254.GA8595@redhat.com> <20160517153302.GE14446@dhcp22.suse.cz> <20160517163044.GA31867@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160517163044.GA31867@redhat.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 17-05-16 18:30:44, Oleg Nesterov wrote: > On 05/17, Michal Hocko wrote: > > > > On Mon 16-05-16 19:22:54, Oleg Nesterov wrote: > > > > > The patch adds the new trivial helper, mmget_not_zero(), it can have more users. > > > > Is this really helpful? > > Well, this is subjective of course, but I think the code looks a bit better this > way. uprobes, fs/proc and more can use this helper too. > > And in fact the initial version of this patch did atomic_inc_not_zero(mm->users) by > hand, then it was suggested to add a helper. I would prefer a more descriptive name (something like mmget_alive) but as you say this is highly subjective and nothing that should delay this fix. -- Michal Hocko SUSE Labs