From: Michal Hocko <mhocko@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Zhaoyang Huang <huangzhaoyang@gmail.com>,
zhaoyang.huang@spreadtrum.com,
Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>, zijun_hu <zijun_hu@htc.com>,
Vlastimil Babka <vbabka@suse.cz>,
Thomas Garnier <thgarnie@google.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
zijun_hu@zoho.com
Subject: Re: [PATCH v1] mm/vmalloc: add a node corresponding to cached_hole_size
Date: Fri, 21 Jul 2017 16:43:18 +0200 [thread overview]
Message-ID: <20170721144318.GD5944@dhcp22.suse.cz> (raw)
In-Reply-To: <20170721113948.GB18303@bombadil.infradead.org>
On Fri 21-07-17 04:39:48, Matthew Wilcox wrote:
> On Fri, Jul 21, 2017 at 06:01:41PM +0800, Zhaoyang Huang wrote:
> > we just record the cached_hole_size now, which will be used when
> > the criteria meet both of 'free_vmap_cache == NULL' and 'size <
> > cached_hole_size'. However, under above scenario, the search will
> > start from the rb_root and then find the node which just in front
> > of the cached hole.
> >
> > free_vmap_cache miss:
> > vmap_area_root
> > / \
> > _next U
> > / (T1)
> > cached_hole_node
> > /
> > ... (T2)
> > /
> > first
> >
> > vmap_area_list->first->......->cached_hole_node->cached_hole_node.list.next
> > |-------(T3)-------| | <<< cached_hole_size >>> |
> >
> > vmap_area_list->......->cached_hole_node->cached_hole_node.list.next
> > | <<< cached_hole_size >>> |
> >
> > The time cost to search the node now is T = T1 + T2 + T3.
> > The commit add a cached_hole_node here to record the one just in front of
> > the cached_hole_size, which can help to avoid walking the rb tree and
> > the list and make the T = 0;
>
> Yes, but does this matter in practice? Are there any workloads where
> this makes a difference? If so, how much?
I have already asked this and didn't get any response. There were other
versions of a similar patch without a good clarification...
Zhaoyang Huang, please try to formulate the problem you are fixing and
why. While it is clear that you add _an_ optimization it is not really
clear why we need it and whether it might adversely affect existing
workloads. I would rather not touch this code unless there is a strong
justification for it.
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-07-21 14:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-21 10:01 [PATCH v1] mm/vmalloc: add a node corresponding to cached_hole_size Zhaoyang Huang
2017-07-21 11:39 ` Matthew Wilcox
2017-07-21 14:43 ` Michal Hocko [this message]
2017-07-24 2:09 ` [lkp-robot] [mm/vmalloc] 3fef5b604a: kernel_BUG_at_mm/vmalloc.c kernel test robot
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=20170721144318.GD5944@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=huangzhaoyang@gmail.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=thgarnie@google.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=zhaoyang.huang@spreadtrum.com \
--cc=zijun_hu@htc.com \
--cc=zijun_hu@zoho.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).