Re: [PATCH] mm: fix lazy vmap purging (use-after-free error)

From: Andrew Morton
Date: Mon Feb 23 2009 - 15:05:18 EST


On Mon, 23 Feb 2009 20:33:51 +0100
Ingo Molnar <mingo@xxxxxxx> wrote:

> > > > Nice work all (btw. if this patch goes in rather than using system_state,
> > > > then please make the variable __read_mostly).
> > >
> > > Hmmm... I misread this and made system_state be __read_mostly. Let
> > > me know if this is bad, easy to fix if needed.
> >
> > Please don't use system_state. The whole thing is just bad
> > design. It's a global variable, breaks encapsulation, creates
> > interactions etc. CS-101 stuff.
>
> ok, i've removed the patch

Thanks.

> - Paul, would you mind to re-send
> your original flag solution, with it marked __read_mostly and
> with the extern declarations put into a suitable header file?

It would still make sense to mark system_state __read_mostly.

(That's assuming that __read_mostly makes sense. I still wanna
rename it to __pack_all_write_often_variables_into_the_same_cacheline
and see what happens then)
--
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/