Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2740847pxb; Mon, 31 Jan 2022 03:21:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIPVZGW4Vz9MWqzV9P1OigZOXWN0bRKJf/YXl12fuQzKvfW0Q7MVCVSGsT88QDAhjzNZJq X-Received: by 2002:a05:6402:5186:: with SMTP id q6mr20159378edd.96.1643628065062; Mon, 31 Jan 2022 03:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643628065; cv=none; d=google.com; s=arc-20160816; b=DjueoDSiHVrR9b8Pli/+394wIBmLNqWI92ZIS2oJnh77F+AaIPGInXVd/M4ZD76Aur daBJRIuKVVsVtznrET4cMVGEiOamL6fwb84IgCTIhTdEveafjoBIDUCFImkfKe6RssLn QaMDRlECMiTlNOOlCHpmQhpKoq2vvAWPzRGQJ2UqdM8ROfa2Lgvla/+ojvSRNVKQB3i9 RuoVZIpcjZpfKvjmMjGwIdNAogGEz+jh/BKQwJz5DqEfWtFWFbnYSJzUZEOnfx4fBxJD nQjlOKMKYA8/Ysbyic37IVK1CZMq1KGuPdP4HCpdLoj++4/HaPJdpB9CXB0qeV+ELqO3 0Tdw== 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=HO9B6AQD9lhtTNqYreWDbICBEhJE9ur8i2dfTih+tHU=; b=I1wbiN0huFRYcbxrPac9aeIEsflky9g50HnMe7RwG+51aJwdM4EvURY9zT6Ql7Vr6j 0JxnGtJCoZ6wCiJ10ipxZCNlH7BxAOEO4khA+9Ox6hHcNRZkn4yrznLfE8srdiNgVxn7 M6xcFuJRc1o+5DXmRn91c9EQBSnM6Ebk9gAoQP043ISc5xTj+dLdC8dauI8N1pTGeoYt 3OI8+RoFoBdcu+NHrUp7wXbuAqCkM5DPooIsneuKHBIkkH59bwHThVHnvO/BH/UsvSEg pFzFII6qHPkmpYvMfxg/84BbUQHRlLruFFLedTLYrY390KGxKW+RT77eHXbsJdu8S/1V 53AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=CIBNIxAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si6232270ede.245.2022.01.31.03.20.38; Mon, 31 Jan 2022 03:21:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=CIBNIxAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S245607AbiA1Q3D (ORCPT + 99 others); Fri, 28 Jan 2022 11:29:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231221AbiA1Q3D (ORCPT ); Fri, 28 Jan 2022 11:29:03 -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 E9C21C061714 for ; Fri, 28 Jan 2022 08:29:02 -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 8948561EE0 for ; Fri, 28 Jan 2022 16:29:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D33BAC340E6 for ; Fri, 28 Jan 2022 16:29:01 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="CIBNIxAP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1643387339; 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=HO9B6AQD9lhtTNqYreWDbICBEhJE9ur8i2dfTih+tHU=; b=CIBNIxAPQM2eCdTK8k/3cBsl/z2fbSw/8xR9uT8598k4f5xaNBQvqyNXpVE8DqdgVZKXZ3 qy8PKeMwm+CMz5MM6NLBCqv8Baf20Y9INe13tDTs9IDv4lzJj1ig06iU3h0dEhAq+n9E5j 3q5P8nQMZSfUPYiXTZ1FJnZeeN21u4I= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 835cb781 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Fri, 28 Jan 2022 16:28:59 +0000 (UTC) Received: by mail-yb1-f182.google.com with SMTP id k31so20097110ybj.4 for ; Fri, 28 Jan 2022 08:28:59 -0800 (PST) X-Gm-Message-State: AOAM532/Si7RxDsEie4urdmDi5aVCEnmrjvdjZlG6RAu8SctOVoIb4dT Z4vhRJMXThSjbJAflhmk2zeqOwm8kbb+K65GaHg= X-Received: by 2002:a25:2284:: with SMTP id i126mr12674192ybi.245.1643387338043; Fri, 28 Jan 2022 08:28:58 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Jason A. Donenfeld" Date: Fri, 28 Jan 2022 17:28:47 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: "BUG: Invalid wait context" in invalidate_batched_entropy To: Sebastian Andrzej Siewior Cc: =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= , Andy Lutomirski , LKML , "Theodore Ts'o" , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sebastian, On Fri, Jan 28, 2022 at 5:19 PM Sebastian Andrzej Siewior wrote: > Correct. You must not acquire a spinlock_t while holding a > raw_spinlock_t. This is because on PREEMPT_RT the spinlock_t is a > sleeping lock while raw_spinlock_t disables preemption/ interrupts and > sleeping is not possible. > Documentation/locking/locktypes.rst > > On non-PREEMPT both lock types (spinlock_t & raw_spinlock_t) behave in > the same way but lockdep can tell them apart with > CONFIG_PROVE_RAW_LOCK_NESTING=y and show code that is problematic on RT. Gotcha. Surely, then, Andy's patch at least goes some of the way toward fixing this, since it outright _removes_ a spinlock_t. There is still the other spinlock_t that you want removed, I realize, though this doesn't appear to be the one from Jonathan's bug report. It sounds like Andy's patch might be one side of the fix, and your patch the other? Jason