Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp260939rwb; Tue, 6 Dec 2022 20:47:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf6AmtMHw/cWJkjIX4YI9ZCSf7Brq2g3A0ocn2tpneAbex7SJAN/YwQb8RkWd90wTU3Eb1pe X-Received: by 2002:a17:906:3a41:b0:78d:9caa:31b7 with SMTP id a1-20020a1709063a4100b0078d9caa31b7mr63591043ejf.263.1670388477140; Tue, 06 Dec 2022 20:47:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670388477; cv=none; d=google.com; s=arc-20160816; b=iGj+EzuK4yEBkDXO9gaKCMmxUPkPoCDF+SrNZISho40nsoCIM6bGMAmirfAhxNj6kt 1H0EM0fyFfRjnGpHAQHIr6M5qrxC1XhgVact2uOH7fTO6eP6dK+mCfc1cCuAUZ3pPa3o 9kR81/y/Hk9WrQAgZyIv3C0cj/ggoBVY1PW6hpkM7jfJwHxKyW/DMAXqAPMohxdqx5O6 qZykHghYRFEZFkVYXFlW5XOLno6VZXDT5pX2rA252ha7BpmBK6ZVc+RtvLGfyTxhqLl7 d87NjD0AHvbQW4uPeD80X+rjKgKrR3iFRJZkCEgZhBdhVriu4LtRbJj3j2fwsyh/v4Hz VxQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=F5h7Cv0RjPXdNNZyKlOE6btkcLtkzPv4AAPlrxmAsO0=; b=g066f7GrDfftbxPCgOkRDrEN8yNqzfKc8pgedP9W6makoGlEaR9LVlVRjIbcsaxzr8 KvccKzGg8dEDYYnTiREXF+AihVkbLPHflN3V7PJWQQ42LpXnzpZ7EpPN0h8SnTyEDwzD QRqhFJcXYCg8Fu4QWRy/rftyeRGKOFbGTiywxqYzVfEftkEZ7brqDO2WWT9S86jiKLQt mrxCsl1ZAJ+tInwLRjE/rNhGvJmBcA6HKCFK7am00Ly3qKJjIZOVrKG18Dj/6cJ7pGQw hOR4Nnp+KcJDhzwrshXQaww8kWqtkb7Ye9wRg0f96llJDi1QtfJvuQW4pDjpxehbjVh2 ZwSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb10-20020a1709071c8a00b007a9d456583bsi16876638ejc.62.2022.12.06.20.47.36; Tue, 06 Dec 2022 20:47:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbiLGEl1 (ORCPT + 66 others); Tue, 6 Dec 2022 23:41:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbiLGElY (ORCPT ); Tue, 6 Dec 2022 23:41:24 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F11356EDC for ; Tue, 6 Dec 2022 20:41:22 -0800 (PST) Received: from dggpemm500007.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NRl2k3YmJzRplj; Wed, 7 Dec 2022 12:40:30 +0800 (CST) Received: from [10.174.178.174] (10.174.178.174) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 7 Dec 2022 12:41:20 +0800 Subject: Re: [PATCH resend 1/3] rtlwifi: rtl8821ae: don't call kfree_skb() under spin_lock_irqsave() To: Ping-Ke Shih , "kvalo@kernel.org" CC: "linux-wireless@vger.kernel.org" , References: <20221206131249.2181693-1-yangyingliang@huawei.com> <20221206131249.2181693-2-yangyingliang@huawei.com> <758b8caa9e8243bb84471baf50706e6d@realtek.com> <1bbd83a4cd6f48e5878c256c3e8f6334@realtek.com> From: Yang Yingliang Message-ID: <0fa6cc09-80b6-94bc-6d0a-dffacf896617@huawei.com> Date: Wed, 7 Dec 2022 12:41:19 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1bbd83a4cd6f48e5878c256c3e8f6334@realtek.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.178.174] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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-wireless@vger.kernel.org On 2022/12/7 11:52, Ping-Ke Shih wrote: >> -----Original Message----- >> From: Yang Yingliang >> Sent: Wednesday, December 7, 2022 11:44 AM >> To: Ping-Ke Shih ; kvalo@kernel.org >> Cc: linux-wireless@vger.kernel.org; yangyingliang@huawei.com >> Subject: Re: [PATCH resend 1/3] rtlwifi: rtl8821ae: don't call kfree_skb() under spin_lock_irqsave() >> >> >> On 2022/12/7 11:31, Ping-Ke Shih wrote: >>>> -----Original Message----- >>>> From: Yang Yingliang >>>> Sent: Tuesday, December 6, 2022 9:13 PM >>>> To: Ping-Ke Shih ; kvalo@kernel.org >>>> Cc: linux-wireless@vger.kernel.org; yangyingliang@huawei.com >>>> Subject: [PATCH resend 1/3] rtlwifi: rtl8821ae: don't call kfree_skb() under spin_lock_irqsave() >>>> >>>> It is not allowed to call kfree_skb() from hardware interrupt >>>> context or with interrupts being disabled. So add all skb to >>>> a free list, then free them after spin_unlock_irqrestore() at >>>> once. >>> The patch doesn't change logic, so it should work. But, I would like to know >>> if there is a comment about this in kernel code. Could you point it out? >> You can see comment of dev_kfree_skb_irq() in include/linux/netdevice.h >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/netdevice.h?h=v6 >> .1-rc8 >> > It seems like we can replace kfree_skb() by dev_kfree_skb_irq(), right? > But your method is more efficient. Is that your point? Yes, the SKBs have already been dequeued from the queue, so they can be freed together at once. Thanks, Yang > > Ping-Ke >