Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-09-16 Thread Raul Xiong
2013/5/17 Robert Love : > On Thu, May 16, 2013 at 1:19 PM, Andrew Morton > wrote: >> On Thu, 16 May 2013 13:08:17 -0400 Robert Love 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

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-09-16 Thread Raul Xiong
2013/5/17 Robert Love rl...@google.com: On Thu, May 16, 2013 at 1:19 PM, Andrew Morton a...@linux-foundation.org wrote: On Thu, 16 May 2013 13:08:17 -0400 Robert Love rl...@google.com wrote: This problem seems a rare proper use of mutex_trylock. Not really. The need for a trylock is often

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Robert Love
On Thu, May 16, 2013 at 1:19 PM, Andrew Morton wrote: > On Thu, 16 May 2013 13:08:17 -0400 Robert Love 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

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Andrew Morton
On Thu, 16 May 2013 13:08:17 -0400 Robert Love wrote: > On Thu, May 16, 2013 at 12:45 PM, Andrew Morton > wrote: > > A better approach would be to add a new __GFP_NOSHRINKERS, but it's all > > variations on a theme. > > I don't like this proposal, either. Many of the existing GFP flags >

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Robert Love
On Thu, May 16, 2013 at 12:45 PM, Andrew Morton wrote: > A better approach would be to add a new __GFP_NOSHRINKERS, but it's all > variations on a theme. I don't like this proposal, either. Many of the existing GFP flags already exist to prevent recurse into that flag's respective shrinker.

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Andrew Morton
On Thu, 16 May 2013 09:44:49 -0400 Robert Love wrote: > On Thu, May 16, 2013 at 4:15 AM, Raul Xiong wrote: > > The issue happens in such sequence: > > ashmem_mmap acquired ashmem_mutex --> ashmem_mutex:shmem_file_setup > > called kmem_cache_alloc --> shrink due to low memory --> ashmem_shrink >

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Robert Love
On Thu, May 16, 2013 at 4:15 AM, Raul Xiong wrote: > The issue happens in such sequence: > ashmem_mmap acquired ashmem_mutex --> ashmem_mutex:shmem_file_setup > called kmem_cache_alloc --> shrink due to low memory --> ashmem_shrink > tries to acquire the same ashmem_mutex -- it blocks here. > > I

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Raul Xiong
2013/5/14 Raul Xiong > > 2013/5/14 Neil Zhang : > > 2013/5/14 Greg Kroah-Hartman : > >> 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,

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Raul Xiong
2013/5/14 Raul Xiong raulxi...@gmail.com 2013/5/14 Neil Zhang glacier1...@gmail.com: 2013/5/14 Greg Kroah-Hartman gre...@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

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Robert Love
On Thu, May 16, 2013 at 4:15 AM, Raul Xiong raulxi...@gmail.com wrote: The issue happens in such sequence: ashmem_mmap acquired ashmem_mutex -- ashmem_mutex:shmem_file_setup called kmem_cache_alloc -- shrink due to low memory -- ashmem_shrink tries to acquire the same ashmem_mutex -- it blocks

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Andrew Morton
On Thu, 16 May 2013 09:44:49 -0400 Robert Love rl...@google.com wrote: On Thu, May 16, 2013 at 4:15 AM, Raul Xiong raulxi...@gmail.com wrote: The issue happens in such sequence: ashmem_mmap acquired ashmem_mutex -- ashmem_mutex:shmem_file_setup called kmem_cache_alloc -- shrink due to low

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Robert Love
On Thu, May 16, 2013 at 12:45 PM, Andrew Morton a...@linux-foundation.org wrote: A better approach would be to add a new __GFP_NOSHRINKERS, but it's all variations on a theme. I don't like this proposal, either. Many of the existing GFP flags already exist to prevent recurse into that flag's

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Andrew Morton
On Thu, 16 May 2013 13:08:17 -0400 Robert Love rl...@google.com wrote: On Thu, May 16, 2013 at 12:45 PM, Andrew Morton a...@linux-foundation.org wrote: A better approach would be to add a new __GFP_NOSHRINKERS, but it's all variations on a theme. I don't like this proposal, either. Many

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-16 Thread Robert Love
On Thu, May 16, 2013 at 1:19 PM, Andrew Morton a...@linux-foundation.org wrote: On Thu, 16 May 2013 13:08:17 -0400 Robert Love rl...@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

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-13 Thread Raul Xiong
2013/5/14 Neil Zhang : > 2013/5/14 Greg Kroah-Hartman : >> 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 >>>

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-13 Thread Neil Zhang
2013/5/14 Greg Kroah-Hartman : > 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

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-13 Thread Greg Kroah-Hartman
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:

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-13 Thread Greg Kroah-Hartman
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

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-13 Thread Neil Zhang
2013/5/14 Greg Kroah-Hartman gre...@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

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-13 Thread Raul Xiong
2013/5/14 Neil Zhang glacier1...@gmail.com: 2013/5/14 Greg Kroah-Hartman gre...@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,

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-07 Thread Andrew Morton
On Wed, 1 May 2013 09:56:13 -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. > Sorry, but I don't think

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-07 Thread Andrew Morton
On Wed, 1 May 2013 09:56:13 -0400 Robert Love rl...@google.com 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. Sorry, but I

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-02 Thread Greg Kroah-Hartman
On Thu, May 02, 2013 at 11:22:18AM -0700, David Rientjes wrote: > On Wed, 1 May 2013, David Rientjes 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 > >

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-02 Thread David Rientjes
On Wed, 1 May 2013, David Rientjes 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:

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-02 Thread David Rientjes
On Wed, 1 May 2013, David Rientjes 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

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-02 Thread Greg Kroah-Hartman
On Thu, May 02, 2013 at 11:22:18AM -0700, David Rientjes wrote: On Wed, 1 May 2013, David Rientjes 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

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-01 Thread David Rientjes
On Wed, 1 May 2013, 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 Any reason

[PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-01 Thread Robert Love
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 --- drivers/staging/android/ashmem.c | 6 +- 1 file

[PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-01 Thread Robert Love
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 rl...@google.com --- drivers/staging/android/ashmem.c | 6

Re: [PATCH -next] ashmem: Fix ashmem_shrink deadlock.

2013-05-01 Thread David Rientjes
On Wed, 1 May 2013, 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 rl...@google.com