Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp544094ybg; Mon, 1 Jun 2020 08:03:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzLHbufkb6ndhP9b+FLn7OscradqZqaapTRwsDMP1Jr6GQcpOveVvcABKJYu9EtNpGaJpG X-Received: by 2002:a17:906:5a99:: with SMTP id l25mr20432977ejq.235.1591023795675; Mon, 01 Jun 2020 08:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591023795; cv=none; d=google.com; s=arc-20160816; b=ntMgA4CnjhUIr1W83/BpjLbfaOIreG8p5Y9POk9TJHgROXLaH3v+gLHoot2k7vIJ9A 8swaH//fN3zA9HFb6qbgmmYZ3VaF6mvrM84yOByxfZK3sA1zlacUFiIVi2A+Elb/fq46 Lzlr9/5vkLt3WzJDnGkOw7jgIpeowdUNu/T9JHTJ9+6NAqdMnFXUlw7F1okEgwRUaFuP 9tmd3G94ryfX93yY3Bo0r5HajsZVyRmSV3FPcFHCmg45K4ItxcD9y0R7jvw6eLNCQIwO wDfBVkZhK+ZpnkNbj/fwkR8EW5CQOWeC0k5TNIM0XScotWp2rTpjuiP8Rce3+q1ONDzL sFlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=kcXt2Bxssr5u+ywfJhr6psN1l1K1QHL/GP+fwfg0l9o=; b=PSfm8a9I6lRS5n/JofXNV4iCSi78jJQZc9wiKgQbYunZoHeKSAvQwFup8VTPx56PYu 4qaCdSixLzXOn2L0ZXMrNadQwaLzPKh2HMIHSLwqQTUZjd2OHJabxS5Z2SZgIa/KiYBk U6rgxtpgqWo7XOY3HRXJS+lre4Yn+MQufn4066fB06Nhn7CGanA2qx05La/METHUrAbE VZKTg40GKsVzlFoFX3Gh64P6WSMDim8JbrRwGg3WaLBcx+0OpyO9OR+PGKJQcquXG8ey UuuuqAW0rMGHB1x3ZL4WMXlbuCUfGl9C76yG/8KjFA4XXzM4EcagI+Jb5k8KPBgnUgm4 e6Yg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f2si8625601ejf.0.2020.06.01.08.02.50; Mon, 01 Jun 2020 08:03:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgFAO5t (ORCPT + 99 others); Mon, 1 Jun 2020 10:57:49 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5323 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726067AbgFAO5s (ORCPT ); Mon, 1 Jun 2020 10:57:48 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1D32A44F0A1957BAB3EB; Mon, 1 Jun 2020 22:57:46 +0800 (CST) Received: from [127.0.0.1] (10.173.220.25) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Mon, 1 Jun 2020 22:57:36 +0800 Subject: Re: [RFC PATCH v3 2/2] arm64: tlb: Use the TLBI RANGE feature in arm64 To: Catalin Marinas CC: , , , , , , , , , , , , , , References: <20200414112835.1121-1-yezhenyu2@huawei.com> <20200414112835.1121-3-yezhenyu2@huawei.com> <20200514152840.GC1907@gaia> <54468aae-dbb1-66bd-c633-82fc75936206@huawei.com> <20200520170759.GE18302@gaia> From: Zhenyu Ye Message-ID: Date: Mon, 1 Jun 2020 22:57:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20200520170759.GE18302@gaia> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.173.220.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Catalin, I have sent the v4 of this series [1] and combine the two function with a single loop. See codes for details. [1] https://lore.kernel.org/linux-arm-kernel/20200601144713.2222-1-yezhenyu2@huawei.com/ On 2020/5/21 1:08, Catalin Marinas wrote: >> This optimization is only effective when the range is a multiple of 256KB >> (when the page size is 4KB), and I'm worried about the performance >> of ilog2(). I traced the __flush_tlb_range() last year and found that in >> most cases the range is less than 256K (see details in [1]). > > THP or hugetlbfs would exercise bigger strides but I guess it depends on > the use-case. ilog2() should be reduced to a few instructions on arm64 > AFAICT (haven't tried but it should use the CLZ instruction). > Not bigger than 256K, but the range must be a integer multiple of 256KB, so I still start from scale 0. Thanks, Zhenyu