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:   Fri, 14 May 2021 21:57:33 +0000
From:   Liam Howlett <liam.howlett@...cle.com>
To:     Peter Zijlstra <peterz@...radead.org>
CC:     "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Song Liu <songliubraving@...com>,
        Davidlohr Bueso <dave@...olabs.net>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Matthew Wilcox <willy@...radead.org>,
        Laurent Dufour <ldufour@...ux.ibm.com>,
        David Rientjes <rientjes@...gle.com>,
        Axel Rasmussen <axelrasmussen@...gle.com>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Rik van Riel <riel@...riel.com>,
        Michel Lespinasse <walken.cr@...il.com>
Subject: Re: [PATCH 26/94] Maple Tree: Add new data structure

* Peter Zijlstra <peterz@...radead.org> [210514 11:37]:
> On Fri, May 14, 2021 at 05:32:15PM +0200, Peter Zijlstra wrote:
> > On Wed, Apr 28, 2021 at 03:36:02PM +0000, Liam Howlett wrote:
> > > +static inline unsigned long mte_pivot(const struct maple_enode *mn,
> > > +				 unsigned char piv)
> > > +{
> > > +	struct maple_node *node = mte_to_node(mn);
> > > +
> > > +	switch (mte_node_type(mn)) {
> > > +	case maple_arange_64:
> > > +		return node->ma64.pivot[piv];
> > > +	case maple_range_64:
> > > +	case maple_leaf_64:
> > > +		return node->mr64.pivot[piv];
> > > +	case maple_dense:
> > > +	default:
> > > +		return 0;
> > > +	}
> > > +}
> 
> Why is @piv 'unsigned char' ? Does that actually generate better code on
> any architecture?

unsigned char is to match ma_state struct offset which is kept small
for cache efficiency.

> 
> At the same time; there's no bounds check.
> 

I will add an assert.  Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ