Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp311512lqh; Fri, 31 May 2024 01:58:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHvFcQDXYpwYYldxO5egP1d/9ZH7hxSQKKUw0Me4OEQz5Trx8BHaQbunf5fXUxXQHjO9hAtzQKwiTqcHkSGUJRtOgIq+hqSLXIyb5buw== X-Google-Smtp-Source: AGHT+IEm/jz6ofopbJ+aGNQtlRcT6bo2PdNDjspL8f71uqV+c1QL/ge/UK5wQRkmw1EK9T54+51e X-Received: by 2002:a05:622a:1b8d:b0:43e:d87:e8e with SMTP id d75a77b69052e-43febf9963bmr72887531cf.18.1717145887592; Fri, 31 May 2024 01:58:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717145887; cv=pass; d=google.com; s=arc-20160816; b=wG3YhzKIhe64KKcDg0HMPPzGArPgl5E/qv0R7iMxMIrSYayQxrKjOqPAhFnwXy8blg FwKtx3SiuSgT3Num/wNXtu32LbrE92xIOSuFPY0lJjIJQ2XIdC+RbWJER3OSu+LsAgOG 6Zq0IzY7RPWkz/ap/RY1saFIBTyR9Y/qns8uBymUVxf/amGPL5YqovOrxjUJ6IAYDcTr Qu8JSwKmfUFB9+IOOo++lNaKDqTmStQWtTU/0xgPDsVjK+cmz3HMN8LPbdP+f01QkcAW Lf0yuFITo/QvmCJMWVvWQsWnUncK1f4dDIWuLo48y+5jJ4ughy4PULVb1OW3ibg7MIqV 5w+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=3vwM1J9D2bEWPilYaA1eQArQ+7NTlRIiZWcVHP4AGqo=; fh=iG0xx5OIhdvwZ5LJ32pAa5lOvciWG61qB8fjKE96rWo=; b=jo+XOYYh3lfK5mkeNrEt+1vvfT/8LC1mTno5nTiwkqrh5pAGss9bZeAmoY6gICdGdK 5pDc6BJ6fJzNIqTKS2UYOTS5qi6LwFTcA9IZLDvJdvaKw20F/py6LCdS9ytOympacH9O X9NKtU4x2e8bT98Y50Ma7HGrGDEyFRaiuHBPjJpc/Pi3BIC/JsGUofnO4MivSDvERw9C uNCEBic2Q0jMdLPAg3cCETaVFOxLe3r5+/ufFID+EjO725eahba61l+QDZBz52xMIIa9 2Ln9yVkd3LYUrRhF70B76W3SoneUmLurUYp5gd1gPtL8A5FVcnJvOssS4YeQ8ZUfnlsS KwcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="VBw/Yiis"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-196522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff25b6fb2si15179751cf.781.2024.05.31.01.58.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 01:58:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="VBw/Yiis"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-196522-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7B1151C232CF for ; Fri, 31 May 2024 08:57:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ABB6B156251; Fri, 31 May 2024 08:57:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VBw/Yiis" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E67E43154 for ; Fri, 31 May 2024 08:57:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717145831; cv=none; b=ZM/VDhTdQlxradsMEDsXdI+LpxgXZGMLcGqjIOifbDEprTyv7pcXJsIyiPU/vhNR+B01T9kYkk4qxYeDCz1Gm9Rl9fPGd0rOk1MBuWkhQTWdsnTll0UM+/Ycn2pcg+/EJUY0H4XD/bPqFDcjr/cmOLhFaDloJ8BkggSmchlshLQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717145831; c=relaxed/simple; bh=RMhOq0e80xkHIOos311ef0InQ1+OuX+zK7Yy4hvNt5I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aSLVJhbnUoIDQc6ZYCCwEkbb6306IynlVDOXiHVr2a8Kx/yhPyTmdmpd/2m2uPHOt+PVHOQylrJhNDKHIX5zeeKJLYUFMJkO/UgyWyImnwXXTWN8f/Pz3gnwB6t87iEL6etDriMmKZgCf7qnU4eNuetRTy+YtlifJqI8RPxinjw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VBw/Yiis; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717145831; x=1748681831; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=RMhOq0e80xkHIOos311ef0InQ1+OuX+zK7Yy4hvNt5I=; b=VBw/YiisbFl9FSKzgNr9+GyQ6MH8xst3qMt/aQjlhneoWcWSoCgoT0Qg HlJmfjHf+1RUFnvDjHqHS60vvbYtrkZxy4s1lsmAW/UOh8ORe0sW2/qlf NOzAgBNpOGPWbUr6oqI4eN8X14EIO4h0hlPJhQ8kqd2a29j9OzdNmTfPX 8+6WeGk+Yr5TAFNDDZOto7ts0111zm4DbR6q2MOev0GIJbJ/wI6WXj0KH gMiloh4phzvUUATpX+3hmoQXN8AnYWB8WBFKcP0L+ITIdNHFqgLvRyvrh bqHndx4JlyjhQdF0dOhJlqVNzeyhVphatsot/4O0hemNAXKqVD8sxOTws g==; X-CSE-ConnectionGUID: GigziEflTaiLhvu1r16AIQ== X-CSE-MsgGUID: A/C22HOcR+Sp+N1n2j9CYg== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="24802613" X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="24802613" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 01:57:10 -0700 X-CSE-ConnectionGUID: zlNN3HCQRCO/ESfZhJtDKA== X-CSE-MsgGUID: um8Yq5J8TUGDJ2jy96E4GQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="36583456" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa006.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 01:57:07 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1sCy4O-0000000CQFP-07an; Fri, 31 May 2024 11:57:04 +0300 Date: Fri, 31 May 2024 11:57:03 +0300 From: Andy Shevchenko To: Chia-I Wu , Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, christian.koenig@amd.com, alexander.deucher@amd.com, Greg Kroah-Hartman , Alison Schofield , Dave Jiang , Baoquan He , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel/resource: optimize find_next_iomem_res Message-ID: References: <20240531053704.2009827-1-olvaffe@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240531053704.2009827-1-olvaffe@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, May 30, 2024 at 10:36:57PM -0700, Chia-I Wu wrote: > We can skip children resources when the parent resource does not cover > the range. > > This should help vmf_insert_* users on x86, such as several DRM drivers. > On my AMD Ryzen 5 7520C, when streaming data from cpu memory into amdgpu > bo, the throughput goes from 5.1GB/s to 6.6GB/s. perf report says > > 34.69%--__do_fault > 34.60%--amdgpu_gem_fault > 34.00%--ttm_bo_vm_fault_reserved > 32.95%--vmf_insert_pfn_prot > 25.89%--track_pfn_insert > 24.35%--lookup_memtype > 21.77%--pat_pagerange_is_ram > 20.80%--walk_system_ram_range > 17.42%--find_next_iomem_res > > before this change, and > > 26.67%--__do_fault > 26.57%--amdgpu_gem_fault > 25.83%--ttm_bo_vm_fault_reserved > 24.40%--vmf_insert_pfn_prot > 14.30%--track_pfn_insert > 12.20%--lookup_memtype > 9.34%--pat_pagerange_is_ram > 8.22%--walk_system_ram_range > 5.09%--find_next_iomem_res > > after. Is there any documentation that explicitly says that the children resources must not overlap parent's one? Do we have some test cases? (Either way they needs to be added / expanded). P.S> I'm not so sure about this change. It needs a thoroughly testing, esp. in PCI case. Cc'ing to Ilpo. -- With Best Regards, Andy Shevchenko