[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190712134955.GV32320@bombadil.infradead.org>
Date: Fri, 12 Jul 2019 06:49:55 -0700
From: Matthew Wilcox <willy@...radead.org>
To: Pengfei Li <lpf.vector@...il.com>
Cc: akpm@...ux-foundation.org, urezki@...il.com, rpenyaev@...e.de,
peterz@...radead.org, guro@...com, rick.p.edgecombe@...el.com,
rppt@...ux.ibm.com, aryabinin@...tuozzo.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] mm/vmalloc.c: Modify struct vmap_area to reduce
its size
On Fri, Jul 12, 2019 at 08:02:13PM +0800, Pengfei Li wrote:
> +++ b/include/linux/vmalloc.h
> @@ -51,15 +51,37 @@ struct vmap_area {
> unsigned long va_start;
> unsigned long va_end;
>
> - /*
> - * Largest available free size in subtree.
> - */
> - unsigned long subtree_max_size;
> - unsigned long flags;
> - struct rb_node rb_node; /* address sorted rbtree */
> - struct list_head list; /* address sorted list */
> - struct llist_node purge_list; /* "lazy purge" list */
> - struct vm_struct *vm;
> + union {
> + /* In rbtree and list sorted by address */
> + struct {
> + union {
> + /*
> + * In "busy" rbtree and list.
> + * rbtree root: vmap_area_root
> + * list head: vmap_area_list
> + */
> + struct vm_struct *vm;
> +
> + /*
> + * In "free" rbtree and list.
> + * rbtree root: free_vmap_area_root
> + * list head: free_vmap_area_list
> + */
> + unsigned long subtree_max_size;
> + };
> +
> + struct rb_node rb_node;
> + struct list_head list;
> + };
> +
> + /*
> + * In "lazy purge" list.
> + * llist head: vmap_purge_list
> + */
> + struct {
> + struct llist_node purge_list;
> + };
I don't think you need struct union struct union. Because llist_node
is just a pointer, you can get the same savings with just:
union {
struct llist_node purge_list;
struct vm_struct *vm;
unsigned long subtree_max_size;
};
Powered by blists - more mailing lists