Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp979170imm; Wed, 1 Aug 2018 08:16:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcnfjsRy4TKCFXm4DIXkjVZXvLOOnlaWEyJ8Vsv8qm+WWd3CH8etcqW0u8FFR08rAyOWgPN X-Received: by 2002:a63:ff21:: with SMTP id k33-v6mr24709419pgi.38.1533136618482; Wed, 01 Aug 2018 08:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533136618; cv=none; d=google.com; s=arc-20160816; b=S/iZESgD0FuUweefkqQPtY3yv8vlkpNGW/No6tPSyJU4a/ci3QFbfqUFml3yTbj/pA ooS/zvY7af0zpMjjLDTRG9/9pFabnJp98S+ikz6ermJ4rRezVyO9jlSR9cSkMUocqO+/ F3sFA63goufx9wsoI/Y2v4DlwORmc4ta7HYrvn3otUrzSfVPWHcgoRIMJB/7lC88b86L dL0d9INemL2LyPFafjpF27+4GgQTuqdHl87oeL9gTdHhE6ARGNrX4i+BgfTNAFHSb4z2 piQKBs3OXbVc+0laNvamYCFn9rIfp7sGaIrmZLgZTagZx8MrWFLspmeOUpGQ2KY+DflB MYnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=Fg2buv7Vd0LeOYA4RJtt11RJLWYlC5vnpECFTWb31e0=; b=f4gsWtLWoYbbbPc1wVZN/TKj1vlsCS2j93Uk5zz1OYZZ1M7MQwyY/ASANmfpau4+Jb gQyGTQYl7XIo3SU/mos/mo+ayWcWKBFPO5YcdbuYDd92LwzKdWV0E4FY7aSjN2C+7mQD gr/ntPqeFHpJwIEeUAygmhZ75eBMQ70n5Li1TEHNqKF9aefn05rLTcYlk8FOi0vq6UdT 54zEWm19zd83f+izUSklvkcxt3v7usfYOjQwmEj14+BOMebpbau0OiWgtD5dKEuml3sX Ku+vgHfj8mRBukv5i05fsjgC3+GNre2hjaM2hkVGp6S+N8uJmue1j2mYjB7vZS+ir0x0 qQjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=J3R4rTP7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si17430255pgi.184.2018.08.01.08.16.43; Wed, 01 Aug 2018 08:16:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=J3R4rTP7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389713AbeHARCD (ORCPT + 99 others); Wed, 1 Aug 2018 13:02:03 -0400 Received: from a9-112.smtp-out.amazonses.com ([54.240.9.112]:57694 "EHLO a9-112.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389557AbeHARCD (ORCPT ); Wed, 1 Aug 2018 13:02:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1533136551; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=Fg2buv7Vd0LeOYA4RJtt11RJLWYlC5vnpECFTWb31e0=; b=J3R4rTP74hP5Ay77/Ud9Y0XKqEXO6FM6x33goy7rU0Toaog2+Fgn/3hvAD38j1gV Yh1NtJ4s1I1keMZR5H8D5BgBpuPsx6Nkb1K/AQt142qF1dOSCugugIaQBqXS94Gncd+ r/NUjwh8pwEqvvID2FuVScBsJtynxKBFVd1pmnNw= Date: Wed, 1 Aug 2018 15:15:51 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake 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 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> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2018.08.01-54.240.9.112 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.