linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Uladzislau Rezki <urezki@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ping Fang <pifang@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Roman Gushchin <guro@fb.com>, Michal Hocko <mhocko@suse.com>,
	Oscar Salvador <osalvador@suse.de>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH v1] mm/vmalloc: fix exact allocations with an alignment > 1
Date: Wed, 29 Sep 2021 16:40:00 +0200	[thread overview]
Message-ID: <953ea84a-aabb-f64b-b417-ba60928430e0@redhat.com> (raw)
In-Reply-To: <CA+KHdyWZ9T2GEuUENXD_OYHX1JxKfZuW5YzmDtqXUYSgkQd8fQ@mail.gmail.com>

On 29.09.21 16:30, Uladzislau Rezki wrote:
>>
>> So the idea is that once we run into a dead end because we took a left
>> subtree, we rollback to the next possible rigth subtree and try again.
>> If we run into another dead end, we repeat ... thus, this can now happen
>> more than once.
>>
>> I assume the only implication is that this can now be slower in some
>> corner cases with larger alignment, because it might take longer to find
>> something suitable. Fair enough.
>>
> Yep, your understanding is correct regarding the tree traversal. If no
> suitable block
> is found in left sub-tree we roll-back and check right one. So it can
> be(the scanning)
> more than one time.
> 
> I did some performance analyzing using vmalloc test suite to figure
> out a performance
> loss for allocations with specific alignment. On that syntactic test i
> see approx. 30%
> of degradation:

How realistic is that test case? I assume most alignment we're dealing 
with is:
* 1/PAGE_SIZE
* huge page size (for automatic huge page placing)

> 
> 2.225 microseconds vs 1.496 microseconds. That time includes both
> vmalloc() and vfree()
> calls. I do not consider it as a big degrade, but from the other hand
> we can still adjust the
> search length for alignments > one page:
> 
> # add it on top of previous proposal and search length instead of size
> length = align > PAGE_SIZE ? size + align:size;

That will not allow to place huge pages in the case of kasan. And I 
consider that more important than optimizing a syntactic test :) My 2 cents.

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2021-09-29 14:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 13:27 [PATCH v1] mm/vmalloc: fix exact allocations with an alignment > 1 David Hildenbrand
2021-09-13  8:29 ` Uladzislau Rezki
2021-09-13  8:44 ` Uladzislau Rezki
2021-09-14 19:15   ` Uladzislau Rezki
2021-09-15  9:02     ` David Hildenbrand
2021-09-16 19:34       ` Uladzislau Rezki
2021-09-17  8:47         ` David Hildenbrand
2021-09-21 22:13           ` Uladzislau Rezki
2021-09-22  8:34             ` David Hildenbrand
2021-09-22 10:41               ` Uladzislau Rezki
2021-09-23 17:42                 ` David Hildenbrand
2021-09-24 12:42                 ` David Hildenbrand
2021-09-29 14:30                   ` Uladzislau Rezki
2021-09-29 14:40                     ` David Hildenbrand [this message]
2021-09-29 14:49                       ` Uladzislau Rezki
2021-09-29 15:05                         ` David Hildenbrand
2021-09-29 16:08                           ` Uladzislau Rezki
2021-09-29 16:10                             ` David Hildenbrand

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=953ea84a-aabb-f64b-b417-ba60928430e0@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --cc=pifang@redhat.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).