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 X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB04AC432BE for ; Mon, 30 Aug 2021 12:44:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F3EE60F23 for ; Mon, 30 Aug 2021 12:44:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230513AbhH3Mpr (ORCPT ); Mon, 30 Aug 2021 08:45:47 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.24]:23362 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbhH3Mpp (ORCPT ); Mon, 30 Aug 2021 08:45:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1630327484; s=strato-dkim-0002; d=hartkopp.net; h=In-Reply-To:Date:Message-ID:References:To:Subject:From:Cc:Date:From: Subject:Sender; bh=8jY/a4xEDeiJ/QOE6qIwugMLibHCWfle1xnl2xy4Vyc=; b=JZvVuDprz1aCxPTc7La5jgCz0bc0oopG9zpPAidohfCL75knoD2f139kIIcPtqg4p5 ZLVAq05HpRFOmoZwBpd+fNb0pPEU1KxK9HcgYlY6dgUtG24w+1wP3W7WwTBT1IGljpXX A4tW6hAF1IXaLk2iWhfjs5/q3GFVd+vbusvPWgfsVd2w8Q6IRHlqumVBQBwkfU64IvL5 lX80msaySJG/Te8pWx9KIHvm5srdDRLmCmeeNfwxbkt5W2oKogfyM4pIKM51odfzY9DD cv7iKd3Hi1oC2rVe2ZZKrW49/bQ1fWR7YI4bQuwpjC2WYhDSlLEvWKwzKWLEu9eKLna4 hgUg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P2MHfkW8eP4Mre39l357AZT/I7AY/7nT2yrDxb8mjG14FZxedJy6qgO1o3TMaFqTEVR8J8xryV0=" X-RZG-CLASS-ID: mo00 Received: from [192.168.10.137] by smtp.strato.de (RZmta 47.31.0 DYNA|AUTH) with ESMTPSA id Q09fd7x7UCii1jr (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 30 Aug 2021 14:44:44 +0200 (CEST) From: Oliver Hartkopp Subject: Re: AW: AW: AW: [PATCH] can: isotp: omit unintended hrtimer restart on socket release To: Sven Schuchmann , "linux-can@vger.kernel.org" , Marc Kleine-Budde References: <20210618173713.2296-1-socketcan@hartkopp.net> Message-ID: <6f9a3a93-fa0e-f039-6332-5ac0d4064731@hartkopp.net> Date: Mon, 30 Aug 2021 14:44:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-can@vger.kernel.org Hi Sven, On 30.08.21 09:55, Sven Schuchmann wrote: >> but if I compare the candumps I can see: >> with the patch: >> >> (000.000008) vcan0 714 [8] 2F 01 01 01 01 01 01 01 >> (000.000209) vcan0 77E [8] 30 0F 00 AA AA AA AA AA >> (000.000061) vcan0 714 [8] 20 01 01 01 01 01 01 01 >> >> and without: >> >> (000.000004) vcan0 714 [8] 2F 01 01 01 01 01 01 01 >> (000.000069) vcan0 77E [8] 30 0F 00 AA AA AA AA AA >> (000.000017) vcan0 714 [8] 20 01 01 01 01 01 01 01 >> >> sorry, I missed that: Over here the delay seems to be in >> the FC and not in the CF after the FC. This is what is >> different compared to the real hardware. >> >> So to me it seems that the rcu implementation >> has changed on the way from 5.10 to 5.14? > > Just checked with a 5.14.0-rc6 which contains the patch, same result: > > 93 / curr: 143 / min: 129 / max: 200 / avg: 156.2 > 94 / curr: 144 / min: 129 / max: 200 / avg: 156.0 > 95 / curr: 141 / min: 129 / max: 200 / avg: 155.9 > 96 / curr: 171 / min: 129 / max: 200 / avg: 156.0 > 97 / curr: 138 / min: 129 / max: 200 / avg: 155.8 > 98 / curr: 137 / min: 129 / max: 200 / avg: 155.6 > > (000.000011) vcan0 714 [8] 2B 01 01 01 01 01 01 01 > (000.000193) vcan0 77E [8] 30 0F 00 AA AA AA AA AA > (000.000037) vcan0 714 [8] 2C 01 01 01 01 01 01 01 > > So maybe there is something wrong on the rpi? I see a similar difference on my i7-8650U system: "5" without and "65" with the patch. The problem remains to be the added time that is now introduced at socket close time with the rcu_synchronize(). In your script you are waiting for isotprecv process to finally end with: wait $rxpid And that's the expectable effect ... It looks like the script works fine without the 'wait' code (which does not wait for the process removal then). @mkl: I assume we have to live with that increased time at socket close for security reasons, right? Best regards, Oliver ps. Btw IMO a C program is still the better approach here. isotp[send|recv] open/close the sockets for each PDU in the given setup :-/