Re: [patch] x86: some lock annotations for user copy paths
From: Andi Kleen
Date: Wed Sep 10 2008 - 10:31:37 EST
Nick Piggin <npiggin@xxxxxxx> writes:
> int __copy_from_user(void *dst, const void __user *src, unsigned size)
> {
> int ret = 0;
> +
> + might_sleep();
> + if (current->mm)
> + might_lock_read(¤t->mm->mmap_sem);
It would be nicer if you defined a standard function for this, e.g.
a might_page_fault();
This would also make it easier to potentially add more locks.
-Andi
--
ak@xxxxxxxxxxxxxxx
--
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/