Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3493895pxb; Fri, 4 Feb 2022 09:38:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWNs7/i/9qDqgZ24/xbbHapvxYNBgsHgGhl7d7Q0vX0VteUxh04Xagt8DJJ/lUrRrv5ky8 X-Received: by 2002:a17:902:c402:: with SMTP id k2mr4118788plk.131.1643996311851; Fri, 04 Feb 2022 09:38:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643996311; cv=none; d=google.com; s=arc-20160816; b=df1Po2sDtuKBjD1Qt/l8QL7VZvW36lsK8U9rt7x2CKwBt5baZA5ytQM/6E2lihd79R EB7KxqaxFDXPLOKEVgoiaZxAg+qL778/OaBuRcvdO866PJgUi3FE4MogTbkPlH+PO3aL coQCXvdVuyN8JLQX5hAHzjcNLk9gMT7GilOpgkemXQPyIwwnzWRs2yCOW24f4eOj63Hg fJxGrAkETgvSd5FT8nTK6WgXqGDEH5ZKJJCOEkIQqnNyWDlMah+tTLCwoqwpbqHTCvnQ yl1cLTUELR7im8qpErbkhsDZ3xtFJ9E2Jyf3m9vZX1zvgF2ekVSC9X4wqvjhqFqW50xx 2tZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OeJsq+4IasIrFGg0OXj6RdIsVHdb3/r+NoA3dw1M+b8=; b=OH4zHSwZEF2PPF1kgPruHy9o0t+iO6BmRGDUD8cDOncQaCr89SiiLLuyayAjiVgL7e z2wOrMYdwyWcDF7Pc6mqVK+OxyDERcIOw/JC/3xeTZ5/IDbr7phNQxVBZsiCxjFCyt2i jJipJING/IBOd1auSxcUfPcDsKtqah/JQXEGSop4k+Ly0t0hKbvjEXyN2UkVbpU3WwkW 1e1WifC0PKtD764NjxlvxbCrxdpEWWJMRa0Bftqu1YaDoMxRN12Pk2J2H76msDs1a727 kYG8FD9YoxyPBBa4BRoPomKBvatlgxnITcSeuXt4s4pyJNOsFZLzVuaLIXUZVRWY/ot2 YUgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=N2whDa6P; 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=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3si2546854pgh.63.2022.02.04.09.38.20; Fri, 04 Feb 2022 09:38:31 -0800 (PST) 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=@zx2c4.com header.s=20210105 header.b=N2whDa6P; 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=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359201AbiBDOLx (ORCPT + 99 others); Fri, 4 Feb 2022 09:11:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232803AbiBDOLw (ORCPT ); Fri, 4 Feb 2022 09:11:52 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCA75C061714 for ; Fri, 4 Feb 2022 06:11:52 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 74B3160C09 for ; Fri, 4 Feb 2022 14:11:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B22AC340E9 for ; Fri, 4 Feb 2022 14:11:50 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="N2whDa6P" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1643983907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OeJsq+4IasIrFGg0OXj6RdIsVHdb3/r+NoA3dw1M+b8=; b=N2whDa6PnIqA5ykUmCT6YAFPwmDsJeLrjG2y1DK/gbwbfk46RC0Fw6nvkZTtKolu43LTNV VEeNCQyX+nxNUYAvIQuViNDjqKHcXTu6p/R3F5AGzfWYK/A/kG6dBkeDgv/s6od/wOWFOT GsfxI1MSbIElqoOi+3HaWg2v6uQImzQ= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id a163478c (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Fri, 4 Feb 2022 14:11:47 +0000 (UTC) Received: by mail-yb1-f178.google.com with SMTP id w81so18967691ybg.12 for ; Fri, 04 Feb 2022 06:11:46 -0800 (PST) X-Gm-Message-State: AOAM530238KQZ4IGD2vOe3iA8bReLcrkC5dSexx0k0lU9VMgt0GQEWgj QIMiOKI435hugiWMPeCKyqbjR954WnTSb2BLZi0= X-Received: by 2002:a25:9088:: with SMTP id t8mr2753751ybl.113.1643983905375; Fri, 04 Feb 2022 06:11:45 -0800 (PST) MIME-Version: 1.0 References: <20220128223548.97807-1-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Fri, 4 Feb 2022 15:11:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] random: remove batched entropy locking To: Sebastian Andrzej Siewior Cc: Andy Lutomirski , Boqun Feng , Will Deacon , Peter Zijlstra , Ingo Molnar , Waiman Long , Sultan Alsawaf , "Theodore Ts'o" , Andy Lutomirski , =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= , LKML , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sebastian, On Fri, Feb 4, 2022 at 3:02 PM Sebastian Andrzej Siewior wrote: > The commit in tree you cited is b43db859a36cb553102c9c80431fc44618703bda. > It does not mention anything regarding faster nor the performance > improvement and conditions (hoth path, etc). It still has a stable tag. It dropped the Cc: stable@. It still has the Fixes:. I can get rid of the Fixes: too. I'll improve that message a bunch for a potential v3. > > Maybe it'd be best to retain the spinlock_t, which will amount to > > disabling interrupts on !PREEMPT_RT, since it'll never be contended, > > but will turn into a mutex on PREEMPT_RT, where it'll do the right > > thing from an exclusivity perspective. Would this be reasonable? > > what does retain the spinlock_t mean since we already have a spinlock_t? The idea would be to keep using spinlock_t like we do now -- no change there -- but move to using this atomic generation counter so that there's never any contention. Actually, though, I worry that that approach would throw out the gains we're getting by chucking the spinlock in the first place. What if we keep a spinlock_t there on PREEMPT_RT but stick with disabling interrupts on !PREEMPT_RT? I wish there was a solution or an API that amounted to the same thing so there wouldn't need to be an #ifdef, but I don't know what that'd be. Jason