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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76F44C433F5 for ; Tue, 9 Nov 2021 10:58:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3DC4761151 for ; Tue, 9 Nov 2021 10:58:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3DC4761151 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7493B6E3FC; Tue, 9 Nov 2021 10:58:44 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by gabe.freedesktop.org (Postfix) with ESMTPS id 23B2E6E3DF; Tue, 9 Nov 2021 10:58:43 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 6B81E67373; Tue, 9 Nov 2021 11:58:40 +0100 (CET) Date: Tue, 9 Nov 2021 11:58:40 +0100 From: "hch@lst.de" To: "Wang, Zhi A" Message-ID: <20211109105840.GA9675@lst.de> References: <20211108212718.10576-1-zhi.a.wang@intel.com> <875yt17qzs.fsf@intel.com> <5dd106e7-e62f-dfcd-bfa1-3f92794b8e3e@intel.com> <87o86t636f.fsf@intel.com> <20211109103622.GA7607@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Subject: Re: [Intel-gfx] [PATCH 1/3] i915/gvt: seperate tracked MMIO table from handlers.c X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "dri-devel@lists.freedesktop.org" , Zhi Wang , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "jgg@nvidia.com" , "intel-gvt-dev@lists.freedesktop.org" , "hch@lst.de" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Nov 09, 2021 at 10:51:27AM +0000, Wang, Zhi A wrote: > Can you elaborate more about this? We need the hash query from the table > ASAP when the hypervisor trapped a mmio access. It's a critical path and > we tried different data structure in the kernel and the hash table gives > the best performance. Ok, I misunderstood the hashtable.h interface. hash_for_each_possible actually does a hash lookup instead of an interation despite the rather misleading name. 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70CB0C433F5 for ; Tue, 9 Nov 2021 10:58:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D7A761181 for ; Tue, 9 Nov 2021 10:58:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242466AbhKILBe (ORCPT ); Tue, 9 Nov 2021 06:01:34 -0500 Received: from verein.lst.de ([213.95.11.211]:49658 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241381AbhKILBd (ORCPT ); Tue, 9 Nov 2021 06:01:33 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 6B81E67373; Tue, 9 Nov 2021 11:58:40 +0100 (CET) Date: Tue, 9 Nov 2021 11:58:40 +0100 From: "hch@lst.de" To: "Wang, Zhi A" Cc: "hch@lst.de" , Jani Nikula , Zhi Wang , "joonas.lahtinen@linux.intel.com" , "Vivi, Rodrigo" , "zhenyuw@linux.intel.com" , "jgg@nvidia.com" , "intel-gfx@lists.freedesktop.org" , "intel-gvt-dev@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/3] i915/gvt: seperate tracked MMIO table from handlers.c Message-ID: <20211109105840.GA9675@lst.de> References: <20211108212718.10576-1-zhi.a.wang@intel.com> <875yt17qzs.fsf@intel.com> <5dd106e7-e62f-dfcd-bfa1-3f92794b8e3e@intel.com> <87o86t636f.fsf@intel.com> <20211109103622.GA7607@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 09, 2021 at 10:51:27AM +0000, Wang, Zhi A wrote: > Can you elaborate more about this? We need the hash query from the table > ASAP when the hypervisor trapped a mmio access. It's a critical path and > we tried different data structure in the kernel and the hash table gives > the best performance. Ok, I misunderstood the hashtable.h interface. hash_for_each_possible actually does a hash lookup instead of an interation despite the rather misleading name.