From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B77C2C2D0E4 for ; Mon, 23 Nov 2020 13:45:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3431B206F1 for ; Mon, 23 Nov 2020 13:45:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="z1195u9K"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="K+ehFd6U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3431B206F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kRa4/8SEEKeVVGBHScnAO55MyMY4dRnNB2IFS43D8ME=; b=z1195u9KJopEIumDa5JURUO9H lyCOjL3KVFRUFA2LJQl5l0++jKmaYuuo1V60Di/BEW2gexyu5nMkEcZfsJNrn8cUkVj9hO/u29N0R 4ZK/wPD/lDpgPTODAaJqQa3W/n2Sv5FPXFXKzLPHY2sAofj7D5gq47poFpRelWR6GH9bYaAAV0dJ/ DjV7QGQyHfPZM9gcpC3fq2v0eEPxjfCHr/Gq16oIVqqlNozQ95DN46JiboYDT1x3ATnazcoasRuf5 LYkHd/SWNFzDhVPUMTJ+Hf1nojqrTxpnPHTYJOeXbibdsWwKZ7yQvolgHGtIVkPtWx7t7StxB9DS1 +HjZyVeXQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khC96-0008Rb-GO; Mon, 23 Nov 2020 13:44:44 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khC94-0008Qu-Fi; Mon, 23 Nov 2020 13:44:43 +0000 Received: from localhost (unknown [176.167.152.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0B2AF206F1; Mon, 23 Nov 2020 13:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606139080; bh=P9zQbHB28E6VtYusUFpATLlB1aKLlAxQSqrq/mCm4FA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K+ehFd6USfbS/TljS1tg/RC+MNXIQxsXIXc+xVORBRpWK5OMZqRunsbCJWvMXQuor KDFJIax5mc0aaPeN/c15BVFH2tuZnwaXqQ1i+BgXEeLu1OjJBSAHJ+u0CKbLSlD45Q 2GlZcY3RVfb4H4uRcAcxIKt0VrsnKIWLDUKKugBA= Date: Mon, 23 Nov 2020 14:44:37 +0100 From: Frederic Weisbecker To: Thomas Gleixner Subject: Re: [patch 14/19] softirq: Make softirq control and processing RT aware Message-ID: <20201123134437.GA95787@lothringen> References: <20201113140207.499353218@linutronix.de> <20201113141734.324061522@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201113141734.324061522@linutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_084442_603583_39F66F18 X-CRM114-Status: GOOD ( 18.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , Catalin Marinas , Paul McKenney , Arnd Bergmann , linux-sh@vger.kernel.org, Peter Zijlstra , Richard Weinberger , Sebastian Andrzej Siewior , Valentin Schneider , Jeff Dike , LKML , Yoshinori Sato , "James E.J. Bottomley" , linux-parisc@vger.kernel.org, Marc Zyngier , Russell King , linux-um@lists.infradead.org, Will Deacon , Helge Deller , linux-arm-kernel@lists.infradead.org, Anton Ivanov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Nov 13, 2020 at 03:02:21PM +0100, Thomas Gleixner wrote: > +void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) > +{ > + bool preempt_on = preemptible(); > + unsigned long flags; > + u32 pending; > + int curcnt; > + > + WARN_ON_ONCE(in_irq()); > + lockdep_assert_irqs_enabled(); > + > + local_irq_save(flags); > + curcnt = this_cpu_read(softirq_ctrl.cnt); > + > + /* > + * If this is not reenabling soft interrupts, no point in trying to > + * run pending ones. > + */ > + if (curcnt != cnt) > + goto out; > + > + pending = local_softirq_pending(); > + if (!pending || ksoftirqd_running(pending)) > + goto out; > + > + /* > + * If this was called from non preemptible context, wake up the > + * softirq daemon. > + */ > + if (!preempt_on) { > + wakeup_softirqd(); > + goto out; > + } > + > + /* > + * Adjust softirq count to SOFTIRQ_OFFSET which makes > + * in_serving_softirq() become true. > + */ > + cnt = SOFTIRQ_OFFSET; > + __local_bh_enable(cnt, false); But then you enter __do_softirq() with softirq_count() == SOFTIRQ_OFFSET. __do_softirq() calls softirq_handle_begin() which then sets it back to SOFTIRQ_DISABLE_OFFSET... > + __do_softirq(); > + > +out: > + __local_bh_enable(cnt, preempt_on); You escape from there with a correct preempt_count() but still the softirq executes under SOFTIRQ_DISABLE_OFFSET and not SOFTIRQ_OFFSET, making in_serving_softirq() false. > + local_irq_restore(flags); > +} > +EXPORT_SYMBOL(__local_bh_enable_ip); Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel