linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raul Xiong <raulxiong@gmail.com>
To: Neil Zhang <glacier1980@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Robert Love <rlove@google.com>,
	Shankar Brahadeeswaran <shankoo77@gmail.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Bjorn Bringert <bringert@google.com>,
	devel <devel@driverdev.osuosl.org>,
	Hugh Dickins <hughd@google.com>,
	Anjana V Kumar <anjanavk12@gmail.com>,
	Dad <akpm@linux-foundation.org>,
	linux-next <linux-next@vger.kernel.org>
Subject: Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.
Date: Tue, 14 May 2013 11:37:56 +0800	[thread overview]
Message-ID: <CAG9bXvkH0L5FjkU3-=3X3zwp3vw8U7+jJRYp28GFXjLkQKBL5g@mail.gmail.com> (raw)
In-Reply-To: <CA+2_TiZ3dECAW8LV-Es=BjHCwgWw69zbWkr73at+0_c-EaDHmA@mail.gmail.com>

2013/5/14 Neil Zhang <glacier1980@gmail.com>:
> 2013/5/14 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
>> On Wed, May 01, 2013 at 09:56:13AM -0400, Robert Love wrote:
>>> Don't acquire ashmem_mutex in ashmem_shrink if we've somehow recursed
>>> into the
>>> shrinker code from within ashmem. Just bail out, avoiding a deadlock.
>>> This is
>>> fine, as ashmem cache pruning is advisory anyhow.
>>>
>>> Signed-off-by: Robert Love <rlove@google.com>
>>> ---
>>>  drivers/staging/android/ashmem.c | 6 +++++-
>>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> Based on Andrew's review comments, I'll drop this from my queue and wait
>> for a "better" fix for this.
>>
>> thanks,
>>
>> greg k-h
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>
> We found the similar issue these days.
> Add RaulXiong to paste the call stack.
>
> Best Regards,
> Neil Zhang

Hi all,
I just encountered this deadlock during some stress test and it can be
described clearly by below function stack. Please check and suggest a
formal fix for it.

[<c05d3370>] (__schedule) from [<c05d3818>]
[<c05d3818>] (schedule_preempt_disabled) from [<c05d2578>]
[<c05d2578>] (__mutex_lock_slowpath) from [<c05d263c>]
[<c05d263c>] (mutex_lock) from [<c0441dd8>]
[<c0441dd8>] (ashmem_shrink) from [<c01ae00c>]
[<c01ae00c>] (shrink_slab) from [<c01b0ec8>]
[<c01b0ec8>] (try_to_free_pages) from [<c01a65ec>]
[<c01a65ec>] (__alloc_pages_nodemask) from [<c01d0414>]
[<c01d0414>] (new_slab) from [<c05cf3a0>]
[<c05cf3a0>] (__slab_alloc.isra.46.constprop.52) from [<c01d08cc>]
[<c01d08cc>] (kmem_cache_alloc) from [<c01b1f6c>]
[<c01b1f6c>] (shmem_alloc_inode) from [<c01e8d18>]
[<c01e8d18>] (alloc_inode) from [<c01ea3c4>]
[<c01ea3c4>] (new_inode_pseudo) from [<c01ea404>]
[<c01ea404>] (new_inode) from [<c01b157c>]
[<c01b157c>] (shmem_get_inode) from [<c01b3eac>]
[<c01b3eac>] (shmem_file_setup) from [<c0441d1c>]
[<c0441d1c>] (ashmem_mmap) from [<c01c1908>]
[<c01c1908>] (mmap_region) from [<c01c1eac>]
[<c01c1eac>] (sys_mmap_pgoff) from [<c0112d80>]

Thanks,
Raul Xiong

  reply	other threads:[~2013-05-14  3:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 13:56 [PATCH -next] ashmem: Fix ashmem_shrink deadlock Robert Love
2013-05-01 15:54 ` David Rientjes
2013-05-02 18:22   ` David Rientjes
2013-05-02 20:39     ` Greg Kroah-Hartman
2013-05-07 20:52 ` Andrew Morton
2013-05-13 21:42 ` Greg Kroah-Hartman
2013-05-14  3:29   ` Neil Zhang
2013-05-14  3:37     ` Raul Xiong [this message]
2013-05-16  8:15       ` Raul Xiong
2013-05-16 13:44         ` Robert Love
2013-05-16 16:45           ` Andrew Morton
2013-05-16 17:08             ` Robert Love
2013-05-16 17:19               ` Andrew Morton
2013-05-16 17:28                 ` Robert Love
2013-09-17  5:05                   ` Raul Xiong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG9bXvkH0L5FjkU3-=3X3zwp3vw8U7+jJRYp28GFXjLkQKBL5g@mail.gmail.com' \
    --to=raulxiong@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=anjanavk12@gmail.com \
    --cc=bringert@google.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=glacier1980@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rlove@google.com \
    --cc=shankoo77@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).