Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1731989

Re: [PATCH] mm: Restore mmput_async

From Arve Hjønnevåg <arve@android.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: Restore mmput_async
Date 2017-09-14 02:10 +0200
Message-ID <uppTb-5UG-1@gated-at.bofh.it> (permalink)
References <unAg1-4Sv-3@gated-at.bofh.it> <upnRo-4qH-21@gated-at.bofh.it> <upo14-4LS-15@gated-at.bofh.it> <upoDL-4Z2-5@gated-at.bofh.it> <upoNr-52g-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Sep 13, 2017 at 3:57 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Wed, 13 Sep 2017 18:44:11 -0400 Sherry Yang <sherryy@android.com> wrote:
>
>> On Wed, Sep 13, 2017 at 6:09 PM, Andrew Morton
>> <akpm@linux-foundation.org> wrote:
>> > On Wed, 13 Sep 2017 17:59:27 -0400 Sherry Yang <sherryy@android.com> 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?
>

alloc->tsk can exit during binder_alloc_free_page. We don't hold a
reference to the task's mm struct while we don't actively use it, as
this would prevent the driver from getting closed when a process dies.

-- 
Arve Hjønnevåg

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm: Restore mmput_async Sherry Yang <sherryy@android.com> - 2017-09-14 00:00 +0200
  Re: [PATCH] mm: Restore mmput_async Andrew Morton <akpm@linux-foundation.org> - 2017-09-14 00:10 +0200
    Re: [PATCH] mm: Restore mmput_async Sherry Yang <sherryy@android.com> - 2017-09-14 00:50 +0200
      Re: [PATCH] mm: Restore mmput_async Andrew Morton <akpm@linux-foundation.org> - 2017-09-14 01:00 +0200
        Re: [PATCH] mm: Restore mmput_async Arve Hjønnevåg <arve@android.com> - 2017-09-14 02:10 +0200
  Re: [PATCH] mm: Restore mmput_async Michal Hocko <mhocko@kernel.org> - 2017-09-14 10:20 +0200
    [PATCH v2] android: binder: Drop lru lock in isolate callback Sherry Yang <sherryy@android.com> - 2017-09-14 20:30 +0200
      Re: [PATCH v2] android: binder: Drop lru lock in isolate callback Andrew Morton <akpm@linux-foundation.org> - 2017-09-14 22:20 +0200

csiph-web