Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3446066pxb; Wed, 14 Apr 2021 05:54:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTlBsVUVSCb7dy/XwLfkKuvUuJu2Si1v0aO5+a3YY7ozttEByFZ4ilipJWQTid781yRxan X-Received: by 2002:a17:90a:b891:: with SMTP id o17mr3573069pjr.180.1618404888382; Wed, 14 Apr 2021 05:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618404888; cv=none; d=google.com; s=arc-20160816; b=D6mwx28XCWz9i22sgZg4Zdh+QpeKfMXp/JbeIBU8VwQ3G6uxS0iGcE7BB75OVMwnPI Tcxu69WF5LfCDg5HxECppqemvts7sk0hJFXoPD0QTj0hp3I5TCSBw387I3f7O1TO+g4s /Xf+ILTWbXsqcpP1WhE88NH0teO/HLqYGUVPHbRBL/zsk6rKkmEPRXYmMgh5fiRH//qx zkYR7uWMB13U32wnBf9JXa5lrdZ/Y/fHKLwMuGYMgUPg96QW6wEGOzSMv/PI5VeKCflZ 5BjdNUPkSmbfMym80Fz/LT79YAdvfv9ncWKEjIfIjdT7z4K7R9AiUVIroUnpyIjZSM8w S6bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pfXneJvz0C/vmR/s1WVupLiCXqI05TupW72jk8dT3HE=; b=Yuj1UxTTyY7f9AlRo/7ugv6HmWL5SQEE2uw52lAKrxfu9wlz+q2E+m22nh6t9Vafqj A1VyNyCTCJKgho/F0bVi7XxsqEcFSHi588R7wcUot1SC0pIngL9CxFr0HdKJ2yEJQ/oD hgYehfajC8qAfjOZZi8Bzd3leRjbwS6qc7l9fMormGYt7vPm7iZ9nBSzJYXCwYbBEUS5 TE8wVPXYFuBKTXeyy9/q3tQ0dIu7YX0mkzPiHwvDb5gWzVHq3Mp84MLqTjv8fm9EjHS+ cElzRVy8bCCz5kX4ED94wBnwT2WJrIyMZsuOskP3ECMoziiZPRMjk0xrr/FUySpeAboZ WziA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=f6G9Sp2y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 205si15366715pfb.183.2021.04.14.05.54.31; Wed, 14 Apr 2021 05:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=f6G9Sp2y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242010AbhDNCtf (ORCPT + 99 others); Tue, 13 Apr 2021 22:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239489AbhDNCte (ORCPT ); Tue, 13 Apr 2021 22:49:34 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F641C061574 for ; Tue, 13 Apr 2021 19:49:14 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id j12so1964779ils.4 for ; Tue, 13 Apr 2021 19:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pfXneJvz0C/vmR/s1WVupLiCXqI05TupW72jk8dT3HE=; b=f6G9Sp2yd9j4jRVXOkFWmU7cr+lF7b3NV6UjUSuCqtz7BfPT90JINGVDjaFXSKu/UA 1SnSQwsYAlfc/9uivJFQGbBP/6v6qKbSLkY8zLf1I7Jc2AZgZ6Lzn6IDZkNctyNSS42g NEA7cxhAi/Jkbfv/SSUfombNU8ETTvAR5gkjEEj+QhYC4FFHDOwd9g/fWO0ksCsQqlXm tKKiNe24tqQMMSwntpN/AyMYHhlokCzXAZopTOuNDndzBWUOhTuzQbd5ny7xHmuxs6PP aJXkcsESndH72wvLLfwf8et6HEV/9noPo5vak8G5Ir+Ow/G3R0dgQGXb/gcxyLkQrvcJ yHhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pfXneJvz0C/vmR/s1WVupLiCXqI05TupW72jk8dT3HE=; b=kTbEDRZ+BJfde/AJZEFgBlSyIlgM7DJxh9kihwrf1ZRysJlxdnpvwg/7D3Yg4Dv5Ke jwTbyBOooE7b5KkbReJGvo+cIHKSaBHwTnjJy+RuBwEgUVTXdiULfpSCtyZU+jCoaqal gF0s2r2aLAQekanuaiNra9sDZ7HTgx8R5bgSwG2L+LYCfL4g8Qu6Y77/mWDGpbLCYxXy 1mQ3k86IQnjA1vb0Dl3XJo7FdDwaJkJocPoyh+JQmRibJwXYad/dH32pz8nmwqarKsxf yf2hJePTS2RmWmg2CiyjoKZksmi12lBRDvDshjYHNiVVj0f83YDSZ4F/ypOB/Ngtjjoc gSjA== X-Gm-Message-State: AOAM531xD3twssKBorR7mJ7PRrhvwUsrzOLZYGrysVJv0k8MW9yjqY7/ mpRi9uJklCBkctxmb9+KNpqsRzinXZTjbe72OcaY5Q== X-Received: by 2002:a05:6e02:2197:: with SMTP id j23mr2481295ila.269.1618368553440; Tue, 13 Apr 2021 19:49:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lorenzo Colitti Date: Wed, 14 Apr 2021 11:49:01 +0900 Message-ID: Subject: Re: [PATCH] hrtimer: Update softirq_expires_next correctly after __hrtimer_get_next_event() To: Greg KH Cc: =?UTF-8?Q?Maciej_=C5=BBenczykowski?= , Ingo Molnar , Anna-Maria Behnsen , lkml , mikael.beckius@windriver.com, Thomas Gleixner , =?UTF-8?Q?Maciej_=C5=BBenczykowski?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 14, 2021 at 2:14 AM Greg KH wrote: > To give context, the commit is now 46eb1701c046 ("hrtimer: Update > softirq_expires_next correctly after __hrtimer_get_next_event()") and is > attached below. > > The f_ncm.c driver is doing a lot of calls to hrtimer_start() with mode > HRTIMER_MODE_REL_SOFT for I think every packet it gets. If that should > not be happening, we can easily fix it but I guess no one has actually > had fast USB devices that noticed this until now :) AIUI the purpose of this timer is to support packet aggregation. USB transfers are relatively expensive/high latency. 6 Gbps is 500k 1500-byte packets per second, or one every 2us. So f_ncm buffers as many packets as will fit into 16k (usually, 10 1500-byte packets), and only initiates a USB transfer when those packets have arrived. That ends up doing only one transfer every 20us. It sets a 300us timer to ensure that if the 10 packets haven't arrived, it still sends out whatever it has when the timer fires. The timer is set/updated on every packet buffered by ncm. Is this somehow much more expensive in 5.10.24 than it was before? Even if this driver is somehow "holding it wrong", might there not be other workloads that have a similar problem? What about regressions on those workloads?