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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 425F0C433F5 for ; Wed, 23 Feb 2022 04:23:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237179AbiBWEXd (ORCPT ); Tue, 22 Feb 2022 23:23:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbiBWEXc (ORCPT ); Tue, 22 Feb 2022 23:23:32 -0500 Received: from codeconstruct.com.au (pi.codeconstruct.com.au [203.29.241.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9E5C27145 for ; Tue, 22 Feb 2022 20:23:04 -0800 (PST) Received: from pecola.lan (unknown [159.196.93.152]) by mail.codeconstruct.com.au (Postfix) with ESMTPSA id D75A020159; Wed, 23 Feb 2022 12:22:58 +0800 (AWST) Message-ID: Subject: Re: [PATCH net-next v3 1/2] mctp: make __mctp_dev_get() take a refcount hold From: Jeremy Kerr To: Jakub Kicinski Cc: Matt Johnston , netdev@vger.kernel.org, "David S. Miller" Date: Wed, 23 Feb 2022 12:22:58 +0800 In-Reply-To: <20220222195914.6f001f66@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <20220222041739.511255-1-matt@codeconstruct.com.au> <20220222041739.511255-2-matt@codeconstruct.com.au> <20220222195914.6f001f66@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Jakub, > Jeremy, did you have any specific semantics or naming scheme in mind > here? PTAL. Is it better to make __mctp_dev_get() "safe" or create > mctp_dev_get()? etc The __ prefix is (was?) more about the requirement for the RCU read lock there. That's still the case, so the __ may still be applicable. We only have one non-test usage of a contender for a RCU-locked mctp_dev_get(), ie, currently: rcu_read_lock(); dev = __mctp_dev_get(); rcu_read_unlock(); - so I'm not sure it's worthwhile adding a separate function for that at present, and I'm OK with this patch retaining the __. I guess the question is really: as per existing conventions, does __ more imply an unlocked accessor, or a non-reference-counting accessor? Cheers, Jeremy