Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1465166iog; Tue, 14 Jun 2022 06:40:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXgET7zE0l/okdsN6PV1D2860ttx8Xv+/yMeZaTcP+xDIraA/5JP5KVEdqElThl33WKJh8 X-Received: by 2002:a17:906:74d1:b0:712:2293:8f41 with SMTP id z17-20020a17090674d100b0071222938f41mr4310472ejl.495.1655214056813; Tue, 14 Jun 2022 06:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655214056; cv=none; d=google.com; s=arc-20160816; b=gxqsJF4G9IFLlD0rbV7jADrT//ATly+7dzgoMwD//dyLauFhWpiE51D800uoGtRMGd 2uNAH1IEkQkyfuz72LUNidp9fxoBXhtiu7XbPZGUQURytRNAmd200aAUE3A0VD8eGNMl ZnEwgP9wEVj6XVlgxrj6YClbyGIV73jDeJXBIl9GVRoe91Ed/PhmQb8IRlXVGVMEE9xL R+83RfwA25Q6tdDnb8OR0vYpL/gtf5bersaCQ6/JI2CsjpLd1Svl+5IUvnL+hyREz1dA wH3D5WgM10TzrWrOtVjTjwPycLfk2XU52ETNED7HSABGjeluxzwlHv61z6UQLHe666oY dGxw== 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=BpLY4pvAWUAr8fzqtoUbOPQykiEJ2j82//aDJFTlvoc=; b=bQqgPQ0LEr8xtFMPnL+y858Yo68cEQVBFSV0ugogcP2c/z4f+ux6HSafV8tAI/+Otj iafoCjcu/MCL7wBZwiYmzetXqZmJVD9xIhOYpGtOWMfSQO3mgAQeW8a1uOC1s1KDXGCs FZnsniPlKveQzYa8tfjbO7iSKuseoC6I51gOUUjfIBcRgoBoHYBo/wb79xqgs8HER9wc /zBrxV9e008zZp1MWVYectCMXvn3Jq0NlJ/ZicydRzheHELWohgON4MvOOhmKpBDnYwd ECdCIZdkJxHmsFyhw9Wz/qML/s3HeP9gHcZi0okGxrl6IGlczs6t4udCvwvV4//OZBVM AX8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1j05TVhI; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a170906135400b0071208964101si9057693ejb.349.2022.06.14.06.40.28; Tue, 14 Jun 2022 06:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@linuxfoundation.org header.s=korg header.b=1j05TVhI; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232896AbiFNN3H (ORCPT + 99 others); Tue, 14 Jun 2022 09:29:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231493AbiFNN3H (ORCPT ); Tue, 14 Jun 2022 09:29:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2567312742; Tue, 14 Jun 2022 06:29:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D0174B81879; Tue, 14 Jun 2022 13:29:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 331AEC3411B; Tue, 14 Jun 2022 13:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655213343; bh=YEx73vfnRAnHRBrz3PVeIi0/8rfDtL+oBfNabAeQlks=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1j05TVhIBjoG+yVNALTqiebQc3iaVllOkF3KyI17HMtZRW0vM9CIkJAEPJqrW/sq1 cIxXPaCYiJAElrrjwQyZfvFY7df7t/LnOG72Jx/8daQ5CLtNoqKv0RcXWms+WI5zmC azueH7QKGohSeoaA1D3eKgzY4b3KtGMGASp8Mj7I= Date: Tue, 14 Jun 2022 15:29:00 +0200 From: Greg KH To: "yekai(A)" Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, linux-accelerators@lists.ozlabs.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, zhangfei.gao@linaro.org, wangzhou1@hisilicon.com Subject: Re: [PATCH v2 3/3] crypto: hisilicon/qm - defining the device isolation strategy Message-ID: References: <20220614122943.1406-1-yekai13@huawei.com> <20220614122943.1406-4-yekai13@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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-crypto@vger.kernel.org On Tue, Jun 14, 2022 at 09:24:08PM +0800, yekai(A) wrote: > > > struct hisi_qm { > > > enum qm_hw_ver ver; > > > enum qm_fun_type fun_type; > > > @@ -335,6 +341,9 @@ struct hisi_qm { > > > struct qm_shaper_factor *factor; > > > u32 mb_qos; > > > u32 type_rate; > > > + struct list_head uacce_hw_errs; > > > + atomic_t uacce_ref; /* reference of the uacce */ > > > > That is not how reference counts work, sorry. Please use 'struct kref' > > for a real reference count, never roll your own. > > > > thanks, > > > > greg k-h > > . > > > > this atomic_t reference is lightweight than 'struct kref', It's the same size, why would it be "lighter"? Why do you need it to be lighter, what performance issue is there with a kref? > this reference > means whether the task is running. So would it be better to use atomic_t > reference? I do not know, as "running or not running" is a state, not a count or a reference. why does this have to be atomic at all? thanks, greg k-h