Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp391086imm; Mon, 2 Jul 2018 13:32:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK6Kg9TL9XuODePGFdmKYk7RG2h3sKUrPO4idZPuiPIhQbaNf2qvKHA0dYvtCFjvhx4W7Dx X-Received: by 2002:a63:6188:: with SMTP id v130-v6mr22991638pgb.100.1530563541803; Mon, 02 Jul 2018 13:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530563541; cv=none; d=google.com; s=arc-20160816; b=CdQPlm45c7osXSNYXC/j1gvnT0EHMycaev/6TbIVo9m5RjjAUf46/Kp3obpinKuwZT 2nLkAx+WgBTWsmsB4sKSM0DPpPpvGJ9CprhqvCjEiInzLtLiICHEyLsXhLk1JIpf372m fagTK/kTMexZliRcYjNZwp9C4GHg/hBcBzybVU50jrb3pLk0iWVKtPWZb+ojLOh4uJtz 8/Grpug3cXyRjy4kbNI9hZDLpNp8ZUOUX7hs0Twbh5AUmkIa645jqmwnmscNR9QLq/0r cL4OCOzrj9coq1Tm0CTVqo5HCK+fiF5RmMhjjXq/9mSazmuAnpa+iPngRlAq8NNPPKe2 GwFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=N8n5iSRkClAJhWJJyAw3b4KBfUuY2VhABo9nZQqnWXo=; b=GQ97oEkqJHHBxVJHCNFtMb1s3+EjZQaK3ZP088WzYKJC6niPlibYbc5I98avXrwMbz EIG4VZJ52bLmVNFxT3ouXyODWwggz6NKdOUk0f4GBeFEWaNvzDwi2Lauzuk9yiXQxazv OArp9munB0/U6U3Y37m+OsVTTE4ULEKvpb2RyVKck0aZnMmeUamP7OqtJVkzIWygbQcf VR2Up/uaRPmVcyj+9Rh8D6zcr6JOo5Q/ORk+mvLa2wdiGo2kSTT1bvmilePmsOvgR+uK zwW5nSmFdRRIimsvkHioB+06f2HUxAyrUGX2WsKH7Skd1guzGTp9U2IjvAeSDb2uHEje NqKA== 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 h89-v6si17094935pld.378.2018.07.02.13.32.07; Mon, 02 Jul 2018 13:32:21 -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 S1753156AbeGBUa1 (ORCPT + 99 others); Mon, 2 Jul 2018 16:30:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33896 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537AbeGBUaY (ORCPT ); Mon, 2 Jul 2018 16:30:24 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B25A8D8B; Mon, 2 Jul 2018 20:30:22 +0000 (UTC) Date: Mon, 2 Jul 2018 13:30:21 -0700 From: Andrew Morton To: Evgenii Stepanov Cc: Andrey Konovalov , Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Catalin Marinas , Will Deacon , Christoph Lameter , Mark Rutland , 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 , 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: <20180702133021.3016ad80fbdea8d2e984147c@linux-foundation.org> In-Reply-To: References: <20180627160800.3dc7f9ee41c0badbf7342520@linux-foundation.org> <20180628124039.8a42ab5e2994fb2876ff4f75@linux-foundation.org> <20180629194117.01b2d31e805808eee5c97b4d@linux-foundation.org> <20180702122112.267261b1e1609cf522753cf3@linux-foundation.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Jul 2018 13:22:23 -0700 Evgenii Stepanov wrote: > On Mon, Jul 2, 2018 at 12:21 PM, Andrew Morton > wrote: > > On Mon, 2 Jul 2018 12:16:42 -0700 Evgenii Stepanov wrote: > > > >> On Fri, Jun 29, 2018 at 7:41 PM, Andrew Morton > >> wrote: > >> > On Fri, 29 Jun 2018 14:45:08 +0200 Andrey Konovalov wrote: > >> > > >> >> >> 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. > >> >> > >> >> If you think it makes sense, I can also make separate measurements > >> >> with some workload. What kind of workload should I use? > >> > > >> > Whatever workload people were running when they encountered problems > >> > with KASAN memory consumption ;) > >> > > >> > I dunno, something simple. `find / > /dev/null'? > >> > > >> > >> Looking at a live Android device under load, slab (according to > >> /proc/meminfo) + kernel stack take 8-10% available RAM (~350MB). > >> Kasan's overhead of 2x - 3x on top of it is not insignificant. > >> > > > > (top-posting repaired. Please don't) > > > > For a debugging, not-for-production-use feature, that overhead sounds > > quite acceptable to me. What problems is it known to cause? > > Not having this overhead enables near-production use - ex. running > kasan/khasan kernel on a personal, daily-use device to catch bugs that > do not reproduce in test configuration. These are the ones that often > cost the most engineering time to track down. > > CPU overhead is bad, but generally tolerable. RAM is critical, in our > experience. Once it gets low enough, OOM-killer makes your life > miserable. OK, anecdotal experience works for me. But this is all stuff that should have been in the changelog from day zero, please. It describes the reason for the patchset's existence!