Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1905590ybh; Thu, 23 Jul 2020 22:36:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/ZZ3EzLRV4dAv4psun4P/V5IRBkn7/wArCPQvhLOXkLUS5l4wNxdkiMhwHFCH4K7iN5dN X-Received: by 2002:a17:906:a1c7:: with SMTP id bx7mr7427437ejb.388.1595569002565; Thu, 23 Jul 2020 22:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595569002; cv=none; d=google.com; s=arc-20160816; b=vqod/Pl/xWBybBq8h7sR4JIKQ2tfqwjquGDQkC3PsEFKnkm9hikxk3W+UtyuOCppNy 1a95zSSUEXwfp4vTVwfs8JvtXofC4hPn/3b2GOenwhBUvhhO5V4a6u81mZJM7g/CnhgJ N37Ne1SCSNds/cbTswIcC8ST6FFSZR5v86vppt0iSJPjI3diyxEeNAMp1kdIJxyAESBf 2GfEbYUlHAer+tEyVi858AxMKZ5dfTJo0ltAni9yJjH/m507BA9q8hOHNHlg3C4Arex4 od7Szi2yaWN4gmD85zyUsK63mljQsEGSNN5HviiJukABMOfIa2OuqNvO9SfndCeUQR/O krZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=EpP1x6fpBcJRRTFRXnW5L0tvhqkIz94dWPm8oCXCSGg=; b=Wi3gWEJ7UdUmrzTrTSWxHq/GjjU+7oUFmCB3HXxJ5Jwr1Bpt7FBS34n8OJfOQoKPD3 zqOueuGy0E1QHUUbDS1m0Y1ZHymatSEjNAmvd4/ZcGC6j8wquCP7nEdcA+qpwyADJkAX BnMUTHyEjg4aKnMUcZoS59zYj4ffQ8IjssAnemTSFxxtBjg3w9PidHc2BEuC8JERsiNK dWDY6A1hhAgCnrOJAV0KF6MhYCRz2d/r4IiGMv1woKHDaqUCOIXsEHIXVEfy/eq0rr/+ 8hf6maQCoQ9l2nD8Q6Qsc8JS1mh6MbO12/3ZcAc6jb0HESYvNB4uIABs3ry2vk9+2/t1 HXYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TnFXeLiZ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gw16si2994929ejb.274.2020.07.23.22.36.19; Thu, 23 Jul 2020 22:36:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TnFXeLiZ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726625AbgGXFf3 (ORCPT + 99 others); Fri, 24 Jul 2020 01:35:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbgGXFf3 (ORCPT ); Fri, 24 Jul 2020 01:35:29 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6523CC0619D3 for ; Thu, 23 Jul 2020 22:35:29 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id c25so6132032otf.7 for ; Thu, 23 Jul 2020 22:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=EpP1x6fpBcJRRTFRXnW5L0tvhqkIz94dWPm8oCXCSGg=; b=TnFXeLiZoPhmCJGn8MBfTPcOm2/alOEcWuJYiXGsR74hLyq8npnNYkfGYGbkbfwgqU NysP9hCDCaYUcSwSda/DO1KqMRNq0vB/6jFQI/OqnqT/ZOuMxKkiAYUBC5WOBddI9m5v Cz8hML9K27X9jN9kBfbzNpvYMuWvCxYRnsZkPUxEBlBvgunagLSs0G/7CVEyzcmYABBC JU/8JzAYYydFd+IQMbV8ews2kyd0hdKCEQFnEsU2qpBALoRmiFzgDNYEJ7fEJ2GiRRuM aYWTJUu4e8sRyFhycyURKVNuYmp9QAVdG5HPmniDK7mZLZNJZ4RpFc+g7ajDULqsyBSs N9dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EpP1x6fpBcJRRTFRXnW5L0tvhqkIz94dWPm8oCXCSGg=; b=ZW8tjx19LAzqzk/ZKL/w7niILDINQqoVRUh5mFI8LSvQtYfewOrgwqr3t3i7KlUE4D 2w2G/OyoxwdHwzvuDveHHjqV8SqH4KXctKWcRdkm1S7mMuGeWg0SamOnSA+bSuyUYunY O5XrkozxYA0MzGvtU5KDU+mOdzpLXzPqyujWY+B4qJ2dfLg2uy2I+2kbvrQU91uhgAlU AvLQxx4JB8G2jAh6/mK+ZafHFNRR++gG+jEi5o3Z1e9RyDTGJQLKE3LiqbFbIK75TF2U C7WTU/hu8QQ3DSrIiRmpKYQuahoDPZxxs/yJLJPpAiZQD/aAckn/40CEPWnJ8XCvx7r6 fQaQ== X-Gm-Message-State: AOAM530jBee9Stt3ffwXcW+v/W/290VNvc4GEnhx2iKKRmxGdxV/Gs6e C0abiVpTbRWIZjUH3OOtHZwuza9RWXrlomVW/EQ= X-Received: by 2002:a05:6830:1ad7:: with SMTP id r23mr6902936otc.96.1595568928812; Thu, 23 Jul 2020 22:35:28 -0700 (PDT) MIME-Version: 1.0 References: <20200723091715.GL19262@shao2-debian> <87v9iexztl.fsf@nanos.tec.linutronix.de> <874kpyxpro.fsf@nanos.tec.linutronix.de> In-Reply-To: <874kpyxpro.fsf@nanos.tec.linutronix.de> From: jun qian Date: Fri, 24 Jul 2020 13:35:17 +0800 Message-ID: Subject: Re: [Softirq] a76eadba0d: WARNING:at_net/mac80211/rx.c:#ieee80211_rx_napi[mac80211] To: Thomas Gleixner Cc: kernel test robot , peterz@infradead.org, will@kernel.org, luto@kernel.org, linux-kernel@vger.kernel.org, Uladzislau Rezki , Yafang Shao , lkp@lists.01.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 23, 2020 at 10:35 PM Thomas Gleixner wrote= : > > jun qian writes: > > On Thu, Jul 23, 2020 at 6:58 PM Thomas Gleixner wr= ote: > >> That drops everything which has not yet been processed and the above > >> warning is due to this. > >> > > wow, I made a mistake, thank you for finding the cause of the problem > > so quickly. > > > > How about the following code. we need to clear the corresponding > > pending bit at the > > right time Instead of all the pending bits cleared in the start. > > > > pending =3D softirq_pending(); > > > > while ((softirq_bit =3D ffs(pending))) { > > > > pending >>=3D softirq_bit; > > > > set_softirq_pending(pending); //Only clear the corresponding > > bit which will be processed. > > How is that supposed to be correct. pending has been shifted > right. Something like this should work: > > h++; > pending >>=3D softirq_bit; > > if (timeout()) { > /* > * Ensure that the remaining pending bits > * are handled. > */ > or_softirq_pending(pending << (vec_nr + 1)); > break; > } > } > > Thanks, > > tglx > I have two questions that need to be discussed. 1. If the __do_sofrirq() is executed in the ksoftirqd, we may not need to check the timeout in the loop. 2. Both the invoke_softirq() and run_ksoftirqd() will execute __do_sofirq, they all execute the same code=EF=BC=8C when it is in the ksoftirqd, Do we need to wake up ksoftirqd in the process context according to max_restart and MAX_SOFTIRQ_TIME. In my opinion, If we use a flag to distinguish where __do_softirq() is called from, we can do what is most suitable for __do_softirq based on this flag.