Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6137811iog; Thu, 23 Jun 2022 12:08:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sxIy31nftJS5QhCZIAAbob/S2c+GmlVTwfemQjgAasKrILsB9TxFE/yyW7t/70rXIC3nT5 X-Received: by 2002:a63:5304:0:b0:3fb:92eb:8e90 with SMTP id h4-20020a635304000000b003fb92eb8e90mr8758570pgb.36.1656011285963; Thu, 23 Jun 2022 12:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011285; cv=none; d=google.com; s=arc-20160816; b=pKJPtgdQ4VdIE0K51y/rrThE7yUURmEwclVNnXxRKiKL6ZCB6xkhOcqvqZfhGhEveT y+3LIu4nJBJUBXa6mvIzkKhwjMBLZbhCg4t2ATHXzFfiRoi/Dv7mk9ahooNma9nvhG86 v4m+QqM6R+EcoUi8cbZSUA+I/nsK2wf+oZsk3Ajj9ju0/R3G8w2jwjfwRcuKnpI4OERB kPuK6d0nT4xJuDpcAKj6bghAIQ0JaS05Tg3Kq0yGzVC1Da7SFwEFp8wZtQhLKRD43tqe 3Oi5eaMqgQf0j48n6M0HC4y77kwn7YRnGFhBolRICtjCYay/3qrfSE28GkmQaRtlw5Dg EqQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NfXd3kVXDM8J1klwRfRFRqZYK3H9T7+V2BVZmXD+RDQ=; b=scwZA5R3xjsyhDKSUqLxrbUp4HUqCBZql6gDy81rQW2H8HJaEm9SxtxL3wqQ/Ood0T k3uWzN/2a8XqNYZB7x8tHs35kcWF0PRT2WFeK5No6JyxIVodRCVpIM4KfkMy9mmtkeJK K1GwQ9+G8/Um36optzAyqU3colimvaO/m1Ui1prg/f24JJ/VH8M47WymI4MRFOiwgM2P TDCqLqaQhQAWkbg/bXkoxPWarwZgGQqYutJve20nwMMVwWaBqGZJea8vP6Jmpyl4HaOn uROsW/rmRv5sPl6Nj6v//IO5sNgiDeDbO7p4hqeNNQwuz2krdVfkIi946zaIh0vJfFGe 4/XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L4jMqbHu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v63-20020a638942000000b0040d5fd63025si2184008pgd.794.2022.06.23.12.07.54; Thu, 23 Jun 2022 12:08:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L4jMqbHu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235653AbiFWSDw (ORCPT + 99 others); Thu, 23 Jun 2022 14:03:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235759AbiFWSBm (ORCPT ); Thu, 23 Jun 2022 14:01:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 044E8B3D2D; Thu, 23 Jun 2022 10:16:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 98CE9B82498; Thu, 23 Jun 2022 17:16:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1212C3411B; Thu, 23 Jun 2022 17:16:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004605; bh=kJwg6cHb59gi89smRYm2AiZGgw64XAJlrsIhNxeYc4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L4jMqbHuyv7ewqqrfsedRHqnQqJqucuZfFO7aK79Am5XdU7436vlMqyhUdaRv3rT5 QeyJ1Y7sTH3LoAVNBFeCvvBPieuG9dFQQRhlM17riNv+OsoBmqg3hRa5mmD85n9OFY 6OjvhtPgrBlB/qmkYh5Ay7nwOE9zosk5KewkaKHE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso , Eric Biggers , Dominik Brodowski , "Jason A. Donenfeld" Subject: [PATCH 4.19 092/234] random: remove ifdefd out interrupt bench Date: Thu, 23 Jun 2022 18:42:39 +0200 Message-Id: <20220623164345.661937025@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Jason A. Donenfeld" commit 95e6060c20a7f5db60163274c5222a725ac118f9 upstream. With tools like kbench9000 giving more finegrained responses, and this basically never having been used ever since it was initially added, let's just get rid of this. There *is* still work to be done on the interrupt handler, but this really isn't the way it's being developed. Cc: Theodore Ts'o Reviewed-by: Eric Biggers Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- Documentation/sysctl/kernel.txt | 9 --------- drivers/char/random.c | 40 ---------------------------------------- 2 files changed, 49 deletions(-) --- a/Documentation/sysctl/kernel.txt +++ b/Documentation/sysctl/kernel.txt @@ -852,15 +852,6 @@ This is a directory, with the following are woken up. This file is writable for compatibility purposes, but writing to it has no effect on any RNG behavior. -If ``drivers/char/random.c`` is built with ``ADD_INTERRUPT_BENCH`` -defined, these additional entries are present: - -* ``add_interrupt_avg_cycles``: the average number of cycles between - interrupts used to feed the pool; - -* ``add_interrupt_avg_deviation``: the standard deviation seen on the - number of cycles between interrupts used to feed the pool. - randomize_va_space ================== --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -240,8 +240,6 @@ #define CREATE_TRACE_POINTS #include -/* #define ADD_INTERRUPT_BENCH */ - enum { POOL_BITS = BLAKE2S_HASH_SIZE * 8, POOL_MIN_BITS = POOL_BITS /* No point in settling for less. */ @@ -806,27 +804,6 @@ EXPORT_SYMBOL_GPL(add_input_randomness); static DEFINE_PER_CPU(struct fast_pool, irq_randomness); -#ifdef ADD_INTERRUPT_BENCH -static unsigned long avg_cycles, avg_deviation; - -#define AVG_SHIFT 8 /* Exponential average factor k=1/256 */ -#define FIXED_1_2 (1 << (AVG_SHIFT - 1)) - -static void add_interrupt_bench(cycles_t start) -{ - long delta = random_get_entropy() - start; - - /* Use a weighted moving average */ - delta = delta - ((avg_cycles + FIXED_1_2) >> AVG_SHIFT); - avg_cycles += delta; - /* And average deviation */ - delta = abs(delta) - ((avg_deviation + FIXED_1_2) >> AVG_SHIFT); - avg_deviation += delta; -} -#else -#define add_interrupt_bench(x) -#endif - static u32 get_reg(struct fast_pool *f, struct pt_regs *regs) { u32 *ptr = (u32 *)regs; @@ -863,7 +840,6 @@ void add_interrupt_randomness(int irq) (sizeof(ip) > 4) ? ip >> 32 : get_reg(fast_pool, regs); fast_mix(fast_pool); - add_interrupt_bench(cycles); if (unlikely(crng_init == 0)) { if (fast_pool->count >= 64 && @@ -1571,22 +1547,6 @@ struct ctl_table random_table[] = { .mode = 0444, .proc_handler = proc_do_uuid, }, -#ifdef ADD_INTERRUPT_BENCH - { - .procname = "add_interrupt_avg_cycles", - .data = &avg_cycles, - .maxlen = sizeof(avg_cycles), - .mode = 0444, - .proc_handler = proc_doulongvec_minmax, - }, - { - .procname = "add_interrupt_avg_deviation", - .data = &avg_deviation, - .maxlen = sizeof(avg_deviation), - .mode = 0444, - .proc_handler = proc_doulongvec_minmax, - }, -#endif { } }; #endif /* CONFIG_SYSCTL */