From: Matthew Wilcox <willy@infradead.org>
To: Pengfei Li <lpf.vector@gmail.com>
Cc: akpm@linux-foundation.org, urezki@gmail.com, rpenyaev@suse.de,
peterz@infradead.org, guro@fb.com, rick.p.edgecombe@intel.com,
rppt@linux.ibm.com, aryabinin@virtuozzo.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] mm/vmalloc.c: Modify struct vmap_area to reduce its size
Date: Fri, 12 Jul 2019 06:49:55 -0700 [thread overview]
Message-ID: <20190712134955.GV32320@bombadil.infradead.org> (raw)
In-Reply-To: <20190712120213.2825-3-lpf.vector@gmail.com>
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;
};
next prev parent reply other threads:[~2019-07-12 13:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-12 12:02 [PATCH v4 0/2] mm/vmalloc.c: improve readability and rewrite vmap_area Pengfei Li
2019-07-12 12:02 ` [PATCH v4 1/2] mm/vmalloc: do not keep unpurged areas in the busy tree Pengfei Li
2019-07-12 12:02 ` [PATCH v4 2/2] mm/vmalloc.c: Modify struct vmap_area to reduce its size Pengfei Li
2019-07-12 13:49 ` Matthew Wilcox [this message]
2019-07-12 15:09 ` Pengfei Li
2019-07-15 14:27 ` Uladzislau Rezki
2019-07-15 15:14 ` Pengfei Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190712134955.GV32320@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=guro@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lpf.vector@gmail.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=rpenyaev@suse.de \
--cc=rppt@linux.ibm.com \
--cc=urezki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).