Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp475564imn; Tue, 26 Jul 2022 00:21:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tqjPSZ5069LGZ5Z/gpc61UAHlJWFzb+Zf9iShp4uReqcqJupYh934EPXRuFg8dCqQov3yt X-Received: by 2002:aa7:919a:0:b0:52a:eeef:3e65 with SMTP id x26-20020aa7919a000000b0052aeeef3e65mr16048214pfa.15.1658820085447; Tue, 26 Jul 2022 00:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658820085; cv=none; d=google.com; s=arc-20160816; b=vdIh6S1oDNmD/v5gUlF+31uLDfznUhe6pbO3vOPJsUbO8Ir/TXgUVzpqfNcd9nBtWj EBE6+wFWE/eBDaVAC8EFsCQ0H/c7WUsY5l8sUG4AtpV0rUpvHpRVk4FzpCPyWYC4Z6S6 NMh5NMaH+vFFvYRfjnmcc/pcpi4RuLNr0gZUgBSUTdDFSBhSmpG4HKgcDznbAa2r+xTE RwX8KscAOdPB9OyKTBSBVTuXwl9ns1afBgeA0WIPn1Fn/mTQsDdYuOrQzHrM5V3iYUvM rc+6PnMmZAaDV7Nk+IcVKWZxldTFJCPDnO8qIJ4c3aWqEd7k3YJGc9qxPCuV34/FX3ca j7dQ== 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=zSEWO+68FY+JNLr9YD1NJK4J9rHmMU80jOokGMUbI8U=; b=c0y9F4u7JPCoN7qdBeZ8j+36imLA5xpc/dRF9lbONQ5Aq8D6Jbe53COUFSztprsFxO nruuCXuHi2/0inv5Fhvet1oOgeqDSdr/AstoW2/iCLRr0Pgomn5SW6rzPkb3zzS8WLJ5 b8UsF34hJuu3zrkjrAaVfvAK5g5CzBz+h+DsAuloyUjpitKAZeJmZCyjsWi/eoMftJ2+ CvSkEVJVFXm4JmdANejFNzEbo0b+inGvACiEFGe/MIwjoUQj39bNwOomx5plIRetExQI mQjISSuoWe4ZEO+Hm56PEDjANHuAi6TzutE/f6xJhp9yG2NmhzHiiUPgh1BYUtDySUxS mspw== 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 m10-20020a170902d18a00b0016bd892abfesi13699003plb.573.2022.07.26.00.21.10; Tue, 26 Jul 2022 00:21:25 -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 S237942AbiGZGrb (ORCPT + 99 others); Tue, 26 Jul 2022 02:47:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232263AbiGZGr3 (ORCPT ); Tue, 26 Jul 2022 02:47:29 -0400 Received: from ZXSHCAS1.zhaoxin.com (ZXSHCAS1.zhaoxin.com [210.0.225.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D909A1EAFE; Mon, 25 Jul 2022 23:47:26 -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; Tue, 26 Jul 2022 14:47:00 +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; Tue, 26 Jul 2022 14:46:59 +0800 Message-ID: <3f2c941b-94cd-8357-13de-8656486e8cbd@zhaoxin.com> Date: Tue, 26 Jul 2022 14:46:57 +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 v2] USB: HCD: Fix URB giveback issue in tasklet function Content-Language: en-US To: Alan Stern CC: , , , , , , , , , , References: <20220725065251.832087-1-WeitaoWang-oc@zhaoxin.com> From: "WeitaoWang-oc@zhaoxin.com" In-Reply-To: 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/25 21:58, Alan Stern wrote: > On Mon, Jul 25, 2022 at 02:52:51PM +0800, Weitao Wang wrote: > > This is basically okay. Just a couple of small comments... > >> 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. >> Add a member high_prio for structure giveback_urb_bh and replace the local >> high_prio_bh variable with this structure member in usb_hcd_giveback_urb. > > The patch description should do more than say what the new code _is_ -- > we can see that easily enough by reading the patch. The description > should explain _why_ the code was changed. > Okay, I will improve this patch description. >> - /* check if there are new URBs to giveback */ >> + /* giveback new URBs next time to prevent this function from >> + * not exiting for a long time. >> + */ > > Minor stylistic issue: The currently accepted format for multi-line > comments is like this: > This notes will be improved in next patch version also. Thanks for your suggestion. weitao > /* > * Blah blah blah > * Blah blah blah > */ > > Alan Stern > .