lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 29 Sep 2021 16:49:30 +0200
From:   Uladzislau Rezki <urezki@...il.com>
To:     David Hildenbrand <david@...hat.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, Ping Fang <pifang@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Roman Gushchin <guro@...com>, Michal Hocko <mhocko@...e.com>,
        Oscar Salvador <osalvador@...e.de>,
        Linux Memory Management List <linux-mm@...ck.org>
Subject: Re: [PATCH v1] mm/vmalloc: fix exact allocations with an alignment > 1

On Wed, Sep 29, 2021 at 4:40 PM David Hildenbrand <david@...hat.com> wrote:
>
> 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)
>
Well that is synthetic test. Most of the alignments are 1 or PAGE_SIZE.
There are users which use internal API where you can specify an alignment
you want but those are mainly like KASAN, module alloc, etc.

> >
> > 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.
>
Could you please to be more specific? I mean how is it connected with huge
pages mappings? Huge-pages are which have order > 0. Or you mean that
a special alignments are needed for mapping huge pages?

-- 
Uladzislau Rezki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ