Re: [PATCH] aio: ensure access to ctx->ring_pages is correctly serialised

2014-03-25 Thread Benjamin LaHaise
Hi Sasha, On Tue, Mar 25, 2014 at 01:47:40PM -0400, Sasha Levin wrote: > On 03/24/2014 03:07 PM, Benjamin LaHaise wrote: ... > >Yeah, that's a problem -- thanks for the report. The ring_lock mutex can't > >be nested inside of mmap_sem, as aio_read_events_ring() can take a page > >fault while

Re: [PATCH] aio: ensure access to ctx->ring_pages is correctly serialised

2014-03-25 Thread Sasha Levin
On 03/24/2014 03:07 PM, Benjamin LaHaise wrote: On Mon, Mar 24, 2014 at 02:22:06PM -0400, Sasha Levin wrote: On 03/21/2014 02:35 PM, Benjamin LaHaise wrote: Hi all, Based on the issues reported by Tang and Gu, I've come up with the an alternative fix that avoids adding additional locking in

Re: [PATCH] aio: ensure access to ctx-ring_pages is correctly serialised

2014-03-25 Thread Sasha Levin
On 03/24/2014 03:07 PM, Benjamin LaHaise wrote: On Mon, Mar 24, 2014 at 02:22:06PM -0400, Sasha Levin wrote: On 03/21/2014 02:35 PM, Benjamin LaHaise wrote: Hi all, Based on the issues reported by Tang and Gu, I've come up with the an alternative fix that avoids adding additional locking in

Re: [PATCH] aio: ensure access to ctx-ring_pages is correctly serialised

2014-03-25 Thread Benjamin LaHaise
Hi Sasha, On Tue, Mar 25, 2014 at 01:47:40PM -0400, Sasha Levin wrote: On 03/24/2014 03:07 PM, Benjamin LaHaise wrote: ... Yeah, that's a problem -- thanks for the report. The ring_lock mutex can't be nested inside of mmap_sem, as aio_read_events_ring() can take a page fault while holding

Re: [PATCH] aio: ensure access to ctx->ring_pages is correctly serialised

2014-03-24 Thread Benjamin LaHaise
On Mon, Mar 24, 2014 at 02:22:06PM -0400, Sasha Levin wrote: > On 03/21/2014 02:35 PM, Benjamin LaHaise wrote: > >Hi all, > > > >Based on the issues reported by Tang and Gu, I've come up with the an > >alternative fix that avoids adding additional locking in the event read > >code path. The fix

Re: [PATCH] aio: ensure access to ctx->ring_pages is correctly serialised

2014-03-24 Thread Sasha Levin
On 03/21/2014 02:35 PM, Benjamin LaHaise wrote: Hi all, Based on the issues reported by Tang and Gu, I've come up with the an alternative fix that avoids adding additional locking in the event read code path. The fix is to take the ring_lock mutex during page migration, which is already used

Re: [PATCH] aio: ensure access to ctx->ring_pages is correctly serialised

2014-03-24 Thread Gu Zheng
Hi Ben, On 03/22/2014 02:35 AM, Benjamin LaHaise wrote: > Hi all, > > Based on the issues reported by Tang and Gu, I've come up with the an > alternative fix that avoids adding additional locking in the event read > code path. The fix is to take the ring_lock mutex during page migration, >

Re: [PATCH] aio: ensure access to ctx-ring_pages is correctly serialised

2014-03-24 Thread Gu Zheng
Hi Ben, On 03/22/2014 02:35 AM, Benjamin LaHaise wrote: Hi all, Based on the issues reported by Tang and Gu, I've come up with the an alternative fix that avoids adding additional locking in the event read code path. The fix is to take the ring_lock mutex during page migration, which

Re: [PATCH] aio: ensure access to ctx-ring_pages is correctly serialised

2014-03-24 Thread Sasha Levin
On 03/21/2014 02:35 PM, Benjamin LaHaise wrote: Hi all, Based on the issues reported by Tang and Gu, I've come up with the an alternative fix that avoids adding additional locking in the event read code path. The fix is to take the ring_lock mutex during page migration, which is already used

Re: [PATCH] aio: ensure access to ctx-ring_pages is correctly serialised

2014-03-24 Thread Benjamin LaHaise
On Mon, Mar 24, 2014 at 02:22:06PM -0400, Sasha Levin wrote: On 03/21/2014 02:35 PM, Benjamin LaHaise wrote: Hi all, Based on the issues reported by Tang and Gu, I've come up with the an alternative fix that avoids adding additional locking in the event read code path. The fix is to take

[PATCH] aio: ensure access to ctx->ring_pages is correctly serialised

2014-03-21 Thread Benjamin LaHaise
Tang, Gu. Thanks! -ben -- "Thought is the essence of where you are now." >From e52ddd946ab1def55c8282c8b3d0e80403abae12 Mon Sep 17 00:00:00 2001 From: Benjamin LaHaise Date: Fri, 21 Mar 2014 14:26:43 -0400 Subject: [PATCH] aio: ensure access to ctx->ring_pa

[PATCH] aio: ensure access to ctx-ring_pages is correctly serialised

2014-03-21 Thread Benjamin LaHaise
Tang, Gu. Thanks! -ben -- Thought is the essence of where you are now. From e52ddd946ab1def55c8282c8b3d0e80403abae12 Mon Sep 17 00:00:00 2001 From: Benjamin LaHaise b...@kvack.org Date: Fri, 21 Mar 2014 14:26:43 -0400 Subject: [PATCH] aio: ensure access to ctx-ring_pages