Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp847364imm; Fri, 29 Jun 2018 07:22:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJF7cYqYZn5qyn3BIJRcIm6ZADzdcJDWmAepnsivCCBzSzDi6T3Dtq+f5SO+4eP2U1sAOb1 X-Received: by 2002:a65:53cb:: with SMTP id z11-v6mr12709404pgr.218.1530282126155; Fri, 29 Jun 2018 07:22:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530282126; cv=none; d=google.com; s=arc-20160816; b=hXVk5/gRrelNTGed/jjYylicon1wgdZ0yNfcQk1ThpDi97N4qULo63rlpQdwGeKm87 cv7Bmji+/fL9xfMcPui7GUoRDY2632FZlSmohHzgF2Ae1bUgJaxDv0rEqGWLyiVNVyXD 4c58a1HHcdMFTHRne+z4iEyjUrr/GuSxJnId7Q4dIRKIJx01vDhukTs+p7Jg89mFZzmq BR+aBYrEGZTvSZ8Gn2+tBmEXVt4juiXd3Y7BYFWVMHTo092nlJZ2O9vn/JcZCz0Jgg/Z ICyydaXqsVz1br+QVQ5GCMvm4z7uufdNDew4jax4cWEamES5d1Veh9J5AxUc8wlvP+Dz Lopg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=RxMBZQ5r8DHa3Ibmp4auFqvlNz9+wCIdN31dtIgjTWE=; b=v+NPkVsrFdqHlQ5IPCaWXgTTIovxoRuV14VWIddD82UJb/8EXa/7ptcSUOVvC3pppk U/uSkyYZ1Bs5RrOxXGKZPx+gzIq41ZN8YLZWGGTyBz2fBDF5F8HsHsUSpPtMD8eqpd3d KeVVY/Gvr9n+Ln/e2PNOFhbxweqKgrpLM6Y18mxxsGK0IQfthUyNwpD5FeAXQg4AO/1j JLSmyVhp4HDnBt2Lpze6h8q61Igzrf8NsRIDEARYG/UruLHggjEAXEpSpK1GMNMKHqci fpWdxGuVltTY+OnRPoP6D5LtM/zrjtbCIcSk98XpVdB7gekMdfxQIahOjmCX9UkaS3Xw 6czA== ARC-Authentication-Results: i=1; mx.google.com; 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 w14-v6si7415292pgm.502.2018.06.29.07.21.51; Fri, 29 Jun 2018 07:22:06 -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; 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 S965758AbeF2NCL (ORCPT + 99 others); Fri, 29 Jun 2018 09:02:11 -0400 Received: from foss.arm.com ([217.140.101.70]:33972 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965231AbeF2NCH (ORCPT ); Fri, 29 Jun 2018 09:02:07 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DE50880D; Fri, 29 Jun 2018 06:02:06 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 360DF3F266; Fri, 29 Jun 2018 06:02:01 -0700 (PDT) Date: Fri, 29 Jun 2018 14:01:56 +0100 From: Mark Rutland To: Andrey Konovalov Cc: Andrew Morton , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Will Deacon , Christoph Lameter , Nick Desaulniers , Marc Zyngier , Dave Martin , Ard Biesheuvel , "Eric W . Biederman" , Ingo Molnar , Paul Lawrence , Geert Uytterhoeven , Arnd Bergmann , "Kirill A . Shutemov" , Greg Kroah-Hartman , Kate Stewart , Mike Rapoport , kasan-dev , linux-doc@vger.kernel.org, LKML , Linux ARM , linux-sparse@vger.kernel.org, Linux Memory Management List , Linux Kbuild mailing list , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Jann Horn , Mark Brand , Chintan Pandya Subject: Re: [PATCH v4 00/17] khwasan: kernel hardware assisted address sanitizer Message-ID: <20180629130155.e7ztz5ikxfl352ff@lakrids.cambridge.arm.com> References: <20180627160800.3dc7f9ee41c0badbf7342520@linux-foundation.org> <20180628124039.8a42ab5e2994fb2876ff4f75@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 29, 2018 at 02:45:08PM +0200, Andrey Konovalov wrote: > On Thu, Jun 28, 2018 at 9:40 PM, Andrew Morton > wrote: > > On Thu, 28 Jun 2018 20:29:07 +0200 Andrey Konovalov wrote: > > > >> >> Slab memory usage after boot [2]: > >> >> * ~40 kb for clean kernel > >> >> * ~105 kb + 1/8th shadow ~= 118 kb for KASAN > >> >> * ~47 kb + 1/16th shadow ~= 50 kb for KHWASAN > >> >> > >> >> Network performance [3]: > >> >> * 8.33 Gbits/sec for clean kernel > >> >> * 3.17 Gbits/sec for KASAN > >> >> * 2.85 Gbits/sec for KHWASAN > >> >> > >> >> Note, that KHWASAN (compared to KASAN) doesn't require quarantine. > >> >> > >> >> [1] Time before the ext4 driver is initialized. > >> >> [2] Measured as `cat /proc/meminfo | grep Slab`. > >> >> [3] Measured as `iperf -s & iperf -c 127.0.0.1 -t 30`. > >> > > >> > The above doesn't actually demonstrate the whole point of the > >> > patchset: to reduce KASAN's very high memory consumption? > >> > >> You mean that memory usage numbers collected after boot don't give a > >> representative picture of actual memory consumption on real workloads? > >> > >> What kind of memory consumption testing would you like to see? > > > > Well, 100kb or so is a teeny amount on virtually any machine. I'm > > assuming the savings are (much) more significant once the machine gets > > loaded up and doing work? > > So with clean kernel after boot we get 40 kb memory usage. With KASAN > it is ~120 kb, which is 200% overhead. With KHWASAN it's 50 kb, which > is 25% overhead. This should approximately scale to any amounts of > used slab memory. For example with 100 mb memory usage we would get > +200 mb for KASAN and +25 mb with KHWASAN. (And KASAN also requires > quarantine for better use-after-free detection). I can explicitly > mention the overhead in %s in the changelog. Could you elaborate on where that SLAB overhead comes from? IIUC that's not for the shadow itself (since it's allocated up-front and not accounted to SLAB), and that doesn't take into account the quarantine, so what's eating that space? Thanks, Mark.