Re: [PATCH 1/3] revoke: misc fixes

2007-03-18 Thread Pekka J Enberg
On Mon, 19 Mar 2007, Nick Piggin wrote: > So you could just attempt a trylock, and if it works, then you > could revoke the vma right then and there. OTOH, the patch you > subsequently posted looks fine, so unless this is performance > critical then I wouldn't bother ;) The patch in -mm uses trylo

Re: [PATCH 1/3] revoke: misc fixes

2007-03-18 Thread Nick Piggin
Pekka Enberg wrote: On 3/16/07, Nick Piggin <[EMAIL PROTECTED]> wrote: Also, a down_write_trylock attempt inside i_mmap_lock should be a valid optimisation. I am not sure what you're thinking here. down_write_trylock acquires ->mmap_sem which can deadlock with ->i_mmap_lock, no? You need h

[PATCH 1/3] revoke: misc fixes

2007-03-16 Thread Pekka J Enberg
From: Pekka Enberg <[EMAIL PROTECTED]> This is a rollup patch of the following fixes to address some of Andrew's review comments: - Fix return value type of system calls to long - No need for GFP_NOFS for inode allocation, use GFP_KERNEL instead - Remove unnecessary line break before EXPORT

Re: [PATCH 1/3] revoke: misc fixes

2007-03-16 Thread Pekka Enberg
On 3/16/07, Nick Piggin <[EMAIL PROTECTED]> wrote: Also, a down_write_trylock attempt inside i_mmap_lock should be a valid optimisation. I am not sure what you're thinking here. down_write_trylock acquires ->mmap_sem which can deadlock with ->i_mmap_lock, no? - To unsubscribe from this list: se

Re: [PATCH 1/3] revoke: misc fixes

2007-03-15 Thread Nick Piggin
Pekka J Enberg wrote: Hi Nick, On Fri, 16 Mar 2007, Nick Piggin wrote: Could you try something like walk the i_mmap lists to find mms with vmas that haven't need revoking, then each time you find one, take a ref on the mm, drop i_mmap_lock, take mmap_sem, and walk all its vmas looking for any

Re: [PATCH 1/3] revoke: misc fixes

2007-03-15 Thread Pekka J Enberg
On Fri, 16 Mar 2007, Nick Piggin wrote: > So I think you really do need to get back to the mm, and then search its > vmas. You're right. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kerne

Re: [PATCH 1/3] revoke: misc fixes

2007-03-15 Thread Pekka J Enberg
Hi Nick, On Fri, 16 Mar 2007, Nick Piggin wrote: > Could you try something like walk the i_mmap lists to find mms with vmas that > haven't need revoking, then each time you find one, take a ref on the mm, drop > i_mmap_lock, take mmap_sem, and walk all its vmas looking for any that > reference the

Re: [PATCH 1/3] revoke: misc fixes

2007-03-15 Thread Nick Piggin
Pekka J Enberg wrote: Pekka J Enberg wrote: /* -* Not holding ->mmap_sem here. +* Not holding ->mmap_sem here but we must watch out for page +* faults and after the shared mappings have been taken down +* and sys_mmap() trying to remap the revoked range.

Re: [PATCH 1/3] revoke: misc fixes

2007-03-15 Thread Pekka J Enberg
Pekka J Enberg wrote: > > /* > > -* Not holding ->mmap_sem here. > > +* Not holding ->mmap_sem here but we must watch out for page > > +* faults and after the shared mappings have been taken down > > +* and sys_mmap() trying to remap the revoked range. > > */ > > vma->vm_fla

Re: [PATCH 1/3] revoke: misc fixes

2007-03-15 Thread Nick Piggin
Pekka J Enberg wrote: From: Pekka Enberg <[EMAIL PROTECTED]> This is a rollup patch of the following fixes to address some of Andrew's review comments: - Fix return value type of system calls to long - Add comment for vma->vm_flag barrier - No need for GFP_NOFS for inode allocation, use G

[PATCH 1/3] revoke: misc fixes

2007-03-15 Thread Pekka J Enberg
From: Pekka Enberg <[EMAIL PROTECTED]> This is a rollup patch of the following fixes to address some of Andrew's review comments: - Fix return value type of system calls to long - Add comment for vma->vm_flag barrier - No need for GFP_NOFS for inode allocation, use GFP_KERNEL instead - Re