Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp583214imi; Thu, 21 Jul 2022 07:05:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uoqlsCkS5+C2QK3JlSbR/nUc2OOiWEcCuXRrKmIL8k1xUZxzD/xJSAbOJCdH7hllb6mG90 X-Received: by 2002:a17:906:dc89:b0:72f:1d4f:cea8 with SMTP id cs9-20020a170906dc8900b0072f1d4fcea8mr24894803ejc.654.1658412304897; Thu, 21 Jul 2022 07:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658412304; cv=none; d=google.com; s=arc-20160816; b=KcJX4mhifbGRLnZS1Tq+mEVDYCHu6JIOmh2L2RGHJnaFZxvVamGs6qg4xapP7/samD /pPFaD8vtepWwvCDgIeBiTq9OHrPwQ+CyssLeZ1sNtzNczzkxiVpNjzaQUFFVjPdeUQu r2MpJWm6zper8DmzCIKs1mv2LUNfp8T42n71bsKuya6NHGCFwug9bffRxRTL5sC4s67z ZqtXGWniMHre3PKz6WiIyEHQug1r8Tl62bcK9iQPo0HC8Fr9mR7JnRQAzapm5ci6XQqa PBKewyK7YrBQOERyxyHO4YyrHM0Hdhy4dmAgUWmKf4V271HQyuo83EfaW2ck3cyi9DO3 1yTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HL1ivFiXzCXUeXkXY6TvN7eK6E8AsZjpPD2Gsabzl2U=; b=BQw4J9KO0oKPunq1v413QOxHhcXrlGi6A5/9CWTVXuuQVnFbvaubUaFpEfVCFLeMNA HL49fCiT4hSSTeVBXH6yY54ODLGlFNoRtaIFo80EV7xmSvB+gXqvn9uoBXPZ23qxx98y dIjbnhMG0WIR/a9OeMeuNSgrmaQB3iEOE33/3nEmFjo86vvxqpnvOJYtdzTrbTuuYA6R uBow+CciShP2GjnQPMlzHVqsN2sJo5XPoYvIqXXGwM1UUcmDRUt2eNLdbrLfZapEkH6m t2nlZegqjeT6oXgHYYXHlI+4lAyTyRMpoi5cT8RXjYF+pSHOLXt30sdiRfRAEjTg+1Jq sP7g== 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 co19-20020a0564020c1300b0043a86c4afabsi2174040edb.152.2022.07.21.07.04.37; Thu, 21 Jul 2022 07:05:04 -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 S231168AbiGUNus (ORCPT + 99 others); Thu, 21 Jul 2022 09:50:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231193AbiGUNu2 (ORCPT ); Thu, 21 Jul 2022 09:50:28 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id A1434CE38 for ; Thu, 21 Jul 2022 06:50:23 -0700 (PDT) Received: (qmail 230363 invoked by uid 1000); 21 Jul 2022 09:50:23 -0400 Date: Thu, 21 Jul 2022 09:50:23 -0400 From: Alan Stern To: Weitao Wang Cc: gregkh@linuxfoundation.org, kishon@ti.com, dianders@chromium.org, s.shtylyov@omp.ru, mka@chromium.org, ming.lei@canonical.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, tonywwang@zhaoxin.com, weitaowang@zhaoxin.com, CobeChen@zhaoxin.com, TimGuo@zhaoxin.com Subject: Re: [PATCH] USB: HCD: Fix URB giveback issue in tasklet function Message-ID: References: <20220721060833.4173-1-WeitaoWang-oc@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220721060833.4173-1-WeitaoWang-oc@zhaoxin.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS autolearn=no 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 Thu, Jul 21, 2022 at 02:08:33PM +0800, 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. > > Fix this issue by taking new URBs giveback in next tasklet function call. The patch also replaces the local high_prio_bh variable with a new bh->high_prio structure member. This should be mentioned in the patch description. Alan Stern