Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5346858pxb; Sun, 6 Feb 2022 23:03:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdX/dorNc77XEia91MPkH3r7tH6Nk4D/V1z34ujWCs5NTEuXNlrLmgfKpqEuLG6z1zs9Y2 X-Received: by 2002:a63:5703:: with SMTP id l3mr106353pgb.611.1644217425775; Sun, 06 Feb 2022 23:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644217425; cv=none; d=google.com; s=arc-20160816; b=RXXuWOxI1SpyeBJPdwr0nR81op2QDd5pT2SHJAXDSdS3WYDVijrgZHCjoU+UBhgG0S jQG6NUAc7YPevtRCWIWFHQ9l1O3kaDB1jGpbhXWz5qOtvyYDavJQENJuQPGHgVCFcoif vasIgd0wn6KaLnLsIIWaCdFcDDoCQj4tgrt4I+l9g8eMkm2wkXmTjqY/wA8pAtwBo9Ax fFFueNmCgeSI2o54pYmiCnAtNZzPEN2BnG1o7pQvO09zyvC0mZJwlTYsiFEmn8+F7Feu IVOzLKlwsflhkNFGmbCwkLM0m5GDhWmaHSFhr9CBT+pxoDQvaIuXzlxPUX9nGURrGcCy wOdw== 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=jQFCILD84RvGZYVRVF0fFfu13wbdQHH6Hd2HyA76xGY=; b=yVNoxioYS8e0DSXJDHQ/1lH7d5uFdE9BAWRddPT0hO49tDqlgnIdfLlKSWvb1H5Icw lXGyhDCY59hwD697lsdpRyUVuie8NEYweQxO1Ye8dAETRbbVwWsi1ni/dmVyDqumSTyQ ALqr99QU43XL036yMFmbECmU29S1TSIRjdOWCOs4BYSqn1tBLmsthTe6/wwFxfxSwDEW PPRrcPt7ytYlCio13C/ivnn3Pt3kYE3xI3j6EDa4mhxPRzUI/cQXo2RzAfBEi5nmquw4 j9sNI76rAnbC5jIHaqamH29A+Oq8vXvJyjRFjXlFuwhJOSg5VccSLRWbrOywdvdAxY5A VPUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=QtCqnhwC; 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 x22si10737545pgk.297.2022.02.06.23.03.13; Sun, 06 Feb 2022 23:03:45 -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=QtCqnhwC; 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 S1359752AbiBDPje (ORCPT + 99 others); Fri, 4 Feb 2022 10:39:34 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:38852 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359680AbiBDPjd (ORCPT ); Fri, 4 Feb 2022 10:39:33 -0500 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 05633B837ED for ; Fri, 4 Feb 2022 15:39:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D308C340EF for ; Fri, 4 Feb 2022 15:39:31 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="QtCqnhwC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1643989169; 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=jQFCILD84RvGZYVRVF0fFfu13wbdQHH6Hd2HyA76xGY=; b=QtCqnhwCAbYZE3hOv9MWacmHZzcts6HUNbKkhWqof/KDRnA/oVRi8sAGLvK1mUBQBUk9lj cnSyxv7eU4hqP0WRwjIc2ZQIXH2R5W7/Vs+lXTxnaH1/5PwRsg9TxEB3yv6Q4655S066r3 678xR7FNFij9EK1za7SV+v8KRjunCPk= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id afb43c74 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Fri, 4 Feb 2022 15:39:28 +0000 (UTC) Received: by mail-yb1-f178.google.com with SMTP id c6so19933758ybk.3 for ; Fri, 04 Feb 2022 07:39:27 -0800 (PST) X-Gm-Message-State: AOAM5326YdgSe83Scy9FGrcKwT/fDN7HEPrXsUm0OD6Od5OUQyUcNYik rmUwlEawJ3ioI3Z2OMGHG1iVNv0zJrnKaWkYESI= X-Received: by 2002:a05:6902:14d:: with SMTP id p13mr3323253ybh.638.1643989166745; Fri, 04 Feb 2022 07:39:26 -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 16:39:15 +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:30 PM Sebastian Andrzej Siewior wrote: > > 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. > > If it is still to much try to look for locallock_t and > local_lock_irqsave(). This is kind of like your local_irq_save() but > you have lockdep annotations and PREEMPT_RT has a spinlock_t like > behaviour. It also documents in-code what the scope of your locking is. Oh, that's terrific, thanks! Sounds like exactly what we were looking for. I'll respin this patch with that. Jason