Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6031439iog; Thu, 23 Jun 2022 09:56:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u9va8Hw1nzuLJhqq327GnCO5zqGA7Yp/xS6LcQtQclVBJ4Jx1wCSHBA4qbHrbDuveZOT4f X-Received: by 2002:a17:907:6d0a:b0:722:b0b5:be69 with SMTP id sa10-20020a1709076d0a00b00722b0b5be69mr9207897ejc.76.1656003392835; Thu, 23 Jun 2022 09:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656003392; cv=none; d=google.com; s=arc-20160816; b=i/9m5De2/tl7XncwzKfkkvrx2goAB6vvm0q0nVKCMuNicsvWCmgrHHNcMCQbEFagU8 ocnyN0I9AuEcEVluCP5GuQ069uFZpyG4zHi0SMgAd1UT5rJT8CPY9NXdDJ3o08Nyf4Fx OnIK+bi2cKn6sPcmeM+UHGYSsqLP0j/jv7+FAhGz93pQrUXo/amMlypzLNv58B4dHlwQ xxOdjnkSjvTyiTEbMjj5ApsjtCk2F6Jki6OZsCAiIhWk4MSpuBq3/5eC64FW7ZPLvIGc xkYmudYVxUC0r4oCdIfZxJsrTk6D2FUSf9ZU4x/7tEQPXoVGviyaZpdthslgG2TtqeiQ X1fA== 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=0wSNEDkrLqTrthilqYYNn8lFWBnn/7a5n3iFcy/g7m0=; b=NMm9ezUDws3uvf/YD2Ejkg52K9KECl/GxZJ1ZuKKISDP/01rbVqbJBc/zeGWZ05uKW OJAbon88Ck5cZc/w6mA6ZBxbdte+G2qy4BRfXn4lbcAXrSCf5CjDlYnL6OkvjdS6004F KckJNds04Wc8ZLT2tqd8VIm3sWxBV63NAK1qtpHJmvj+FWub7j+S7xSpxM/vLK7sxW4c AdultYFJFauvmhq5Lg7I5a965tzVrM2pVrXTPRZOjwDfNmlieiYRVxNZDz7DZYx8m6mG AybwzIfLq+wIOr+z4YWVcgp7qftMx5B41sqUixzfPi0NgKXLARMUm0Fl4P2CLWll9Vl7 FRQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m3XdzQKG; 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 z4-20020a056402274400b0042b5724a3bcsi168587edd.21.2022.06.23.09.56.07; Thu, 23 Jun 2022 09:56:32 -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=m3XdzQKG; 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 S232217AbiFWQx3 (ORCPT + 99 others); Thu, 23 Jun 2022 12:53:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233912AbiFWQv5 (ORCPT ); Thu, 23 Jun 2022 12:51:57 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57E43127; Thu, 23 Jun 2022 09:51:56 -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 sin.source.kernel.org (Postfix) with ESMTPS id AD735CE25E1; Thu, 23 Jun 2022 16:51:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1CCBC3411B; Thu, 23 Jun 2022 16:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003113; bh=iHbkmEutcboVPlB7K4tet0H+QZo0exSmmdF3rPc2IUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m3XdzQKG07gVAAl8dwKaJwZ2cYbdWA72GVIzGZJHEBHCn4APc0U8kLuXwybCJsWdd XnJV42LAjPZrxWT8TyY838TklnOoRXZWFSmr9RUaJc08EVMT38WS3PDgsNpckvjhKa N9QDAfG38DR8WsRV0mN71bIvfIt6MYI2TiltXiCM= 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.9 127/264] random: remove ifdefd out interrupt bench Date: Thu, 23 Jun 2022 18:42:00 +0200 Message-Id: <20220623164347.660298605@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@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 @@ -808,15 +808,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 @@ -241,8 +241,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. */ @@ -858,27 +856,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; @@ -915,7 +892,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 && @@ -1623,22 +1599,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 */