What about shm? vma->vm_file is NULL, this would oops.
I think that both "prepare for possible vma removal" and the parameters
which are passed to ->swapout() should be vma-specific: what about a
vm_ops->swapprepare()? This function should not allocate memory, ie
parameter passing should be stack based:
<<<<< mm.h
struct private_data
{
void* private[4];
};
struct vm_ops
{
...
void (*swapprepare)(struct vm_area_struct * vma, struct page * page,
struct private_data * info);
void (*swapout)(struct private_data * info, struct page* page);
...
};
>>>>>>>>>
<<<<<<<< vmscan.c
if(vma->vm_ops && vma->vm_ops->swapout) {
int error;
struct private_data info;
void (*swapout)(...);
pte_clear(page_table);
swapout = vma->vm_ops->swapout;
vma->vm_ops->swapprepare(vma,page,&info);
spin_unlock(page_table_lock);
flush_tlb_page();
error = swapout(&info,page);
...
}
>>>>>>>>>>>>>>>>
-- Manfred- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/