Re: [RFC] SL[AUO]B common code 1/9] [slob] define page struct fields used in mm_types.h

Glauber Costa
2012-05-16T07:33:20Z

On 05/15/2012 12:15 AM, Christoph Lameter wrote:
> - * We use struct page fields to manage some slob allocation aspects,
> - * however to avoid the horrible mess in include/linux/mm_types.h, we'll
> - * just define our own struct page type variant here.
> - */
> -struct slob_page {
> - union {
> - struct {
> - unsigned long flags; /* mandatory */
> - atomic_t _count; /* mandatory */
> - slobidx_t units; /* free units left in page */
> - unsigned long pad[2];
> - slob_t *free; /* first free slob_t in page */
> - struct list_head list; /* linked list of free pages */
> - };
> - struct page page;
> - };
> -};

I am generally in favor of this, but since this list inside the
structure doesn't seem to have any particular order, I think it should
not be called LRU.

It is of course ok to reuse the field, but what about we make it a union
between "list" and "lru" ?

It may seem stupid because they all have the same storage size, but the
word "lru" does trigger a lot of assumptions on people reading the code.