Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp363622imi; Thu, 21 Jul 2022 02:26:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tyBMkMysYA6IXGSLCyQ9MPUuzxaH9CAT35TAiDvGc/PUqPbPHygCPvbPcxS3HG0KAIh7Tw X-Received: by 2002:a17:902:ec8a:b0:16c:4baa:a50c with SMTP id x10-20020a170902ec8a00b0016c4baaa50cmr44405360plg.62.1658395599747; Thu, 21 Jul 2022 02:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658395599; cv=none; d=google.com; s=arc-20160816; b=JyhJMq5W919MPOdfREpw/yNNoCTgP7A9sUvZdLqrjz78njE7BvLRCdFP0dUfz7CDY9 8Ne0Hn/FBH1c6OjAUClwMGLDuKbtEB5Sx0Eqb4ibxS1639JDyp1GC7Lbr9WD67fcoeIp jx1W4DTqZw6yP4CvuaIy5VGHWPfZcmkr1xhX4qer8PkboWbLrxE3XM+rjF1EmZ30DSF1 iT7IhAlk7CCuD65ulD2OzZUeM6KWo/YT+n5pCCtJmvSV3eSj4jILUGMvS5uZPs1RnTow Dgdukps7Ov8Huu5DJszobp5m/L30Rzjd7hmlScE52nzP0tmKkbfOAeWcBSVSdlSv68Qn 7h0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=l92/39sSbUwvzIv0VoSnQhSwMH96+fU2aRqSOC3ahjA=; b=PqjeaNVQjwL67jS0OEDRpFEzn731zlucT8Ho5AXt8/xDlbiGYlwlPG5bp9c1ELWtrg eM8pSgMVBaeQinYxAdrxFI4noJjS05dkK5J7tOHBA19BUfJ1nv+3vB2G/OecyhupWAO9 X6wQC2NFxsDLvKhUWBYtqJHnImMNfvXaSW1T1BYDUY2Zb8hwVXDjPyU1OhEozjW6OcRY zuEN2LA+3k3b9beo3ZrNZIJyvKU+O8r2Y+CVxu3D/MY6D66REfHGKVtOzQAwdAqIk5xU 44xklz6m1R7FqcJkOODr2N1Z5CdsmWdvlEVzPDGvHFMY+J6Ka0nYPjW+VWwZ5DR8+Kq2 Jmyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z8-20020a170903018800b0016a629e2f40si2025669plg.161.2022.07.21.02.26.24; Thu, 21 Jul 2022 02:26:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232611AbiGUIws (ORCPT + 99 others); Thu, 21 Jul 2022 04:52:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232592AbiGUIwo (ORCPT ); Thu, 21 Jul 2022 04:52:44 -0400 Received: from ZXSHCAS1.zhaoxin.com (ZXSHCAS1.zhaoxin.com [210.0.225.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 650B77E836; Thu, 21 Jul 2022 01:52:41 -0700 (PDT) Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 21 Jul 2022 16:52:14 +0800 Received: from [10.29.8.21] (10.29.8.21) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 21 Jul 2022 16:52:12 +0800 Message-ID: <154b2167-47f1-4d1e-0cd7-afab25033b76@zhaoxin.com> Date: Thu, 21 Jul 2022 16:52:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] USB: HCD: Fix URB giveback issue in tasklet function Content-Language: en-US To: Oliver Neukum , , , , , , , , , CC: , , , References: <20220721060833.4173-1-WeitaoWang-oc@zhaoxin.com> <09fed539-909a-f274-1a73-428dc7439d69@suse.com> From: "WeitaoWang-oc@zhaoxin.com" In-Reply-To: <09fed539-909a-f274-1a73-428dc7439d69@suse.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.29.8.21] X-ClientProxiedBy: ZXSHCAS1.zhaoxin.com (10.28.252.161) To zxbjmbx1.zhaoxin.com (10.29.252.163) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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-kernel@vger.kernel.org On 2022/7/21 16:00, Oliver Neukum wrote: > > > On 21.07.22 08:08, Weitao Wang wrote: >> Usb core introduce the mechanism of giveback of URB in tasklet context to >> reduce hardware interrupt handling time. On some test situation(such as >> FIO with 4KB block size), when tasklet callback function called to >> giveback URB, interrupt handler add URB node to the bh->head list also. >> If check bh->head list again after finish all URB giveback of local_list, >> then it may introduce a "dynamic balance" between giveback URB and add URB >> to bh->head list. This tasklet callback function may not exit for a long >> time, which will cause other tasklet function calls to be delayed. Some >> real-time applications(such as KB and Mouse) will see noticeable lag. >> > > Hi, > > ow do you know usb_hcd_giveback_urb() will be called in time to process > isoc URBs in time, if you leave them on the list? In fact how do > you be sure it will be called at all? I can see no upper time limit > on that. > > Regards > Oliver > > . If the bh->head list is not empty, patch method will raise a softirq immediately to call work function of every tasklet. Therefore, I think the left URB in bh->head list will be get giveback in time. Thanks weitao