From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 29 Mar 2004 12:50:20 -0500 (EST) From: Rajesh Venkatasubramanian Subject: Re: [RFC][PATCH 1/3] radix priority search tree - objrmap complexity fix In-Reply-To: <20040329172248.GR3808@dualathlon.random> Message-ID: References: <20040325225919.GL20019@dualathlon.random> <20040326075343.GB12484@dualathlon.random> <20040326175842.GC9604@dualathlon.random> <20040329172248.GR3808@dualathlon.random> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Andrea Arcangeli Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org List-ID: > #define VN_MAPPED(vp) \ > - (!list_empty(&(LINVFS_GET_IP(vp)->i_mapping->i_mmap)) || \ > - (!list_empty(&(LINVFS_GET_IP(vp)->i_mapping->i_mmap_shared)))) > + (!prio_tree_empty(&(LINVFS_GET_IP(vp)->i_mapping->i_mmap)) || \ > + (!prio_tree_empty(&(LINVFS_GET_IP(vp)->i_mapping->i_mmap_shared)))) I think we will need the following too: (!list_empty(&(LINVFS_GET_IP(vp)->i_mmaping->i_mmap_nonlinear) > down(&mapping->i_shared_sem); > - list_for_each_entry(vma, &mapping->i_mmap_shared, shared) { > + vma = __vma_prio_tree_first(&mapping->i_mmap_shared, &iter, 0, ULONG_MAX); > + while (vma) { > if (!(vma->vm_flags & VM_DENYWRITE)) { > prohibited |= (1 << DM_EVENT_WRITE); > break; > } > + > + vma = __vma_prio_tree_next(vma, &mapping->i_mmap_shared, &iter, 0, ULONG_MAX); > } This part looks fine. But, I am not sure whether you have to handle nonlinear maps here. list_for_each_entry(vma, &mapping->i_mmap_nonlinear, shared) { ... } > up(&mapping->i_shared_sem); > #else Hope that helps. Rajesh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: aart@kvack.org