Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751359AbdIMW57 (ORCPT ); Wed, 13 Sep 2017 18:57:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54306 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbdIMW55 (ORCPT ); Wed, 13 Sep 2017 18:57:57 -0400 Date: Wed, 13 Sep 2017 15:57:54 -0700 From: Andrew Morton To: Sherry Yang Cc: linux-kernel@vger.kernel.org, Todd Kjos , Martijn Coenen , Arve =?ISO-8859-1?Q?Hj=F8nnev=E5g?= , Greg Kroah-Hartman , Ingo Molnar , Michal Hocko , Vlastimil Babka , David Rientjes , Andrea Arcangeli , Peter Zijlstra , Thomas Gleixner , Andy Lutomirski , Oleg Nesterov , Hoeun Ryu , Christoph Lameter , Vegard Nossum , Frederic Weisbecker Subject: Re: [PATCH] mm: Restore mmput_async Message-Id: <20170913155754.b072c04bbabffab0471a1ee2@linux-foundation.org> In-Reply-To: References: <20170908223934.67442-1-sherryy@android.com> <20170913215932.86846-1-sherryy@android.com> <20170913150904.90a37a966a04ea394a2c3d9b@linux-foundation.org> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1149 Lines: 27 On Wed, 13 Sep 2017 18:44:11 -0400 Sherry Yang wrote: > On Wed, Sep 13, 2017 at 6:09 PM, Andrew Morton > wrote: > > On Wed, 13 Sep 2017 17:59:27 -0400 Sherry Yang wrote: > > > >> Restore asynchronous mmput, allowing mmput_async to be called > >> from an atomic context in Android binder shrinker callback. > >> > >> mmput_async was initially introduced in ec8d7c14e > >> ("mm, oom_reaper: do not mmput synchronously from the > >> oom reaper context"), and was removed in 212925802 > >> ("mm: oom: let oom_reap_task and exit_mmap run concurrently") > > > > Presumably there's a patch somewhere which adds a call to mmput_async() > > into drivers/android/binder.c? Where is that patch? > > The patch that uses mmput_async() is > https://lkml.org/lkml/2017/9/8/785. Gmail doesn't seem to respect > in-reply-to. (Top-posting repaired. Please don't!) Is it necessary for binder_alloc_free_page() to take a ref on the mm? As long as alloc->tsk doesn't exit during binder_alloc_free_page()'s execution, that task's reference on the mm should be sufficient to keep the mm alive?