Re: [PATCH] [10/16] POISON: Use bitmask/action code for try_to_unmap behaviour

From: Andi Kleen
Date: Tue Apr 07 2009 - 17:58:10 EST


On Tue, Apr 07, 2009 at 05:19:19PM -0400, Christoph Lameter wrote:
> On Tue, 7 Apr 2009, Andi Kleen wrote:
>
> > +
> > +enum ttu_flags {
> > + TTU_UNMAP = 0, /* unmap mode */
> > + TTU_MIGRATION = 1, /* migration mode */
> > + TTU_MUNLOCK = 2, /* munlock mode */
> > + TTU_ACTION_MASK = 0xff,
> > +
> > + TTU_IGNORE_MLOCK = (1 << 8), /* ignore mlock */
>
>
> Ignoring MLOCK? This means we are violating POSIX which says that an
> MLOCKed page cannot be unmapped from a process?

I'm sure if you can find sufficiently vague language in the document
to standards lawyer around that requirement @)

The alternative would be to panic.

> Note that page migration
> does this under special pte entries so that the page will never appear to
> be unmapped to user space.
>
> How does that work for the poisoning case? We substitute a fresh page?

It depends on the state of the page. If it was a clean disk mapped
page yes (it's just invalidated and can be reloaded). If it's a dirty anon
page the process is normally killed first (with advisory mode on) or only
killed when it hits the corrupted page. The process can also
catch the signal if it choses so. The late killing works with
a special entry similar to the migration case, but that results
in a special SIGBUS.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
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/