From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 513FA37C906 for ; Fri, 26 Jun 2026 15:12:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782486747; cv=none; b=A9Hpoe5L9QCjCW+sk58ps4N7eBeniPe0LkoopFda9zjO3l+pc0g/C3PV0bOJDSg3ctNyjp390HCYX3RhFjS7MXJeArJ+E8hpSFdc3vFNDeZQnxgHEjDtpDMoeteGugy7YMEIk+S8lhW666FxjcujRezxHZMtmWOW/AgIHNKB/7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782486747; c=relaxed/simple; bh=YN7HFeAn5PfLzBdHTnw12iJICI72jFBKITQg8GRt9JI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J214YHj/N5DqyavO8PNAVT5hTqiD7QxYoMY09CULipHf0FR69JQJS1314KiqcNzbqCfIXCQqNDEc3wgyy63dVLpqGdeEY628CQ+B9NlZctxCn2jLQy+8B+r2FRAR6gu1xH71EisT6xHVY+iiNat8P14182MZ3m43/jz+c3Xy8us= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=W4OK0Qj/; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="W4OK0Qj/" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 596401E7D; Fri, 26 Jun 2026 08:12:12 -0700 (PDT) Received: from localhost (unknown [10.2.196.114]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 68D2D3F632; Fri, 26 Jun 2026 08:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1782486736; bh=YN7HFeAn5PfLzBdHTnw12iJICI72jFBKITQg8GRt9JI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W4OK0Qj/gfEiAScIK4WRs1+dVyd7SXFPAI+0BUFrcXuVHPnbTliWZzqYxLs3rNdQI 4s5PWJrgQ8F5NTwPDsn9Shr56QFSSGvxFWGKWd/D7lYrWZOS+D08a5l6+jG5+suUU4 ONIuI3yT9d+BIeSeJ2JJHdwLAJoWoEbNTVCuuzEg= Date: Fri, 26 Jun 2026 16:12:14 +0100 From: Leo Yan To: Wen Jiang Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, akpm@linux-foundation.org, urezki@gmail.com, baohua@kernel.org, Xueyuan.chen21@gmail.com, dev.jain@arm.com, rppt@kernel.org, david@kernel.org, ryan.roberts@arm.com, anshuman.khandual@arm.com, ajd@linux.ibm.com, linux-kernel@vger.kernel.org, jiangwen6@xiaomi.com, shanghaoqiang@xiaomi.com, Suzuki K Poulose , Mike Leach , James Clark , Tamas.Petz@arm.com, Michiel.VanTol@arm.com Subject: Re: [PATCH v4 0/6] mm/vmalloc: Speed up ioremap, vmalloc and vmap with contiguous memory Message-ID: <20260626151214.GA1794676@e132581.arm.com> References: <20260618084726.1070022-1-jiangwen6@xiaomi.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: <20260618084726.1070022-1-jiangwen6@xiaomi.com> On Thu, Jun 18, 2026 at 04:47:20PM +0800, Wen Jiang wrote: > Besides accelerating the mapping path, this also enables large > mappings (PMD and cont-PTE) for vmap, which are currently not > supported. I verified this series with large vmap() mappings for Arm trace buffer units (TRBE and SPE), and the results are positive. Arm trace buffer units use the CPU's page tables for address translation when writing trace data to DRAM. The larger vmap() mapping granules reduce TLB pressure, resulting in significantly fewer L2D TLB refills and reduced L1D TLB refills. The decrease in dtlb_walk indicates that fewer page table walks are required and that address translations are more often satisfied by cached TLB entries. The detailed results are included below for reference. Thanks for working on this, and here is my test tag: Tested-by: Leo Yan P.s. I applied a local change to set PERF_PMU_CAP_AUX_PREFER_LARGE in the CoreSight and SPE drivers to allocate large memory chunks. This change will be sent out once the MM changes are agreed. ## Results with TRBE Test command: taskset -c 2 perf stat -C 10 -e cycles:u,instructions:u,dtlb_walk:u,l1d_tlb:u,l1d_tlb_refill:u,l2d_tlb_refill:u \ -- taskset -c 2 perf record -C 10 -m ,1G -e cs_etm// \ -- taskset -c 10 ./sparse_branch_delay.elf The benchmark was run 5 times. CPU10 was isolated and dedicated to running the workload while collecting the TLB statistics. Before this series: +----------------+--------+--------+--------+--------+--------+----------+ |TLB Metrics | Run1 | Run2 | Run3 | Run4 | Run5 | Avg. | +----------------+--------+--------+--------+--------+--------+----------+ | dtlb_walk | 63 | 75 | 62 | 73 | 69 | 68.4 | +----------------+--------+--------+--------+--------+--------+----------+ | l1d_tlb | 2093 | 2189 | 2237 | 2036 | 2086 | 2128.2 | +----------------+--------+--------+--------+--------+--------+----------+ | l1d_tlb_refill | 154 | 153 | 150 | 165 | 157 | 155.8 | +----------------+--------+--------+--------+--------+--------+----------+ | l2d_tlb_refill | 161325 | 161403 | 161432 | 161580 | 161439 | 161435.8 | +----------------+--------+--------+--------+--------+--------+----------+ After this series: +----------------+--------+--------+--------+--------+--------+----------+----------+ |TLB Metrics | Run1 | Run2 | Run3 | Run4 | Run5 | Avg. | Diff. | +----------------+--------+--------+--------+--------+--------+----------+----------+ | dtlb_walk | 67 | 59 | 60 | 58 | 53 | 59.4 | -13.16% | +----------------+--------+--------+--------+--------+--------+----------+----------+ | l1d_tlb | 6710 | 7120 | 6662 | 6626 | 6542 | 6732.0 | +216.32% | +----------------+--------+--------+--------+--------+--------+----------+----------+ | l1d_tlb_refill | 126 | 117 | 119 | 117 | 119 | 119.6 | -23.23% | +----------------+--------+--------+--------+--------+--------+----------+----------+ | l2d_tlb_refill | 506 | 489 | 485 | 506 | 489 | 495.0 | -99.69% | +----------------+--------+--------+--------+--------+--------+----------+----------+ ## Results with SPE Test command: taskset -c 2 perf stat -C 10 -e cycles:u,instructions:u,dtlb_walk:u,l1d_tlb:u,l1d_tlb_refill:u,l2d_tlb_refill:u \ -- taskset -c 2 perf record -C 10 -m ,512M -e arm_spe_0/ts_enable=1,pa_enable=1,period=64,min_latency=0/ \ -- taskset -c 10 dd if=/dev/zero of=/dev/shm/dd_mem_test bs=1M count=1024 status=progress The benchmark was run five times. CPU10 was isolated and dedicated to running the workload while collecting the TLB statistics. Before this series: +----------------+--------+--------+--------+--------+--------+----------+ |TLB Metrics | Run1 | Run2 | Run3 | Run4 | Run5 | Avg. | +----------------+--------+--------+--------+--------+--------+----------+ | dtlb_walk | 2090 | 1709 | 1679 | 1519 | 1555 | 1710.4 | +----------------+--------+--------+--------+--------+--------+----------+ | l1d_tlb | 254450 | 257227 | 252517 | 252535 | 254752 | 254296.2 | +----------------+--------+--------+--------+--------+--------+----------+ | l1d_tlb_refill | 16023 | 16088 | 15944 | 15989 | 15956 | 16000.0 | +----------------+--------+--------+--------+--------+--------+----------+ | l2d_tlb_refill | 5887 | 4204 | 3713 | 4556 | 5620 | 4796.0 | +----------------+--------+--------+--------+--------+--------+----------+ After this series: +----------------+--------+--------+--------+--------+--------+----------+----------+ |TLB Metrics | Run1 | Run2 | Run3 | Run4 | Run5 | Avg. | Diff. | +----------------+--------+--------+--------+--------+--------+----------+----------+ | dtlb_walk | 1111 | 1301 | 1229 | 1166 | 1771 | 1315.6 | -23.08% | +----------------+--------+--------+--------+--------+--------+----------+----------+ | l1d_tlb | 257462 | 257420 | 257241 | 259968 | 261324 | 258683.0 | +1.73% | +----------------+--------+--------+--------+--------+--------+----------+----------+ | l1d_tlb_refill | 15954 | 15919 | 15948 | 15962 | 15968 | 15950.2 | -0.31% | +----------------+--------+--------+--------+--------+--------+----------+----------+ | l2d_tlb_refill | 2672 | 2558 | 2801 | 2478 | 4147 | 2931.2 | -38.88% | +----------------+--------+--------+--------+--------+--------+----------+----------+