Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2146889pxb; Sun, 30 Jan 2022 06:34:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+E9c6pfakyCW00O9x4uTmj/4ZefKOT5wSRvbNwB4DrSl0kQsxZFyvnSkEMqTLGSlBqZju X-Received: by 2002:a17:902:f54b:: with SMTP id h11mr17062966plf.86.1643553272059; Sun, 30 Jan 2022 06:34:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643553272; cv=none; d=google.com; s=arc-20160816; b=jiBnKCZg5/3JQypzHc6M2kwcMCviXRsu3TasbsP3SxFK7qzz0ygnKjFKjoSOKIq/Rh 5qCArL9YoOf+S6s4Kg6xQ0BTqYhYQsoaOfnAuv502cjkSeOYzI5Qdm+yGf6lo1Up5QPn eIu8F8FxYZDZR+ye+Ks3J7nUPhGxG/c/dvzyAgjGIBq1bLdoQDXxhwNiq133jIey/kdO 7fXO8Bp5WkBu5S2T3JYTr3UPBQu6t4y6KfM6Etw5zC9YUxbIN+F5Bjg5Py7bqHsp55rL LVK3QBo+5gBjlQ2NHX+TBo7nNHtZ1RLIEBI/V2L7MIx7PQMAISi5rILrQ4euHYE1N+7r ZV+Q== 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=aGdzmkaHrM78URxDujRsfLZBxjE4KYa/K01UgauB8CU=; b=kM1Eu5A6dFcutajxrNkI+A+FNKenqKgK3f8ywtpnEgtkDboOFc3EgWCjOd3M3FRHHz x0p8hRuvdUKhXXLoRlJI8pWbDt6ze4IpJb9c5z5nB0sGmQEhN66Pd6qINwuNcl7b1v+M oaIK8Brj57e2xHXLO3tREtVqFS21AUHDzJ+I13TYtgsVAJ+8tFkEzCtaxW+j0h464PTH 0l9rcKPOT9IOWA9QmnYwEmMFHiDJ/Jt/zdsOpRHHrw8Ll7OQAvrLOxthBeDXSsb/EWyZ HmilIpR0riv8+KsiCnE7iRhpD1kgVrVxp2XPp783cZQ1Msr4Q5kmnv1Gdvfe4zRevPxR cb4w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v20si12481821pfu.8.2022.01.30.06.33.57; Sun, 30 Jan 2022 06:34:32 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347173AbiA1IHX (ORCPT + 99 others); Fri, 28 Jan 2022 03:07:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237542AbiA1IHW (ORCPT ); Fri, 28 Jan 2022 03:07:22 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A8BDC061714 for ; Fri, 28 Jan 2022 00:07:21 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDMHn-0008MM-VU; Fri, 28 Jan 2022 09:07:12 +0100 Received: from pengutronix.de (unknown [195.138.59.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 1FB97258C1; Fri, 28 Jan 2022 08:07:10 +0000 (UTC) Date: Fri, 28 Jan 2022 09:07:04 +0100 From: Marc Kleine-Budde To: Oliver Hartkopp Cc: "Ziyang Xuan (William)" , davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] can: isotp: isotp_rcv_cf(): fix so->rx race problem Message-ID: <20220128080704.ns5fzbyn72wfoqmx@pengutronix.de> References: <53279d6d-298c-5a85-4c16-887c95447825@hartkopp.net> <280e10c1-d1f4-f39e-fa90-debd56f1746d@huawei.com> <890d8209-f400-a3b0-df9c-3e198e3834d6@huawei.com> <1fb4407a-1269-ec50-0ad5-074e49f91144@hartkopp.net> <2aba02d4-0597-1d55-8b3e-2c67386f68cf@huawei.com> <64695483-ff75-4872-db81-ca55763f95cf@hartkopp.net> <97339463-b357-3e0e-1cbf-c66415c08129@hartkopp.net> <24e6da96-a3e5-7b4e-102b-b5676770b80e@hartkopp.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="okf44ik46sxcmcxb" Content-Disposition: inline In-Reply-To: <24e6da96-a3e5-7b4e-102b-b5676770b80e@hartkopp.net> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --okf44ik46sxcmcxb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 28.01.2022 08:56:19, Oliver Hartkopp wrote: > I've seen the frame processing sometimes freezes for one second when > stressing the isotp_rcv() from multiple sources. This finally freezes > the entire softirq which is either not good and not needed as we only > need to fix this race for stress tests - and not for real world usage > that does not create this case. Hmmm, this doesn't sound good. Can you test with LOCKDEP enabled? >=20 > Therefore I created a V2 patch which uses the spin_trylock() to simply dr= op > the incomming frame in the race condition. >=20 > https://lore.kernel.org/linux-can/20220128074327.52229-1-socketcan@hartko= pp.net/T/ >=20 > Please take a look, if it also fixes the issue in your test setup. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --okf44ik46sxcmcxb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmHzpCUACgkQqclaivrt 76keTwf8DTeqV+BuWMfRr0sG/Kf+YqVkvDMJEAp9BOhrDmAB6eGQJT+NMkuSbxTm gSKhG19jokryR+ASqS6HEyO9AOa/A+bRi10fB2rGaL8dh0uuOgLkQ0SavIF3cmRg ngWB0m8SpNuNXsVlC9sW3+oS8wAZWRq4Rqm17oT+clPWfkWOCYK4cYa8kgggUJxr Wv6T88+Px5s6A5T1vJuWgmdpor+kRwd8XqQAuo5Co/FSS+9/8XDqTCeojq78I0Rj 4U1GqShTYups/UBgAQbQ8my8hg2YKVtcYMlCEMpceL5bXwpJCA75P3DIrJbp6jO0 2UdFQmbulB0gcl6MYbA/X3bdhcIN7w== =WjFN -----END PGP SIGNATURE----- --okf44ik46sxcmcxb--