Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp737704imm; Wed, 1 Aug 2018 04:36:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeUFAGmxBpg8CUki7SYD4kwG+fsxb7++H8sV0CSvpUDBwOa62+Gf92Lnrew5fl5JOnWvjze X-Received: by 2002:a17:902:7e43:: with SMTP id a3-v6mr24278566pln.151.1533123393015; Wed, 01 Aug 2018 04:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533123392; cv=none; d=google.com; s=arc-20160816; b=AgiuGLTyN+xpc7i0LltNG68KowkCmz6sIai7zBOu7TqkJij/Z23ORKRO/E6Rrz/DoN xLfj3hB4otV0U2jKmEAHfyza7LOnQkZaCdo9gKTa1UMOOivxwhrpP9bqHDU/DUF21Uym D08M1xMyNJOiP0SSUWBdClTuG4KrkcaKa5vQvS6clTTRz7X3xyFXz8t9dElizZVzN5cC JelJ7uNZkGJqq6Wl5vhHHs8fG/pTuxEgh3YP+3HL0umphVFtoQdyBgEaDEqwS03zdRFH pXs73ZwpsmPZrXVdp3Y49N4ap3SfGKKFhjpQkV+C0YT8S7vNzlO8Ix3f3LaEO8cYsThP h3iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=FfvoXD7OaVSvOjt2M8lrFhDxZxuL1Bak7ODj3z6jiGI=; b=IC583l4V3PNDQ49kpzfWvUy9Qv8bDSv7m0Ij0c//hmc9032PrTdNf+8GLxSy+7dvOt 4+quIl9DSI9as9XyixdPwBI03mZffL283wiXXQG3NWsF1M+AVjsVe354uiXTm27rF3DN BTtiahaBjqW2nVf4ERqi0JnQQGyGLe7a95bt1ap3hWzTo1+P/ycNOrQ4nSyC1vCjkKuL 5TKOJn/7UUrm2SrSeevdMmlubgjBhurgtd+k7A17s8bec3RNSUFD/0phoMX/wWduoShQ Vy8Nm+Qv9431Rw3KyofIybQCZlwKSmLAQuEpyXuLOyTpcTM/fxqc90afKB6yy9vJ7l7d jv9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QvHy5Go5; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69-v6si17742475pft.235.2018.08.01.04.36.18; Wed, 01 Aug 2018 04:36:32 -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=@google.com header.s=20161025 header.b=QvHy5Go5; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388794AbeHANUw (ORCPT + 99 others); Wed, 1 Aug 2018 09:20:52 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:43941 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388543AbeHANUw (ORCPT ); Wed, 1 Aug 2018 09:20:52 -0400 Received: by mail-pl0-f65.google.com with SMTP id x6-v6so8666064plv.10 for ; Wed, 01 Aug 2018 04:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FfvoXD7OaVSvOjt2M8lrFhDxZxuL1Bak7ODj3z6jiGI=; b=QvHy5Go5Sr+QhpIVYwBfSkb8+TOKaOgFMSW60ef/kaz2wa5Xb7qgeEm43cuDB8GFlU lJSepFnVe5UvwNgYKTPyO8HwfDc4kXYSFYHoi96awn2smR3R39UERavldfwVUAakSJKW LBItghsRd3SYK2+/RoigxsuK7f9CVgIv5xQr6DGp+2/HIqw2oxrA9RMRYvuORcxJ9xxb mW0N7wSO7hlFQQD/xQtEGJ62dWjq+XKE3Jlt/bjb7jYYWiG9TkRNjE/ndbUbH5c91x1z pR+FFFrlAOrpod9WpdN/QMSZ4EqlIClJixJyXU/cLQRy+lirnuyYf7+9HHbHvGyCYT+R T4gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FfvoXD7OaVSvOjt2M8lrFhDxZxuL1Bak7ODj3z6jiGI=; b=sNUg8ziMxLmKnqgVuMQPMsthoLRzwUiZDNvll08AGQKG2279uhOZTH1vXG3UYd9waf Kay7WEJFCPl0/CDf8n/XbfZlhPdbX1qjJokgoCWmFvFki5Kg3II+re4yI6f8xviXiLt1 TYabm9bf6AYK2sIWcl0zneEMDc5keW/PChdqjgQZEbt7KmhFJISvA0VlWwj7BSkA0F1w L2+X47oKNU0DfMChcfZtw1r4TDZLaBTDXgekkmxR/Fwei7i7HOItBEFmnZEUpMG8Fuv/ sDlv9QzhTe72S0Vj/Z+zIx5MT868nqTtI4c0ihzX89Ue57FNUYNbur+q6W1tHcskZJwW +wzw== X-Gm-Message-State: AOUpUlF8Ld+QWLTOqNQVh9I2Ng8Qs056BxkK90mdnhV2KJeFfzPr3YCc E/lLVr9TKBy6wH//JuD1Zt/MEhy9X1t+nQHBndNESw== X-Received: by 2002:a17:902:ab95:: with SMTP id f21-v6mr23793795plr.264.1533123330163; Wed, 01 Aug 2018 04:35:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:90a:ac14:0:0:0:0 with HTTP; Wed, 1 Aug 2018 04:35:09 -0700 (PDT) In-Reply-To: References: <01000164f169bc6b-c73a8353-d7d9-47ec-a782-90aadcb86bfb-000000@email.amazonses.com> <30ee6c72-dc90-275a-8e23-54221f393cb0@virtuozzo.com> From: Dmitry Vyukov Date: Wed, 1 Aug 2018 13:35:09 +0200 Message-ID: Subject: Re: SLAB_TYPESAFE_BY_RCU without constructors (was Re: [PATCH v4 13/17] khwasan: add hooks implementation) To: Eric Dumazet 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 , intel-gfx , DRI , Eric Dumazet , Alexey Kuznetsov , Hideaki YOSHIFUJI , Ursula Braun , linux-s390 , Linux Kernel Mailing List , Andrew Morton , linux-mm , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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?