lkml.org 
[lkml]   [2013]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.
    From
    2013/5/17 Robert Love <rlove@google.com>:
    > On Thu, May 16, 2013 at 1:19 PM, Andrew Morton
    > <akpm@linux-foundation.org> wrote:
    >> On Thu, 16 May 2013 13:08:17 -0400 Robert Love <rlove@google.com> wrote:
    >>> This problem seems a rare proper use of mutex_trylock.
    >>
    >> Not really. The need for a trylock is often an indication that a
    >> subsystem has a locking misdesign. That is indeed the case here.
    >
    > It is exactly the same as PF_MEMALLOC. We've got an effectively
    > asynchronous event (shrinking) that can occur while you are holding
    > locks requisite to that shrinking. Given that the shrinkage is best
    > effort, a trylock actually communicates the intent pretty well: "If
    > possible, grab this lock and shrink."
    >
    > I think the idiomatic fix is to introduce a GFP_SHMEM but that seems
    > overkill. Lots of the GFP flags are really just preventing recursing
    > into the shrinkage code and it seems ill-designed that we require
    > developers to know where they might end up. But we can disagree. :)
    >
    >> Well, it's not exactly a ton of work, but adding a per-ashmem_area lock
    >> to protect ->file would rather be putting lipstick on a pig. I suppose
    >> we can put the trylock in there and run away, but it wouldn't hurt to
    >> drop in a big fat comment somewhere explaining that the driver should be
    >> migrated to a per-object locking scheme.
    >
    > Unfortunately I think ashmem_shrink would need to grab the per-object
    > lock too; it needs to update the ranges. I'm sure we could re-design
    > this but I don't think it is as easy as simply pushing the locking
    > into the objects.
    >
    > Robert

    Hi all,
    I am wondering if this is fixed in latest kernel? We are continuously
    seeing this deadlock issue.

    Best Regards,
    Raul


    \
     
     \ /
      Last update: 2013-09-17 07:21    [W:3.272 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site