Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1749997rwi; Thu, 13 Oct 2022 19:29:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM74TQ+KhfuNtS0DsRAI+6yVnq5mXVTDIjIXxrUWIiOfyGS05dFsXXSE+090RtBE3yJqbSpg X-Received: by 2002:a05:6402:1bd0:b0:458:f170:fa74 with SMTP id ch16-20020a0564021bd000b00458f170fa74mr2307841edb.382.1665714572412; Thu, 13 Oct 2022 19:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665714572; cv=none; d=google.com; s=arc-20160816; b=Ni7n097yNLhqkujuuiEiXynfrB5dxiCdfnPd3BbBXZVHCtsybFfb/GybB+iEoeWmjv FGGdXtMq9rbjJ6u9ZKOR8dRa895OhLsrrvuaHNIRLTxs3wdlyaTQVBS0+jYP85HCUIo4 X10ecffI00hRpVHeOfBu8OJp2pewkP1hBqJgh6l209K2TsIrgjZ70rLuJYG2a3mxOcRx 1RFgmlVT2xinfVCzVroQfKXq1dul8o3K8h2zXMqZAtsCvsnAvKWgbiQaFEOIBwg+9wb+ HwpenHh0pDHS0qbsPZ4SGZitliuYANpV7ZKPQ2M5aWZwrV71QHZOQXHX/7bofz/GHLqN 2nJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mOvoMnQPQ+hXzXRzn1FfAHr0d6DKV8BynR/9e8/uoVc=; b=dE1jPYHgvFLTKdQDab4semd/u39XK88XausyYrCh4cRpAudi6A7ok4lpgDzz/kBaON 6+VN+mYsxJ9OgU/TuvHRdM/oQemIS5lAe/PrmMBA17gkxzk1J7Q98lRuJkn5MbEHw/H6 QfmeWDjxnWb0KUngZqutZ0f9R2TsKfCFAatcwjef6d1PplcEuIGNfwKTWEt9eKNqMkgZ O7XYbG+wdPtQ6Jo1T5IqYIKWJR0Dr4iGFdWOQE1kGAE+Tn7tI80fPlJ4J8Fy33h1nzcl 0f//FaQ3WnauT1G19sro1u9or+NYFRuP56H7wS5S8fhT1XcnaeRk9FhYx5LcSyKoCv/F N4Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M+FQzbL3; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020a170906975000b0078d78760c1asi1553588ejy.95.2022.10.13.19.29.06; Thu, 13 Oct 2022 19:29: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=@kernel.org header.s=k20201202 header.b=M+FQzbL3; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbiJNCEe (ORCPT + 99 others); Thu, 13 Oct 2022 22:04:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbiJNCEd (ORCPT ); Thu, 13 Oct 2022 22:04:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16A48A8359; Thu, 13 Oct 2022 19:04:32 -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 ams.source.kernel.org (Postfix) with ESMTPS id 8F2D3B821B7; Fri, 14 Oct 2022 02:04:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0DF0C433C1; Fri, 14 Oct 2022 02:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665713069; bh=71JUZnb+/GHrSs/6gc/+znRrLGAfu5erJaV2UmEv+m0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M+FQzbL3lM0qGKwdlolPZlvEUUsmTgpP8TcQVX6CKmos/pVjrUau3/h11d3x0428d TiON4OkKo1L1Np0Rc6/01kI6W+BrYjmdQmtSfToHvLsoA0wJcCFcFVO/pYsGPjddr4 voAcZ5M5gllo4H822+NaDZN1ln0a76yLBK7yJITO6lCsJ08nCasgXTYBUlYET6MHeT csux4KwOIaaLdDm7FXBLim6gCIJQ9VYVrnZi6p02BkWoWkVWrOQTHGULQQ4LTih+AD 0LRYd088p7F6ongtuiGRE36UnlxVu+ETwGVI+ZP4UWiFRtdXNbEc965npGWQp/ecGH Y5UlutY8qFE4A== Date: Thu, 13 Oct 2022 19:04:27 -0700 From: Mark Gross To: Sebastian Andrzej Siewior Cc: Mark Gross , LKML , linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Danie l Wagner , Tom Zanussi , Clark Williams , Junxiao Chang Subject: Re: [ANNOUNCE] 4.9.327-rt197 Message-ID: References: <165222469651.210737.17409564443317121708@T470> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 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 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 Fri, Sep 30, 2022 at 04:58:41PM +0200, Sebastian Andrzej Siewior wrote: > On 2022-09-23 13:09:41 [-0700], Mark Gross wrote: > > > As this was a tricky one I request people to give a good look over. > > You did good. I not so much. If you could please add the following patch > on top, then it will compile also on !RT. > > Thank you for work. > > ------->8---------- > > From: Sebastian Andrzej Siewior > Date: Fri, 30 Sep 2022 16:55:34 +0200 > Subject: [PATCH] local_lock: Provide INIT_LOCAL_LOCK(). > > The original code was using INIT_LOCAL_LOCK() and I tried to sneak > around it and forgot that this code also needs to compile on !RT > platforms. > > Provide INIT_LOCAL_LOCK() to initialize properly on RT and do nothing on > !RT. Let random.c use which is the only user so far and oes not compile > on !RT otherwise. > > Signed-off-by: Sebastian Andrzej Siewior > --- > drivers/char/random.c | 4 ++-- > include/linux/locallock.h | 5 +++++ > 2 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/char/random.c b/drivers/char/random.c > index daea466812fed..86c475f70343d 100644 > --- a/drivers/char/random.c > +++ b/drivers/char/random.c > @@ -236,7 +236,7 @@ struct crng { > > static DEFINE_PER_CPU(struct crng, crngs) = { > .generation = ULONG_MAX, > - .lock.lock = __SPIN_LOCK_UNLOCKED(crngs.lock.lock), > + .lock = INIT_LOCAL_LOCK(crngs.lock), > }; > > /* Used by crng_reseed() and crng_make_state() to extract a new seed from the input pool. */ > @@ -515,7 +515,7 @@ struct batch_ ##type { \ > }; \ > \ > static DEFINE_PER_CPU(struct batch_ ##type, batched_entropy_ ##type) = { \ > - .lock.lock = __SPIN_LOCK_UNLOCKED(batched_entropy_ ##type.lock.lock), \ > + .lock = INIT_LOCAL_LOCK(batched_entropy_ ##type.lock), \ > .position = UINT_MAX \ > }; \ > \ > diff --git a/include/linux/locallock.h b/include/linux/locallock.h > index 0c3ff5b23f6a1..70af9a177197e 100644 > --- a/include/linux/locallock.h > +++ b/include/linux/locallock.h > @@ -22,6 +22,8 @@ struct local_irq_lock { > unsigned long flags; > }; > > +#define INIT_LOCAL_LOCK(lvar) { .lock = __SPIN_LOCK_UNLOCKED((lvar).lock.lock) } > + > #define DEFINE_LOCAL_IRQ_LOCK(lvar) \ > DEFINE_PER_CPU(struct local_irq_lock, lvar) = { \ > .lock = __SPIN_LOCK_UNLOCKED((lvar).lock) } > @@ -256,6 +258,9 @@ static inline int __local_unlock_irqrestore(struct local_irq_lock *lv, > > #else /* PREEMPT_RT_BASE */ > > +struct local_irq_lock { }; > +#define INIT_LOCAL_LOCK(lvar) { } > + > #define DEFINE_LOCAL_IRQ_LOCK(lvar) __typeof__(const int) lvar > #define DECLARE_LOCAL_IRQ_LOCK(lvar) extern __typeof__(const int) lvar > > -- > 2.37.2 > > > Sebastian Thanks! I've applied this and starting some testing. I've also pushed the update to v4.9-rt-next if anyone feels like giving a spin before I make the release. I think I'll finally get the release done in the next few days. --mark