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]
Message-ID: <20200115104446.GK2827@hirez.programming.kicks-ass.net>
Date:   Wed, 15 Jan 2020 11:44:46 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Waiman Long <longman@...hat.com>
Cc:     Ingo Molnar <mingo@...hat.com>, Will Deacon <will.deacon@....com>,
        linux-kernel@...r.kernel.org, Bart Van Assche <bvanassche@....org>
Subject: Re: [PATCH v2 4/6] locking/lockdep: Reuse freed chain_hlocks entries

On Tue, Jan 14, 2020 at 02:16:58PM -0500, Waiman Long wrote:
> On 1/14/20 4:46 AM, Peter Zijlstra wrote:

> > I'm thinking worst-fit might work well for our use-case. Best-fit would
> > result in a heap of tiny fragments and we don't have really large
> > allocations, which is the Achilles-heel of worst-fit.
> I am going to add a patch to split chain block as a last resort in case
> we run out of the main buffer.

It will be the common path; you'll start with a single huge fragment.

Remember, 1 allocator is better than 2.

> > Also, since you put in a minimal allocation size of 2, but did not
> > mandate size is a multiple of 2, there is a weird corner case of size-1
> > fragments. The simplest case is to leak those, but put in a counter so
> > we can see if they're a problem -- there is a fairly trivial way to
> > recover them without going full merge.
> 
> There is no size-1 fragment. Are you referring to the those blocks with
> a size of 2, but with only one entry used? There are some wasted space
> there. I can add a counter to track that.

There will be; imagine you have a size-6 fragment and request a size-5,
then we'll have to split off one. But one is too short to encode on the
free lists.

Suppose you tag them with -2, then on free of the size-5, we can check
if curr+size+1 is -2 and reunite.

First-fit or best-fit would result in lots of that, hence my suggestion
to use worst-fit if you can't find an exact match.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ