Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp390284iol; Thu, 9 Jun 2022 06:02:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCr1bJNyN2iIWCdkCFn6JNQFMBp79czXxVbUjTghe8AjtW2q0mdaW6sTcvGI49HnpFpa8p X-Received: by 2002:a17:90b:1646:b0:1e3:15ef:2871 with SMTP id il6-20020a17090b164600b001e315ef2871mr3386445pjb.105.1654779777315; Thu, 09 Jun 2022 06:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654779777; cv=none; d=google.com; s=arc-20160816; b=hehDWwphj0AJt5CvLCpWBCrkVlptkx8CmK59LoVLs5uwLWWfwyDZj3SsWLshelUkcP 05UpRmzFrBvYnjZcSoklmWxbAt/gCT4ELk7PJr4c3Rxd4Y4NX0YEgYRyWz8MpAlHC84n 5K9XAHBteHXjK2K7DjNsXS6GrTUXO4oqLYfSntW7Qug2rGw9ZNkcJ4kLm7cCEOHS7mda jqS86Ux/VNBeuraX+accpgytSSLp5YdIPWFjlE6Y3J/+ep0k0tZVJsGKyBQPnxaRcAKW GM1LJ6dJGgDJYhH29vKQVmVwYwelkLKl772RMJ1IkXwhQxm5G67H6UcTaqw1I2SqY0zX vEOQ== 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=qCB93MU2lyB4bbkAlS32u/raZUY6pI3+1JJtxGQYwOs=; b=NnTRiCEsXlIZCAZy70z3D0OO8wrLrR+XnZyJ/gaCH3o6TOzd7dbcYXDTh+zk5t9BGV b2FuyIa8qDUll5Q+H9aMLVHZkV6j538CDDj7by8D5re/O0+UR77ynIQI8XqOZwf1hCLj haQtGc/cJbkjaVktCpWf879yrkIj4bQpZPwMDgviXrbEBXOUZlPzueP7MzzbD0xVWVll o4eCiaUBHPjO1g2KPdfUIUQgskD7dgQN+NPIJ91x6k+kWAMqhoOOWB6SILc33INDSBCH CQ1T3ZtvZub/U6IuwAnPWyI/cZu/YG49fWBO0X0TLIHYoUoCI2bMJVCEo2Hgx0uSsxi/ 3+wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=SnGVLIFV; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a636c02000000b003fe0c9f06absi8925425pgc.169.2022.06.09.06.02.35; Thu, 09 Jun 2022 06:02:57 -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=@google.com header.s=20210112 header.b=SnGVLIFV; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243956AbiFIMSf (ORCPT + 99 others); Thu, 9 Jun 2022 08:18:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237918AbiFIMSe (ORCPT ); Thu, 9 Jun 2022 08:18:34 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B32ED15730 for ; Thu, 9 Jun 2022 05:18:32 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id c4so5651089lfj.12 for ; Thu, 09 Jun 2022 05:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qCB93MU2lyB4bbkAlS32u/raZUY6pI3+1JJtxGQYwOs=; b=SnGVLIFVmkWS/5O3WR5Yn2W2Ds1NFqEfS3sI+ejy5eoIAJbLfPG165wJGZZKyDgJX6 IgbU7A4xDIoB4/5BJPf3t9jq3L2YzNf5tEl48IUCjpABmyCvmqoF6ZvT4hx8E3sNDw27 gdOttApmEh9PCcTdXgKIET8ItTeCRFIXikV9nCjm+xRC415Jh6PGndXoZGJmxiTADG0s +iq25xjR3o1sMUNjuHcZjsEe+P+bGz8WqiC2RDA/GZ6/ddEoDBVWiczPATaRuUyQHC5K vocV4QEFzvN97BYgCXdHQ7nLfENH2uTjFwOpCdClRH5hQ53JLHFCWzs6ZrDPecvXlYOY n54w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qCB93MU2lyB4bbkAlS32u/raZUY6pI3+1JJtxGQYwOs=; b=WDT+91O5cjCw2qTlUowYc0yH+fl2/nngn83CVRQfF8Lq16Nu+dvFxi8QX0vduSvFyl nJMJifp2PcIq5P0b2OFujMjMp87xQaz3TgUVkeHTAd3YNx/PIZpWqJtsBL2jIy3r1+k9 TICc9a+ci8sfbA7yL1x16Xlz9/CUCtt9ryR/k4hn2a/H1Ouzv9hksVzPaXrCkB3ylRDi rtxDkWhkkadrPGRRGZw3fUn3BLEP87Hi4wcYYaGBZH59njUjSJqOm7mARcFp4G6S6lp6 GWGw+fKWmif9S/EenGzeKTORubx3NF1Bk2TqFUnhp2vvDvQkGxlJWXO3zaVAihzgrp2r miQA== X-Gm-Message-State: AOAM5309PiHBVfcDwZSkzbh+KwmHzKiYJd0QWj/4QLHd7LpjQh9YTXk7 zjgCMXS/LvgsjCuJNOOOGTr1VxfS9Ge9CL9DaUY7Ng== X-Received: by 2002:a05:6512:3f13:b0:464:f55f:7806 with SMTP id y19-20020a0565123f1300b00464f55f7806mr25244406lfa.598.1654777110811; Thu, 09 Jun 2022 05:18:30 -0700 (PDT) MIME-Version: 1.0 References: <2a82eae7-a256-f70c-fd82-4e510750906e@samsung.com> <87fslyv6y3.fsf@jogness.linutronix.de> <51dfc4a0-f6cf-092f-109f-a04eeb240655@samsung.com> <87k0b6blz2.fsf@jogness.linutronix.de> <32bba8f8-dec7-78aa-f2e5-f62928412eda@samsung.com> <87y1zkkrjy.fsf@jogness.linutronix.de> <87fske3wzw.fsf@jogness.linutronix.de> In-Reply-To: From: Dmitry Vyukov Date: Thu, 9 Jun 2022 14:18:19 +0200 Message-ID: Subject: Re: [PATCH printk v5 1/1] printk: extend console_lock for per-console locking To: "Jason A. Donenfeld" Cc: John Ogness , Geert Uytterhoeven , Marek Szyprowski , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Linux Kernel Mailing List , Greg Kroah-Hartman , "open list:ARM/Amlogic Meson..." , "Theodore Ts'o" , Alexander Potapenko , Marco Elver , kasan-dev@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Thu, 9 Jun 2022 at 13:59, Jason A. Donenfeld wrote: > > Hi John, > > On Thu, Jun 09, 2022 at 01:25:15PM +0206, John Ogness wrote: > > (Added RANDOM NUMBER DRIVER and KFENCE people.) > > Thanks. > > > I am guessing you have CONFIG_PROVE_RAW_LOCK_NESTING enabled? > > > > We are seeing a spinlock (base_crng.lock) taken while holding a > > raw_spinlock (meta->lock). > > > > kfence_guarded_alloc() > > raw_spin_trylock_irqsave(&meta->lock, flags) > > prandom_u32_max() > > prandom_u32() > > get_random_u32() > > get_random_bytes() > > _get_random_bytes() > > crng_make_state() > > spin_lock_irqsave(&base_crng.lock, flags); > > > > I expect it is allowed to create kthreads via kthread_run() in > > early_initcalls. > > AFAIK, CONFIG_PROVE_RAW_LOCK_NESTING is useful for teasing out cases > where RT's raw spinlocks will nest wrong with RT's sleeping spinlocks. > But nobody who wants an RT kernel will be using KFENCE. So this seems > like a non-issue? Maybe just add a `depends on !KFENCE` to > PROVE_RAW_LOCK_NESTING? Don't know if there are other good solutions (of similar simplicity). But fwiw this is not about the target production environment. Real production uses of RT kernels will probably not enable LOCKDEP, PROVE_RAW_LOCK_NESTING and other debugging configs. This is about detecting as many bugs as possible in testing environments. And testing environments can well have both LOCKDEP and KFENCE enabled. Any such limitation will require doubling the number of tested configurations. Btw, should this new CONFIG_PROVE_RAW_LOCK_NESTING be generally enabled on testing systems? We don't have it enabled on syzbot.