From patchwork Fri Sep 17 11:07:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Elver X-Patchwork-Id: 12501681 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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL 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 ED5A6C433EF for ; Fri, 17 Sep 2021 11:08:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 87F6F61164 for ; Fri, 17 Sep 2021 11:08:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 87F6F61164 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 2563A6B0073; Fri, 17 Sep 2021 07:08:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 206566B0074; Fri, 17 Sep 2021 07:08:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFD9D6B0075; Fri, 17 Sep 2021 07:08:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id DCF386B0073 for ; Fri, 17 Sep 2021 07:08:16 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A5D35824556B for ; Fri, 17 Sep 2021 11:08:16 +0000 (UTC) X-FDA: 78596791392.39.EB24B3C Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) by imf22.hostedemail.com (Postfix) with ESMTP id 5CDB2190F for ; Fri, 17 Sep 2021 11:08:16 +0000 (UTC) Received: by mail-wr1-f73.google.com with SMTP id s13-20020a5d69cd000000b00159d49442cbso3585442wrw.13 for ; Fri, 17 Sep 2021 04:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=vzNr90124HBGMksCA+v8zEh8chsocOdGVYWBleMT7ko=; b=HKCkuYw5S8ETo96SXud0sKArbtkaCJ6uKSE8Z5ggKIbOYUFndfaY9N7HytQezaZR1o AvjDoDe63aCCd9Xn0yHcGwKucID7F+MBgzEhF1I8kP/7vFRfUhahkX5/B0aRD/Az0kcm Frf2IAWm8GXm4ziW0aHikywvY8Zs+s73fBH9SS9wEZ7oa5ds/Ar4Jqtpuu0YIXv2bHYJ TWE6EZzdCOFKz0x1IMFuK1YrQrMEzsDr52HPP9Kkhnr3/vH9CaqI19vOKYvgND/mJ86+ XrIrigK7kjHPMWS/tUqzPRAql9nHhAIeJzYjlUpimMYEnZVNWViXr0TrKaUEb46PLTQC sINg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=vzNr90124HBGMksCA+v8zEh8chsocOdGVYWBleMT7ko=; b=AUjbrR14okjWQuUMpMCwMhpjt6TDDHGmEhcYpgl8g4hgDyZynwud3J+w8V44zXw7og TLv1GrGNu0H+XnXL7rfVGgx2UdViwAkJPwVm3pAgQPpL92h00gLLcBM6GMbKBNrMigG+ +RgpDILBWvSjfY4bHftfZkWQSFlDsM8TK+qODNM+W/65DYvX3o6+V94AoA8k5tzDDxEI +iZyum/y+ADzIVw7bIeL3S/FyPu0pAYwAHzd8gz+U/4gTLde3LNTOm+P/A3sW7YiYQrt t0dNr9CjBrInjfUKAwxcPC4UZRwm0cqI/ic2YBP/WujeP4lnka4482zagNSkHubc8bPu i5rA== X-Gm-Message-State: AOAM533zZ9y+3wMkKgscSzO6nNu03HtnkwKkdvRA//3EHwKHdR+V6BM1 baUErrnJrlP1bymjtRmLdb828z7k3A== X-Google-Smtp-Source: ABdhPJyIdwHM+EXD4Pob8DSaRIHbKtfrgeHA9h+Iz8+YtK1Yl9Q/G+jUQ/ZxnG6ALfNdmYApBDZwCOKEMw== X-Received: from elver.muc.corp.google.com ([2a00:79e0:15:13:1a57:84a3:9bae:8070]) (user=elver job=sendgmr) by 2002:a1c:3845:: with SMTP id f66mr9628773wma.63.1631876895324; Fri, 17 Sep 2021 04:08:15 -0700 (PDT) Date: Fri, 17 Sep 2021 13:07:56 +0200 In-Reply-To: <20210917110756.1121272-1-elver@google.com> Message-Id: <20210917110756.1121272-3-elver@google.com> Mime-Version: 1.0 References: <20210917110756.1121272-1-elver@google.com> X-Mailer: git-send-email 2.33.0.464.g1972c5931b-goog Subject: [PATCH 3/3] kfence: add note to documentation about skipping covered allocations From: Marco Elver To: elver@google.com, Andrew Morton Cc: Alexander Potapenko , Dmitry Vyukov , Aleksandr Nogikh , Taras Madan , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 5CDB2190F Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=HKCkuYw5; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf22.hostedemail.com: domain of 3H3dEYQUKCDAQXhQdSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--elver.bounces.google.com designates 209.85.221.73 as permitted sender) smtp.mailfrom=3H3dEYQUKCDAQXhQdSaaSXQ.OaYXUZgj-YYWhMOW.adS@flex--elver.bounces.google.com X-Stat-Signature: nri4dftmq3jf1g55uiyyxu8t5x77k45j X-HE-Tag: 1631876896-189563 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Add a note briefly mentioning the new policy about "skipping currently covered allocations if pool close to full." Since this has a notable impact on KFENCE's bug-detection ability on systems with large uptimes, it is worth pointing out the feature. Signed-off-by: Marco Elver --- Documentation/dev-tools/kfence.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/dev-tools/kfence.rst b/Documentation/dev-tools/kfence.rst index 0fbe3308bf37..e698234999d6 100644 --- a/Documentation/dev-tools/kfence.rst +++ b/Documentation/dev-tools/kfence.rst @@ -269,6 +269,14 @@ tail of KFENCE's freelist, so that the least recently freed objects are reused first, and the chances of detecting use-after-frees of recently freed objects is increased. +If pool utilization reaches 75% or above, to reduce the probability of the pool +containing ~100% allocated objects yet ensure diverse coverage of allocations, +KFENCE limits currently covered allocations of the same source from further +filling up the pool. A side-effect is that this also limits frequent long-lived +allocations of the same source filling up the pool permanently, thereby +reducing the risk of the pool becoming full and the sampled allocation rate +dropping to zero. + Interface ---------