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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78BB5C433FE for ; Tue, 17 May 2022 03:12:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234923AbiEQDMV (ORCPT ); Mon, 16 May 2022 23:12:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234180AbiEQDMU (ORCPT ); Mon, 16 May 2022 23:12:20 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 910BE1D0F6; Mon, 16 May 2022 20:12:17 -0700 (PDT) Received: from canpemm500006.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L2LkP1XzXzhZG6; Tue, 17 May 2022 11:11:41 +0800 (CST) Received: from [10.174.179.200] (10.174.179.200) by canpemm500006.china.huawei.com (7.192.105.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 17 May 2022 11:12:14 +0800 Subject: Re: [PATCH net-next] net: wwan: t7xx: fix GFP_KERNEL usage in spin_lock context To: "Martinez, Ricardo" , Sergey Ryazanov CC: "Devegowda, Chandrashekar" , Intel Corporation , , =?UTF-8?B?SGFpanVuIExpdSAo5YiY5rW35YabKQ==?= , M Chetan Kumar , Loic Poulain , David Miller , Eric Dumazet , Jakub Kicinski , Paolo Abeni , , open list References: <20220514091443.4150162-1-william.xuanziyang@huawei.com> <0b90f4f6-6911-017b-6d37-50354003900e@linux.intel.com> From: "Ziyang Xuan (William)" Message-ID: <0d5e1262-8140-32d2-e589-d29d68ac49a4@huawei.com> Date: Tue, 17 May 2022 11:12:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <0b90f4f6-6911-017b-6d37-50354003900e@linux.intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.200] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500006.china.huawei.com (7.192.105.130) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > > On 5/16/2022 1:36 PM, Sergey Ryazanov wrote: >> Hello Ziyang, >> >> On Sat, May 14, 2022 at 11:57 AM Ziyang Xuan >> wrote: >>> t7xx_cldma_clear_rxq() call t7xx_cldma_alloc_and_map_skb() in spin_lock >>> context, But __dev_alloc_skb() in t7xx_cldma_alloc_and_map_skb() uses >>> GFP_KERNEL, that will introduce scheduling factor in spin_lock context. >>> >>> Replace GFP_KERNEL with GFP_ATOMIC to fix it. >> Would not it will be more reliable to just rework >> t7xx_cldma_clear_rxq() to avoid calling t7xx_cldma_alloc_and_map_skb() >> under the spin lock instead of doing each allocation with GFP_ATOMIC? >> E.g. t7xx_cldma_gpd_rx_from_q() calls t7xx_cldma_alloc_and_map_skb() >> avoiding any lock holding. > > t7xx_cldma_clear_rxq() is a helper for t7xx_cldma_clear_all_qs() which is only called by t7xx_cldma_exception() after stopping CLDMA, so it should be OK to remove the spin lock from t7xx_cldma_clear_rxq(). > OK, I see. Thus we can remove spink_lock and annotate it. > > .