Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1962995rdb; Mon, 9 Oct 2023 08:18:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNNJmDP3pbKmUbTj5wK2enIxT9qXdsZgrHXuZjcYnXQzvKCnPx4zHR4vjsjajZyHTPKh+8 X-Received: by 2002:a9d:7746:0:b0:6c6:3ea5:cdbf with SMTP id t6-20020a9d7746000000b006c63ea5cdbfmr15853324otl.28.1696864698012; Mon, 09 Oct 2023 08:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696864697; cv=none; d=google.com; s=arc-20160816; b=Msq1ujSmw2FgiHoKIAWPhr8ND0aorYgxkTZItFkpqUCMWhdn4gPlZKsD2XLGvThN8G QFH0S0mAdfT8mVdUOqw5XkiNev31Fc8oY4RoZIseDsszO2t3cwJ2lyDXvALkDpDAfdVL T4rfBApW0P1LeEpNOEg5mpdXhpkXEhsFKtEIhEZvkM5CYhyjg3z6sX6/EO3jy6z3RuAj ihn20t4v5YAIdFELD+wVe+v0tt6qA4C1RrtL2M3WOsg1Ar4gW0SN4htZ/95x0Yyk0PYy qzgw6gdgRLvBZTmea25Lh+9cGPf0utJbrQ3mE9F6p4BEKFTWouPIosuzyDerQnuZfkxL pWHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=gwiKUt5ka+BYGmzRgkgtMHEqT5A13fT18PkD11BTWkM=; fh=dwvx6jsB3r0Fb1ZWtzIEqIwUlmwdQCBVM9oiWkdmcUo=; b=VYTICAc/xvQ+k+u0wHH28J/tdLD4ck4gCoiBBvyDjGay0zVjUVVOXbmnfadbmllCbV E1p5DAGFraooOc2zijOxV7NErfl+N8rlIOfBEI7EqZclSNYXqxj8CkqgH5GPSUod4zud Nk9HIxit5Y8s4Ceh91a9isNnQRocRhR6svqf4g+Gbe+T8A2jlA2BD718OGpa4o305QLZ Wsdtsh0iiIxAQD2+4jZXda+XysO3sja9Tnf2A/4zREJFfHYAxJAADlYGKjG8RRPuVj6e HlBiEra2Nmihf0RLrU+Vy6pWh731Li3pqA9Ng96YegTneVJ3LasHeMnUWglzIQx2KreU nqeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QSbOy7ti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id w25-20020a639359000000b0058952602da4si9797630pgm.612.2023.10.09.08.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:18:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QSbOy7ti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id EA97380A21BB; Mon, 9 Oct 2023 08:18:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376938AbjJIPR7 (ORCPT + 99 others); Mon, 9 Oct 2023 11:17:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376736AbjJIPR4 (ORCPT ); Mon, 9 Oct 2023 11:17:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2870EA3 for ; Mon, 9 Oct 2023 08:17:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D296C433B7; Mon, 9 Oct 2023 15:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696864671; bh=IxC3QSqPVebIUIRAWD+xhWprjzDHOIt3IBTBrp48heo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QSbOy7tie+ysnc34WLh7T8qM5g5Hep59jVakIVVg7b/MLulFFJE5pGb2GEvBqMXGP KnPwAWfAtpkN5ufKCIYccOCr0pHzqBOgPgWGVayiYQ3kTC8V8nhQEci7ZEfbkKpNr1 dWuP2ig4eXLIFQYtUdJrBCCYEzfViD6GeE8o21oy8YYoi1kUdDEe78p8H/dA684ILU iqpceVibFcCNj/hVcRFLegXJWz4fcAvOEN80JOMXa+CpkPMfLyiKIjst/IFXBx6ehk vqoKVr/tZVUXoOR+jWI7fUWXRUkJoPfK3ASN++C+Ec0RxBwr7+yPGQ5F8Wdllz93uT mTUCc57DJgP3g== Date: Mon, 9 Oct 2023 08:17:50 -0700 From: Jakub Kicinski To: Chengfeng Ye Cc: 3chas3@gmail.com, davem@davemloft.net, horms@kernel.org, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] atm: solos-pci: Fix potential deadlock on &cli_queue_lock Message-ID: <20231009081750.2073013d@kernel.org> In-Reply-To: References: <20231005074858.65082-1-dg573847474@gmail.com> <20231006162835.79484017@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 08:18:15 -0700 (PDT) X-Spam-Level: ** On Sat, 7 Oct 2023 23:58:36 +0800 Chengfeng Ye wrote: > > and irqsave here. I think you're right that it's just softirq (== bh) > > that may deadlock, so no need to take the irqsave() version in process > > context. > > Yes, spin_lock_bh() is enough. > > I just found spin_lock_irqsave() is more frequently used in this file, so I > also used spin_lock_irqsave() here for uniformity consideration at that time. > > Should I send a new patch series to change this to spin_lock_bh()? That's > better for performance consideration. Yes, performance is one reason and another is that the code will be easier to understand if the locking matches the requirements.