Re: CONFIG_PREEMPT and server workloads

From: Andrew Morton
Date: Thu Mar 18 2004 - 13:49:43 EST


Andrea Arcangeli <andrea@xxxxxxx> wrote:
>
> > hand so we should only fall into the kmap() if the page was suddenly stolen
> > again.
>
> Oh so you mean the page fault insn't only interrupting the copy-user
> atomically, but the page fault is also going to sleep and pagein the
> page? I though you didn't want to allow other tasks to steal the kmap
> before you effectively run the kunmap_atomic. I see it can be safe if
> kunmap_atomic is a noop though, but you're effectively allowing
> scheduling inside a kmap this way.

No, we don't schedule with the atomic kmap held. What I meant was:

get_user(page); /* fault it in */
kmap_atomic(page);
if (copy_from_user(page))
goto slow_path;
kunmap_atomic(page);

...

slow_path:
kunmap_atomic(page);
kmap(page);
copy_from_user(page);
kunmap(page);


slow_path is only taken if the vm (or truncate in the case of read())
unmapped the page in that little window after the get_user().
-
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/