From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 930D2C3279B for ; Mon, 2 Jul 2018 20:30:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5678D208B9 for ; Mon, 2 Jul 2018 20:30:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5678D208B9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753164AbeGBUa1 (ORCPT ); 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!