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=-23.2 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, URIBL_BLOCKED,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 F3C0CC433B4 for ; Fri, 21 May 2021 11:24:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8558861363 for ; Fri, 21 May 2021 11:24:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8558861363 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1368B8E0034; Fri, 21 May 2021 07:24:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E6888E0022; Fri, 21 May 2021 07:24:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC8B68E0034; Fri, 21 May 2021 07:24:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id BD2FF8E0022 for ; Fri, 21 May 2021 07:24:17 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5A48382499A8 for ; Fri, 21 May 2021 11:24:17 +0000 (UTC) X-FDA: 78165004554.28.B053608 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by imf23.hostedemail.com (Postfix) with ESMTP id CA65EA0001D5 for ; Fri, 21 May 2021 11:24:14 +0000 (UTC) Received: by mail-qk1-f175.google.com with SMTP id 124so6982917qkh.10 for ; Fri, 21 May 2021 04:24:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=UkWBXwz4jU1wfeZPH0TcLgdabL7pumSujVwmqN5JMTI=; b=CH9kJ8ADB3bDTaQhSg8tZ9DxYXfg8lzzrQZfRm93uSX5I1EdeRKNqGby3UhQaH6VkS oQ6K7GGqFlsdcgdy+fs6gAt2qO+O0QdW/h9TFXcbOlhqDQ9KuP7K7yTkcpyM3jQq9N43 H5WCV09/4cMhnw1xA+4MZKyOgl+qCnUxOB80O9/SRLcCqTnxwtd0L2cxH7g+TFHjXfpA 0oxBnTEH9usK1HV7rYpCIDaXMUKgzg3GPT9PANCx0EJftOs4aWGZrzZCFFGs0mW7tGTK /kG8VnYH/G2LRJn1PWj7McVFJ7EylmFFfw4+9egtHOTO6X8y5NUGQKIk+70Pp1cQ59Gt hnrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=UkWBXwz4jU1wfeZPH0TcLgdabL7pumSujVwmqN5JMTI=; b=sFyDgEQ0xWcJkOZwILE+T8DYja9tNr81N3Z9yTVb3tWkmS9Kjy3AjqrNuxVgSJYwHv HM5EFAskf6e2pdJtM1ihg+iXb14fevgMWvcl2bxyYzigy/CZ4Q/w6k7Kx81+ON8Lz3h4 tfK4WmPQKVNxlW28cwdePS9ZavWSUKLrprS/f8gVDj5RELG2kxXRlnDFOJ94QfhlS0Kv PY6rrI84MAmiGKU+FP9bVkAVfRLhqHyIzpuOoFNJf0AjahAJPncOs6/iAanWWJs1o+zg KyeRJov5USxqcQ8jVSnd+GL0YAiC0HqYjGbxlyCnPs5ZM0WO5+GeQ5ZZxMAqT0W610AW 2yuA== X-Gm-Message-State: AOAM530nn2nM4gKZ3uUwdGAB8udG1AQN/AyJNb07QYlWPfXI8mZGYH+g VBeea7VgRxEeIOxAR+at7DQ30ZAvmkcvhtRfecz0FQ== X-Google-Smtp-Source: ABdhPJyZ5RcB0oaoiH70RweEbmZZ7mMBRbs+Nf7XDmhqKqXegPOY6WRI/lr3tptaxoEx702TeECb3zn+3bpqxAFXixM= X-Received: by 2002:a37:b643:: with SMTP id g64mr11995439qkf.6.1621596256143; Fri, 21 May 2021 04:24:16 -0700 (PDT) MIME-Version: 1.0 References: <20210521111630.472579-1-elver@google.com> In-Reply-To: <20210521111630.472579-1-elver@google.com> From: Alexander Potapenko Date: Fri, 21 May 2021 13:23:39 +0200 Message-ID: Subject: Re: [PATCH] kfence: unconditionally use unbound work queue To: Marco Elver Cc: Andrew Morton , Dmitriy Vyukov , LKML , Linux Memory Management List , kasan-dev , Hillf Danton Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: CA65EA0001D5 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=CH9kJ8AD; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf23.hostedemail.com: domain of glider@google.com designates 209.85.222.175 as permitted sender) smtp.mailfrom=glider@google.com X-Rspamd-Server: rspam03 X-Stat-Signature: j37twc9uo54y5q6y4icm37zu7r5qin63 X-HE-Tag: 1621596254-873611 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: On Fri, May 21, 2021 at 1:16 PM Marco Elver wrote: > > Unconditionally use unbound work queue, and not just if > wq_power_efficient is true. Because if the system is idle, KFENCE may > wait, and by being run on the unbound work queue, we permit the > scheduler to make better scheduling decisions and not require pinning > KFENCE to the same CPU upon waking up. > > Fixes: 36f0b35d0894 ("kfence: use power-efficient work queue to run delay= ed work") > Reported-by: Hillf Danton > Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko > --- > mm/kfence/core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/kfence/core.c b/mm/kfence/core.c > index 4d21ac44d5d3..d7666ace9d2e 100644 > --- a/mm/kfence/core.c > +++ b/mm/kfence/core.c > @@ -636,7 +636,7 @@ static void toggle_allocation_gate(struct work_struct= *work) > /* Disable static key and reset timer. */ > static_branch_disable(&kfence_allocation_key); > #endif > - queue_delayed_work(system_power_efficient_wq, &kfence_timer, > + queue_delayed_work(system_unbound_wq, &kfence_timer, > msecs_to_jiffies(kfence_sample_interval)); > } > static DECLARE_DELAYED_WORK(kfence_timer, toggle_allocation_gate); > @@ -666,7 +666,7 @@ void __init kfence_init(void) > } > > WRITE_ONCE(kfence_enabled, true); > - queue_delayed_work(system_power_efficient_wq, &kfence_timer, 0); > + queue_delayed_work(system_unbound_wq, &kfence_timer, 0); > pr_info("initialized - using %lu bytes for %d objects at 0x%p-0x%= p\n", KFENCE_POOL_SIZE, > CONFIG_KFENCE_NUM_OBJECTS, (void *)__kfence_pool, > (void *)(__kfence_pool + KFENCE_POOL_SIZE)); > -- > 2.31.1.818.g46aad6cb9e-goog > --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg