Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2620644rwn; Fri, 9 Sep 2022 17:29:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ZowyQgpr6X44kL+RZwxh4Nq7QSp8v6qznzCTjzIWyRtqfvhPAWZycc/Bk4PIzImi/xXAh X-Received: by 2002:a17:906:5d0e:b0:742:7a6:a1c3 with SMTP id g14-20020a1709065d0e00b0074207a6a1c3mr11176735ejt.732.1662769775892; Fri, 09 Sep 2022 17:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662769775; cv=none; d=google.com; s=arc-20160816; b=UXAZnq6bMaW5SItUUcNCHmr8lcYxroNIY/kqAdXO23rvHNKKmHO+8rDi93k15oTvBl R2QKoJTCkEPLcSESF2owQIZKcnH7YTdRLb7S1o/yWh/Nxqh7jzNRcrQwTokrma7T/itC gq1Lt3wiJpqWPt+HPMzqXt+JerRJIepiiZXZBc1M+p63bJhkUJYKFHtCrw8ZyRB8+GIB yTCi/SdLtfk73c5HAsnw6f0tjxWLfHVxcddXGkMEdKXl634MlErC38JR+pP+XNln+7i+ UwAYPYk/km3I1bn+uHzX6E4nJyjJWJrM6/5pcrfrNeDrkBbRS0cXruvU9c3L5nEOtteO /dUQ== 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:dkim-signature; bh=I7AGr5kxvD7L8BGImkaiYYIcWYTyuHALX3Uwn5SFGes=; b=yWdE7MIJph2ezLae0Q9IbNfAOw0NfTG27kCasNpg7l+bWl7dypTLt2HV/5Ch4mXDct UpADrNeJUTnkoHFK5NlBh6gyN4VXAt9sKixveqBHcwQA+O4OFPBaEAxz5qHxNavDc10Q x5LEaK4nvnvqORhDl+iInXxYInr+bscb5KIJEhgaTC+yFCSRmQqMPQMc/42Lba69MzhO ZTIiVZE8e+H4pfBWwFW2OmttLlNzByEfIITrHlaDDskeWwn0WnuBt2HriGzLt0Z1HQ9g 5Po5/E8CHaMgWZz6FPybj0g86n37h+tX/PdwSQ9CCJUK95rzSCr3VdosbeyntECPc2Zh g7IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=dABIJEmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg4-20020a1709072cc400b007418e2229c8si1397089ejc.521.2022.09.09.17.29.11; Fri, 09 Sep 2022 17:29:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=dABIJEmz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230415AbiIIXxR (ORCPT + 99 others); Fri, 9 Sep 2022 19:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiIIXxP (ORCPT ); Fri, 9 Sep 2022 19:53:15 -0400 Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3631D11B008 for ; Fri, 9 Sep 2022 16:53:14 -0700 (PDT) Received: by mail-qv1-xf2c.google.com with SMTP id m9so2449000qvv.7 for ; Fri, 09 Sep 2022 16:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=I7AGr5kxvD7L8BGImkaiYYIcWYTyuHALX3Uwn5SFGes=; b=dABIJEmzczJA9TeUEwB/vqlw1on+BNexewwg9hQHdtE1Pf+5Eir7ZuRo5Ra74CBI2Y mcA+UH3eeO9aAd0QqE0L7SFCTjpphtpc0ELtMYBKyyRw1a/HWDzHyUcOactrzkgR2sl3 L0nOmencTRW6FHXiEoY9iZZ+c/WYo/U0AzzN4UAFPlTI1iRVRUWqtRTHaf8sCXXZzJnf NJL3l99mu6NE5Asx87J+/QD6IeeyB3qXivdFsvkAKE6TbTRWix12Dqc9T+JmjOGbnts9 4TFjGIVIDOrRXIamT7vOV1TzgaehJPaax4ZVZ8nlHpjlkRagg2W3Kahrivj4XNmSdY7D YIBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=I7AGr5kxvD7L8BGImkaiYYIcWYTyuHALX3Uwn5SFGes=; b=eebkyhLVRdtdKJNNAJTfLs5fPqJzWMqNQWLQAIL0mpOTny+y5rrz4fBleOp8ULxZhc 9cw1H3lXY7PhX1PcQHBp1IxeR8OJZPCLLjfyhdv+sBwpRwoqmTsI5VGXvCvmlt5B3xQt bgYwnnnKErFnDaMNyi3eYIX5ho/tsD+2akKDzGCmismdRSMl4ffPBxB9Bm+qxUpuVDSv v1ysy3zR9E2o6y6lS5BVlGUkkp298Jl4gZ5zrHvaF6EOV25KBFlDYdunyTFoc+VoXeQm JxKpsemNbEKYF4+afSNeovDBDwFbR0L4zwXSbSuKftkI7ZNUOz4zbQVlLRbOhDHQAC76 /GGg== X-Gm-Message-State: ACgBeo3NGJzQZJ+33DsM8JuLUy+KoimQqXkK/+UCIkdSXWnSfgg4osUW HAywpqolxdyf8QQhK53vpkZbHg== X-Received: by 2002:a0c:f445:0:b0:4a6:9f4a:9a66 with SMTP id h5-20020a0cf445000000b004a69f4a9a66mr14581963qvm.65.1662767593396; Fri, 09 Sep 2022 16:53:13 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id fz16-20020a05622a5a9000b00342fc6a8e25sm1348798qtb.50.2022.09.09.16.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 16:53:12 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1oWno8-00A0GS-4S; Fri, 09 Sep 2022 20:53:12 -0300 Date: Fri, 9 Sep 2022 20:53:12 -0300 From: Jason Gunthorpe To: "Tian, Kevin" Cc: Ethan Zhao , Zhenyu Wang , "Wang, Zhi A" , Jani Nikula , Joonas Lahtinen , "Vivi, Rodrigo" , Tvrtko Ursulin , David Airlie , Daniel Vetter , Eric Farman , Matthew Rosato , Halil Pasic , Vineeth Vijayan , Peter Oberparleiter , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Tony Krowiak , Jason Herne , Harald Freudenberger , Diana Craciun , Alex Williamson , Cornelia Huck , Longfang Liu , Shameer Kolothum , Yishai Hadas , Eric Auger , Kirti Wankhede , Leon Romanovsky , Abhishek Sahu , Christoph Hellwig , "intel-gvt-dev@lists.freedesktop.org" , "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "linux-s390@vger.kernel.org" , "kvm@vger.kernel.org" , "Liu, Yi L" Subject: Re: [PATCH v3 01/15] vfio: Add helpers for unifying vfio_device life cycle Message-ID: References: <20220909102247.67324-1-kevin.tian@intel.com> <20220909102247.67324-2-kevin.tian@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 09, 2022 at 08:42:25AM +0000, Tian, Kevin wrote: > I think it's quite common to have an alloc() helper initialize refcount, e.g. > vfio_group_alloc() both initialize its user refcount and also call > device_initialize() to gets kref initialized. Similar example in > ib_alloc_device(), etc. Right, it is quite a good/common pattern to have an allocation function return a refcount to the caller. I don't know of any naming standard for this however. Jason