> Marcelo Tosatti wrote:
> >
> > Well,
> >
> > Here is the updated version of the patch to add the "priority" argument to
> > writepage().
>
> It appears that a -EIO return from block_write_full_page() will
> result in an unlock of an unlocked page in page_launder(). Splat.
Right. Will fix the filesystems.
> What does the new writepage() argument do, and why does
> it exist?
The immediate reason for the "priority" argument is to avoid special
casing for the removal of dead dirty swap cache pages inside the VM.
With the new argument, page_launder() will call writepage() _even_ if it
does not want to do IO (in this case priority will be 0), so:
- swap_writepage() can remove dirty swap pages
- other filesystems are warned that the VM will probably want to
write the page out soon.
Positive values of "priority" means "write this page out".
In the future higher positive values for writepage() can indicate the
level of VM pressure. Example: fs's which do delayed allocation may want
to return zero for priority 1 in case the page can be written out at a
"better time", but for priority's > 1 they should write the page
unconditionally.
> What is the meaning of the writepage return value for
> the respective values of `priority'?
They should always return zero if they wrote (or freed) the page.
Otherwise return non-zero.
This way the VM can account for the amount of queue pages for IO. (which
we don't do right now, but we definately want to)
> When should writepage return with the page locked,
> and when not?
Locked for the "not wrote out case" (I will fix my patch now, thanks)
For the "wrote out" case there its undetermined.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/