From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f200.google.com (mail-qk0-f200.google.com [209.85.220.200]) by kanga.kvack.org (Postfix) with ESMTP id 34DD96B0273 for ; Wed, 1 Aug 2018 11:15:53 -0400 (EDT) Received: by mail-qk0-f200.google.com with SMTP id f64-v6so17223622qkb.20 for ; Wed, 01 Aug 2018 08:15:53 -0700 (PDT) Received: from a9-54.smtp-out.amazonses.com (a9-54.smtp-out.amazonses.com. [54.240.9.54]) by mx.google.com with ESMTPS id y48-v6si6886628qvh.56.2018.08.01.08.15.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Aug 2018 08:15:52 -0700 (PDT) Date: Wed, 1 Aug 2018 15:15:51 +0000 From: Christopher Lameter Subject: Re: SLAB_TYPESAFE_BY_RCU without constructors (was Re: [PATCH v4 13/17] khwasan: add hooks implementation) In-Reply-To: Message-ID: <01000164f60f3f12-b1253c6e-ee57-49fc-aed8-0944ab4fd7a2-000000@email.amazonses.com> 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=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Dmitry Vyukov Cc: Eric Dumazet , Andrey Ryabinin , Linus Torvalds , 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 , intel-gfx , DRI , Eric Dumazet , Alexey Kuznetsov , Hideaki YOSHIFUJI , Ursula Braun , linux-s390 , Linux Kernel Mailing List , Andrew Morton , linux-mm , Andrey Konovalov On Wed, 1 Aug 2018, Dmitry Vyukov wrote: > 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? ctor would make it esier to review the flow and guarantee that the object always has certain fields set as required before any use by the subsystem. ctors are run once on allocation of the slab page for all objects in it. ctors are not called duiring allocation and freeing of objects from the slab page. So we could avoid the intialization of the spinlock on each object allocation which actually should be faster.