Re: [RFC][PATCH 1/3] radix priority search tree - objrmap complexityfix

From: Rajesh Venkatasubramanian
Date: Mon Mar 29 2004 - 12:53:06 EST




> #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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/