Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2619346pxb; Tue, 9 Mar 2021 07:02:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxFiItpd4t95PXQqwvVRoI8O2PyFD+eudzdjdaXK77wu6nqItBiOlLTm3N8cIJghweR+cW X-Received: by 2002:a17:906:ecfb:: with SMTP id qt27mr20246190ejb.245.1615302129897; Tue, 09 Mar 2021 07:02:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615302129; cv=none; d=google.com; s=arc-20160816; b=c4LtkVUNzKwqaVQk+a5FTXOZszxWuWf/6X/Y0ljd89n5e5HTtmadLfg0H/eKo3tFrM sX3XoeZr40XV71Ua/H3x/56JkDkroZ8ujvGzpQT2GyRNx3Bvu20Q9+fmQMmzXeWypKTv Y7FgLEt0YS8+6xRNgMI5Wm/FDnjVhZM6GykXoc8Rkbo++zsYNw7uDl3Op+7TQTS6YU20 SBimEVaMZIdCA8UFW/KDhtqF20D4X+CI1fzARlh3uN5fD+OZvhc2+whIvzW18dKElUfI 9yRUrqQ3OVFWrtNO8kmndbP3D4NZ64CRIdbn0uOZCgrdut+8eTSK2m0mEx9F5mi/i7Wd 04ew== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=haCuMwx8FBtsuLInyU0TMFS1G8sa0cBWrU6Q5la2tOA=; b=OWt0svsPo/8nkBriMCPseIkS6vV2/ptfQYhrNX0mlvFwmxR9BjSHNKM7Cm6TzxfAMt f8zYaRbCtrMkf05Ppu2wsv6z7AbJUNHpEvk3BBWbiHWx3dM7Twmds5ZAYSqmKXxbRsGQ rsrAMr+9Ef+lS7Bv/gDbAy07vfRLVeYsWlIBdEiHFCE5BvsjxXoAbcVFolE2Bv0Nxzqq HlF+uuKID7vxUibRjJFqh/uwKmwkzp2BCvIl8FbBC6CoQMcasOLH7kBK7GSNI6FZDiMw sdm/54RG0hicD5CU4KmfWw5pSI5UtN/6bAZ5dPrFlFHDtWYte79jP9ioqTGF3z+wXZEH 4YeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vH0moSht; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si9350234ede.125.2021.03.09.07.01.44; Tue, 09 Mar 2021 07:02:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@linutronix.de header.s=2020 header.b=vH0moSht; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231634AbhCIPBL (ORCPT + 99 others); Tue, 9 Mar 2021 10:01:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230081AbhCIPAk (ORCPT ); Tue, 9 Mar 2021 10:00:40 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5761DC06174A; Tue, 9 Mar 2021 07:00:40 -0800 (PST) Date: Tue, 9 Mar 2021 16:00:36 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1615302037; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=haCuMwx8FBtsuLInyU0TMFS1G8sa0cBWrU6Q5la2tOA=; b=vH0moShtrJeVtgZbD1r78tLDx6XyHNucm18W4J8xUPHPmOCt+SaGkcqKZylD1Qa5mH12bh A2+mOteZI/nNJsKT9iKJgpJ+aVtKE4tBYkQh5vJpdwdOFoiUE+UJzLs7NJgbXGRKavYn/N u2ss3f1E4gTQiTD7bk9wixljV0fV/2I1hOjh9r1OgCgT/hPzvnbP0fusQY4P7UJl9s1I8B 4YAGxejRc6417ftT5uJHJt6DLO6/1El7SxvgnKwfB3G7RlqGqqIwbuQTcKLw2R/GXvi5eL i9WMaaRTrNt1brpUNBx6gw/ITgR/5P7H6v3aOt/pY6etzq1u4bfg6TnivVfjNA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1615302037; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=haCuMwx8FBtsuLInyU0TMFS1G8sa0cBWrU6Q5la2tOA=; b=M+xMQLgZ+XsqwI3AcUt4aNUAkVhpNvp/fR0QYs1Y07eFdMeH0URMLccm8FWUT+O3EnE0N2 Yn88FQVAn7gnR4CQ== From: Sebastian Andrzej Siewior To: Thomas Gleixner Cc: LKML , Frederic Weisbecker , "Ahmed S. Darwish" , Peter Zijlstra , Denis Kirjanov , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, ath9k-devel@qca.qualcomm.com, Kalle Valo , linux-wireless@vger.kernel.org, Chas Williams <3chas3@gmail.com>, linux-atm-general@lists.sourceforge.net, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, Stefan Richter , linux1394-devel@lists.sourceforge.net Subject: Re: [patch 07/14] tasklets: Prevent tasklet_unlock_spin_wait() deadlock on RT Message-ID: <20210309150036.5rcecmmz2wbu4ypc@linutronix.de> References: <20210309084203.995862150@linutronix.de> <20210309084241.988908275@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20210309084241.988908275@linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2021-03-09 09:42:10 [+0100], Thomas Gleixner wrote: > tasklet_unlock_spin_wait() spin waits for the TASKLET_STATE_SCHED bit in > the tasklet state to be cleared. This works on !RT nicely because the =E2=80=A6 Could you please fold this: diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 07c7329d21aa7..1c14ccd351091 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -663,15 +663,6 @@ static inline int tasklet_trylock(struct tasklet_struc= t *t) void tasklet_unlock(struct tasklet_struct *t); void tasklet_unlock_wait(struct tasklet_struct *t); =20 -/* - * Do not use in new code. Waiting for tasklets from atomic contexts is - * error prone and should be avoided. - */ -static inline void tasklet_unlock_spin_wait(struct tasklet_struct *t) -{ - while (test_bit(TASKLET_STATE_RUN, &t->state)) - cpu_relax(); -} #else static inline int tasklet_trylock(struct tasklet_struct *t) { return 1; } static inline void tasklet_unlock(struct tasklet_struct *t) { } diff --git a/kernel/softirq.c b/kernel/softirq.c index f0074f1344402..c9adc5c462485 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -830,8 +830,8 @@ EXPORT_SYMBOL(tasklet_init); =20 #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) /* - * Do not use in new code. There is no real reason to invoke this from - * atomic contexts. + * Do not use in new code. Waiting for tasklets from atomic contexts is + * error prone and should be avoided. */ void tasklet_unlock_spin_wait(struct tasklet_struct *t) { --=20 2.30.1