From: Dmitry Vyukov Subject: Re: SLAB_TYPESAFE_BY_RCU without constructors (was Re: [PATCH v4 13/17] khwasan: add hooks implementation) Date: Wed, 1 Aug 2018 13:35:09 +0200 Message-ID: References: <01000164f169bc6b-c73a8353-d7d9-47ec-a782-90aadcb86bfb-000000@email.amazonses.com> <30ee6c72-dc90-275a-8e23-54221f393cb0@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Andrey Ryabinin , Linus Torvalds , Christoph Lameter , "Theodore Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, Greg Kroah-Hartman , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , David Miller , NetFilter , coreteam@netfilter.org, Network Development , Gerrit Renker , dccp@vger.kernel.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Dave Airlie , To: Eric Dumazet Return-path: In-Reply-To: Sender: netdev-owner@vger.kernel.org List-Id: linux-ext4.vger.kernel.org On Wed, Aug 1, 2018 at 1:28 PM, Eric Dumazet wrote: > On 08/01/2018 03:34 AM, Dmitry Vyukov wrote: >> On Wed, Aug 1, 2018 at 12:23 PM, Eric Dumazet wrote: >>> On 08/01/2018 02:03 AM, Andrey Ryabinin wrote: >>> >>>> I can't think of any advantage in not having the constructor. >>> >>> I can't see any advantage adding another indirect call, >>> in RETPOLINE world. >> >> Can you please elaborate what's the problem here? >> If slab ctor call have RETPOLINE, then using ctors more does not >> introduce any security problems and they are not _that_ slow. > > They _are_ slow, when we have dozens of them in a code path. > > I object "having to add" yet another indirect call, if this can be avoided [*] > > If some people want to use ctor, fine, but do not request this. > > [*] This can be tricky, but worth the pain. But we are trading 1 indirect call for comparable overhead removed from much more common path. The path that does ctors is also calling into page alloc, which is much more expensive. So ctor should be a net win on performance front, no?