Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp317775imn; Thu, 28 Jul 2022 01:18:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uOdL8z7TuUCSASUFs2BLjz5FVibjC7DNPqTo+zdE6LdcM2XtAHzOg3rwBjd8HNzfEOm4ag X-Received: by 2002:a17:907:7e94:b0:72b:53d2:c004 with SMTP id qb20-20020a1709077e9400b0072b53d2c004mr20975606ejc.387.1658996287797; Thu, 28 Jul 2022 01:18:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658996287; cv=none; d=google.com; s=arc-20160816; b=ppcG+Lex00uGtZNnO8rUowp2jnW3usPMIC7ZsclA0s/l8HZMCgYxcH6QFhODccDzx5 SLryP4HHchICv5Xu2u9E+Pjj8n0eGnPFD8ICfJGgsx3YaLuOptW2d0oyUS+dJzI8uICR FUfKcG87aQHXK9NkboGBQY73NqQEDUednKcZqpbMHf77vqosh7WlFcuJubGTi8VgHA5L TQCaxufbXIT643ceRzW6cb8yAiqkHRJ7M2UqUOzXEddKSUKQh4ZIp7OCC7PJR7uejwPI U6FialzKEhBZGchx+aHz6HSe7f66IzBC3zFA6o7rPP/NL5/6IknBD0i0w8s+usnyCpG/ XFqg== 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=QzpV7kmHeIddcYSY+xjcmBu30/oZQu1NPKv61uR+5Ok=; b=cqArXYoYSCbF0u9upAZmc8bdaFDnoDO1WG6gUm5cVP93Uk46kWXbLRoTJqah2nHCyb 1I26yoIb4txcwaeXggX8WOZi2kbjvi7EUrOX6SNQHUl0FVBhoXwW+bIYHqJnmLTPNKX4 GGAyZP2wQMOK/uDl/v8OeN8OWh/q2tfPLiyGZNjztsn7zx2/sLycN7XJhiwospmVX3/k DF2D8H+tv/xTTikoIFILcKsHl9yYl9imEFbiUD8iDAVjlWG835g89HiBwkhDAIsy7Sy5 c5Sbm7oqmNEABNtY49Zw/VghQr0fygWuCqaouHFs4iTNyg9o76cTw8zjlPxGL9aCwq5+ g9pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l8z0fA4d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa42-20020a17090786aa00b0072b9ca954b2si193116ejc.1006.2022.07.28.01.17.41; Thu, 28 Jul 2022 01:18:07 -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=@kernel.org header.s=k20201202 header.b=l8z0fA4d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235029AbiG1IP6 (ORCPT + 99 others); Thu, 28 Jul 2022 04:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233818AbiG1IP4 (ORCPT ); Thu, 28 Jul 2022 04:15:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 459F3CE01; Thu, 28 Jul 2022 01:15:56 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D9CA961BA0; Thu, 28 Jul 2022 08:15:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1410C433D6; Thu, 28 Jul 2022 08:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658996155; bh=/m2yuIjtmhX7sFDuqcZZi68Qe5oW8kgCP6tQn5ihcTU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l8z0fA4d3WL4ubdKlk1TEtv4uuRaGIdw+/nCBM5JFlX8Ev8QIzGaTJG7tmRZbmlJV kreAeNNOwZE4BvzB4yD/AYYAUMYEDqZbeJgR6CPy5CDSelNxDu0GfK6ZkFpxWux6Oa cnNOU2gY4f8kNAyn0ugAdQ6wWHqt9w+Z0Y7PHsRZzoRZbi1tNLHJGmh7yGDvR/eXDf x79f+UeTVlR9Zohn1XCHsjVFIdAg8d13MTqo4N+Xq6bDncF6iDgVrBJ9UHox8bpLGm WRHVN6DWXztRQsnNx7kFki8BJcK+7mMrarnPvkWJD0JGilxoZXuQMRDfD6fIeEHrAP NSTq889MeP24Q== Date: Thu, 28 Jul 2022 11:15:52 +0300 From: Jarkko Sakkinen To: Lino Sanfilippo Cc: peterhuewe@gmx.de, jgg@ziepe.ca, stefanb@linux.vnet.ibm.com, linux@mniewoehner.de, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, l.sanfilippo@kunbus.com, lukas@wunner.de, p.rosenberger@kunbus.com Subject: Re: [PATCH v7 07/10] tmp, tmp_tis: Implement usage counter for locality Message-ID: References: <20220629232653.1306735-1-LinoSanfilippo@gmx.de> <20220629232653.1306735-8-LinoSanfilippo@gmx.de> <744ad6e1-c4ad-1e6d-f94d-98aa5b105dc6@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <744ad6e1-c4ad-1e6d-f94d-98aa5b105dc6@gmx.de> X-Spam-Status: No, score=-7.6 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 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 Wed, Jul 27, 2022 at 02:16:56PM +0200, Lino Sanfilippo wrote: > > > On 11.07.22 04:50, Jarkko Sakkinen wrote: > > On Mon, Jul 04, 2022 at 07:45:12PM +0200, Lino Sanfilippo wrote: > >> > >> > >> On 01.07.22 01:29, Jarkko Sakkinen wrote: > >> > >>> > >>> I'm kind of thinking that should tpm_tis_data have a lock for its > >>> contents? > >> > >> Most of the tpm_tis_data structure elements are set once during init and > >> then never changed but only read. So no need for locking for these. The > >> exceptions I see are > >> > >> - flags > >> - locality_count > >> - locality > > > > I'd still go for single data struct lock, since this lock would > > be taken in every transmit flow. It makes the whole thing easier > > to maintain over time, and does not really affect scalability. > > > > This means switching to a complete new locking scheme which affects many > parts of the TIS core code. It is also not directly related to what this patch series > is about, namely activating the interrupts for TPM TIS. > > I suggest to first finish polishing this series especially since there have > only been minor issues in the last versions. Once the interrupts work we > still can think of implementing another lock handling in a follow up series. So what if you would use kref instead here? On surface this looks like ad-hoc kref but I could wrong too (as always). BR, Jarkko