Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp56377pxt; Wed, 4 Aug 2021 05:55:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhUMUDv0XUDsF6uZcbzgRlMnc6s7sCakX1loB9bAufarR9qpVxsF4/KKySRcgnxB9lRSEl X-Received: by 2002:a17:906:2c45:: with SMTP id f5mr24980198ejh.464.1628081746347; Wed, 04 Aug 2021 05:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628081746; cv=none; d=google.com; s=arc-20160816; b=e6Q9kSE6tiHv8hhyAJxObP2eFEinsnOqs3zkF4VNcHHswtBssl0vhF7WoTYL+7b2pY o8iA9+77QVIiTgLAjyOjWXkN5N5vji50U83A5HBGmREOIXvOQkT6iZF3rbvasDL+5aKv 404x11nfz+66VM0DQIz6DUYpVOZwqMtv/YC4wC3evEPAWb6rZeJE2Bchm5fzW0gVLZc/ 8uZaHDVqfgsqf2AcZn3ba+rEo5q1LltPAU2AlFC29I1yrzjqwaLMW3w2TC46ZGV0Cthq aHHVme1JH754Z8norYWgJaVKb8dh5p30HEDarnW8n7LJik/azbY8lyY3qrZ0d0sCaSSb Ch3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:mime-version :in-reply-to:subject:cc:to:from; bh=gePCxnVemqdDYauuypaxnddAyFGcCZli3AozQnp/dhE=; b=Tw/8I+tZ8exsURW+lHzynVdQPuYznPf4l0QIVfZp+RPsf/ZPUzXyyW9YrX19Z8tLZG LZjpE03tjaAG87lJ0ICnB80Jv9hFGds9sE/V0gXFCprheWxeRhYgt/42IGhpT7ggDyS1 2myqQQLST3TlBASVN0+HmjHxKm5KZmXRVchIDjKEo1NZAGdoxW3HnEjElRKgLzdJgDcB zTxEJWzNgAK+BaJt0jmZGHj809CBYhEOPAjBhYdbtaJb4gq4TjuteOy7xv3hZffw1nZT XpMd1ksEwyBpYhcxsuRu7HTS4ifdEy0DmZCZC1SXPstAFjd1pa5MMqk0gblD2SzCjdxf /N1w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si1950231edw.170.2021.08.04.05.55.20; Wed, 04 Aug 2021 05:55:46 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237124AbhHDKR4 (ORCPT + 99 others); Wed, 4 Aug 2021 06:17:56 -0400 Received: from foss.arm.com ([217.140.110.172]:58778 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235527AbhHDKRz (ORCPT ); Wed, 4 Aug 2021 06:17:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 820A713A1; Wed, 4 Aug 2021 03:17:42 -0700 (PDT) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 60F853F66F; Wed, 4 Aug 2021 03:17:40 -0700 (PDT) From: Valentin Schneider To: paulmck@kernel.org Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, linux-rt-users@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Steven Rostedt , Daniel Bristot de Oliveira , Frederic Weisbecker , Josh Triplett , Davidlohr Bueso , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Scott Wood , Sebastian Andrzej Siewior Subject: Re: [PATCH 1/2] rcutorture: Don't disable softirqs with preemption disabled when PREEMPT_RT In-Reply-To: <20210803234352.GX4397@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain References: <20210803225437.3612591-1-valentin.schneider@arm.com> <20210803225437.3612591-2-valentin.schneider@arm.com> <20210803234352.GX4397@paulmck-ThinkPad-P17-Gen-1> Date: Wed, 04 Aug 2021 11:17:33 +0100 Message-ID: <87v94la4zm.mognet@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Cc Scott, Sebastian On 03/08/21 16:43, Paul E. McKenney wrote: > On Tue, Aug 03, 2021 at 11:54:36PM +0100, Valentin Schneider wrote: >> Running RCU torture with CONFIG_PREEMPT_RT under v5.13-rt1 triggers: >> >> [ 10.821700] DEBUG_LOCKS_WARN_ON(this_cpu_read(softirq_ctrl.cnt)) >> [ 10.821716] WARNING: CPU: 5 PID: 137 at kernel/softirq.c:173 __local_bh_disable_ip (kernel/softirq.c:173 (discriminator 31)) >> [ 10.821739] Modules linked in: >> [ 10.821749] CPU: 5 PID: 137 Comm: rcu_torture_rea Not tainted 5.13.0-rt1-00005-g08bbda29766a #129 >> [ 10.821759] Hardware name: ARM Juno development board (r0) (DT) >> [ 10.821765] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--) >> [ 10.821938] Call trace: >> [ 10.821941] __local_bh_disable_ip (kernel/softirq.c:173 (discriminator 31)) >> [ 10.821950] rcutorture_one_extend (./include/linux/rcupdate.h:274 ./include/linux/rcupdate.h:737 kernel/rcu/rcutorture.c:1443) >> [ 10.821960] rcu_torture_one_read (kernel/rcu/rcutorture.c:1590 kernel/rcu/rcutorture.c:1638) >> [ 10.821968] rcu_torture_reader (kernel/rcu/rcutorture.c:1730) >> [ 10.821976] kthread (kernel/kthread.c:321) >> [ 10.821986] ret_from_fork (arch/arm64/kernel/entry.S:1005) >> [ 10.821997] irq event stamp: 478635 >> [ 10.822001] hardirqs last enabled at (478635): _raw_spin_unlock_irq (./arch/arm64/include/asm/irqflags.h:35 ./include/linux/spinlock_api_smp.h:168 kernel/locking/spinlock.c:202) >> [ 10.822016] hardirqs last disabled at (478634): __schedule (kernel/sched/core.c:5154 (discriminator 1)) >> [ 10.822029] softirqs last enabled at (478626): __local_bh_enable_ip (./arch/arm64/include/asm/irqflags.h:85 kernel/softirq.c:262) >> [ 10.822040] softirqs last disabled at (478622): rcutorture_one_extend (./include/linux/bottom_half.h:19 kernel/rcu/rcutorture.c:1441) >> >> Per this warning, softirqs cannot be disabled in a non-preemptible region >> under CONFIG_PREEMPT_RT. Adjust RCU torture accordingly. >> >> Signed-off-by: Valentin Schneider >> --- >> kernel/rcu/rcutorture.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c >> index 6096a7d14342..680f66b65f14 100644 >> --- a/kernel/rcu/rcutorture.c >> +++ b/kernel/rcu/rcutorture.c >> @@ -1537,6 +1537,8 @@ rcutorture_extend_mask(int oldmask, struct torture_random_state *trsp) >> * them on non-RT. >> */ >> if (IS_ENABLED(CONFIG_PREEMPT_RT)) { > > This depends on some rcutorture patches in -rt that are not yet in > -rcu. Would -rt be a good place for this one, or are those patches > now ready for -rcu? > Right, this goes along with 72d6f4f680bf ("rcutorture: Avoid problematic critical section nesting on RT") (from v5.13-rt1), which seems to apply cleanly on top of the current mainline. So if we want this to go straight into -rcu, the above needs to go along with it. Thomas et al, any objections? > Thanx, Paul > >> + /* Can't disable bh in atomic context under PREEMPT_RT */ >> + mask &= ~(RCUTORTURE_RDR_ATOM_BH | RCUTORTURE_RDR_ATOM_RBH); >> /* >> * Can't release the outermost rcu lock in an irq disabled >> * section without preemption also being disabled, if irqs >> -- >> 2.25.1 >>