Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp385746imm; Mon, 2 Jul 2018 13:25:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIJCuQqgpthYgiujx267rdUBaF+1hN5wzkK8/R5nK4DbQwNZeP2ezDHl6fareQoWm/SuWoN X-Received: by 2002:a17:902:9307:: with SMTP id bc7-v6mr27219063plb.292.1530563103494; Mon, 02 Jul 2018 13:25:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530563103; cv=none; d=google.com; s=arc-20160816; b=ZtfEcwymHlAStTrd+TDBVdZMhyP+PmDnj5uNUEJsmuiENc06Vo/V6nIcQwDIyE8Xw4 IADltd3ToVAltSiT5dA/VG/y1PjEZq0BkzUXzz+9se5ShvEOUIneuWJhfeqQ2D6Z8uoU qJF1fHM+e/mt1yIm4bLHbV1Cm9EbPA2d66oaGqBrXxaBLCVIcf9BWhkCFNry2MfHHx5H orVOrZxcNG6iqG97WNT633dK2HS4Rut31gjsUdA2SwcvuZQYhs22XEmqIJd443FjJxqL VQOTMNyXK8UVG8WWkDU6Jp45cGnAdCmxY73J4svxAvpcZTYCijcJJ8aHf2MNEZe1bwC+ oeYQ== 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=DZTBWkBvc3s6b5/8FNQDgU2F5m6kB0RUONZYE0rCNzA=; b=dZKalW5X39JA/lDDk4D4xO40DWSaeaT/kgyjeFypDbNnFSdSSQHkgqHbrzsCjkXSeY b57tOki358REtcAIIfTy+keArWZBh7GvM/iMemuGRFMng3yVrOgeEN9+JcdLcc8zYDFC JdS1EQR0FNrKwk/7XyN4SGFWx3t1AsknnKWC8PvfBDIaFtKaar06nkOi5jKx9f068wmM w76oTR3IiX7B7wNTYK72ABu4hI081rXBda1ax2Ioc8pq3lN0Bg/RtL8JiMN2o8Qbt+Oj VwZL94KKluR+8w+DAOlgYfqArEkO1sUPQq1NrEDiSxcC1e5xbJW9KkwyBab1Q5py7gwt UjZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RQw33hFZ; 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 s14-v6si14823496pgn.76.2018.07.02.13.24.49; Mon, 02 Jul 2018 13:25:03 -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=RQw33hFZ; 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 S1752930AbeGBUW3 (ORCPT + 99 others); Mon, 2 Jul 2018 16:22:29 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:34783 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752208AbeGBUW0 (ORCPT ); Mon, 2 Jul 2018 16:22:26 -0400 Received: by mail-ua0-f193.google.com with SMTP id r10-v6so10849172uao.1 for ; Mon, 02 Jul 2018 13:22:26 -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=DZTBWkBvc3s6b5/8FNQDgU2F5m6kB0RUONZYE0rCNzA=; b=RQw33hFZlr62q4fW1W2GrPeZcbVZLDaSJZoa6oo6OSrbiwuPJlR+B6Y6kTyRV/x7Rq +cXPwxjfqVPND/f2uASUgl1r2G/ouYqIsQlZVhPMcLoAQ1gApxM9qLOYag6N9AJJLEty AloaAEHgghdna0/N4yziYab+v5aN3wlXPwiyzRczljNB+0Iw6gw/NEYxnVVGSX6OKnRO RHZUGKMDU81fmvN+AGwGSHlfmo8p4iG2IEUP65SgbVeDJXeDO2ZKQAwUdW1TnGTWeRNx qMJvh3ANDyKYWnnAaaWWJkPr76bgLsRqNWuIYtfRPjrpfkongRWdgIY2Z5w/UGWQmszd lR+A== 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=DZTBWkBvc3s6b5/8FNQDgU2F5m6kB0RUONZYE0rCNzA=; b=QOG6NduhjO6YLb/Wunhcz1OthlJf/lgr342PiFyzNrEJ4QRKCiiIu4PQ6dB2cw+GU6 x22pqnTk3MuXrFbnWH0S+eZM7zY5xhkLYbogdPmrG0e78/HVPf92GhorHHRKnYZR/ljP 4S9OJsfCu62N1Hm643pfz0O+YWQuLi33ZWOESrf0s9QoxXG+xXQc+Ak6Km0bstBBn+XY 2Qo8+qHff4+jm0u6FOkz9X5KY2XVzAj2aSFm9lfiiUpTvf/4Kj829g2WVMINv/maLNbu 4mFjKYxVaNNxwWe6BCZXD9r4giqD1Zz7hkD2dafKFlHIiqkHmL7CVq8XpC0mQjJzzu3Y s/Fg== X-Gm-Message-State: APt69E10eRUBgq+8TFwMd+umb8C4aRkTUOtrUYtmzlsdg3UbWLPrvCcu G78FB07t/VOAgEtNiVR4hwG4kHLTHC3xYmfeqU8C2g== X-Received: by 2002:a9f:3d6e:: with SMTP id m46-v6mr16664810uai.17.1530562944456; Mon, 02 Jul 2018 13:22:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1f:9d83:0:0:0:0:0 with HTTP; Mon, 2 Jul 2018 13:22:23 -0700 (PDT) In-Reply-To: <20180702122112.267261b1e1609cf522753cf3@linux-foundation.org> References: <20180627160800.3dc7f9ee41c0badbf7342520@linux-foundation.org> <20180628124039.8a42ab5e2994fb2876ff4f75@linux-foundation.org> <20180629194117.01b2d31e805808eee5c97b4d@linux-foundation.org> <20180702122112.267261b1e1609cf522753cf3@linux-foundation.org> From: Evgenii Stepanov Date: Mon, 2 Jul 2018 13:22:23 -0700 Message-ID: Subject: Re: [PATCH v4 00/17] khwasan: kernel hardware assisted address sanitizer To: Andrew Morton 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 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 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.