Re: [PATCH] zsmalloc: correct fragile [kmap|kunmap]_atomic use

From: Andrew Morton
Date: Tue Nov 18 2014 - 18:34:31 EST


On Wed, 19 Nov 2014 08:21:39 +0900 Minchan Kim <minchan@xxxxxxxxxx> wrote:

> Main reason I sent the patch is I got a subtle bug when I implement
> new feature of zsmalloc(ie, compaction) due to link's mishandling
> (ie, link was over page boundary by my fault).
> Although it was totally my mistake, it took time for a while
> to find a root cause because unpredictable kmapped address should
> be unmapped so it's almost random crash.

Fair enough.

That's pretty rude behaviour from kunmap_atomic(). Unfortunately it
just doesn't have anything with which to check the address - we'd need
to create a special per-cpu array[KM_TYPE_NR] just for the purpose.
--
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/