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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D4F8C32771 for ; Mon, 19 Sep 2022 02:46:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0C086B0072; Sun, 18 Sep 2022 22:46:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBAA16B0073; Sun, 18 Sep 2022 22:46:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B82AA940007; Sun, 18 Sep 2022 22:46:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A921B6B0072 for ; Sun, 18 Sep 2022 22:46:45 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 79C011209A0 for ; Mon, 19 Sep 2022 02:46:45 +0000 (UTC) X-FDA: 79927297170.01.FA028BF Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf26.hostedemail.com (Postfix) with ESMTP id EBE99140006 for ; Mon, 19 Sep 2022 02:46:44 +0000 (UTC) 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 72BE613D5; Sun, 18 Sep 2022 19:46:50 -0700 (PDT) Received: from [10.162.41.7] (unknown [10.162.41.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 053413F5A1; Sun, 18 Sep 2022 19:46:34 -0700 (PDT) Message-ID: <7403e6bb-0011-381b-a99e-cbd9d7b1a270@arm.com> Date: Mon, 19 Sep 2022 08:16:32 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation Content-Language: en-US To: Nadav Amit , Barry Song <21cnbao@gmail.com> Cc: Yicong Yang , Andrew Morton , Linux MM , "linux-arm-kernel@lists.infradead.org" , "x86@kernel.org" , "catalin.marinas@arm.com" , Will Deacon , "linux-doc@vger.kernel.org" , "corbet@lwn.net" , "peterz@infradead.org" , "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , "darren@os.amperecomputing.com" , "yangyicong@hisilicon.com" , "huzhanyuan@oppo.com" , "lipeifeng@oppo.com" , "zhangshiming@oppo.com" , "guojian@oppo.com" , "realmz6@gmail.com" , "linux-mips@vger.kernel.org" , "openrisc@lists.librecores.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-riscv@lists.infradead.org" , "linux-s390@vger.kernel.org" , "wangkefeng.wang@huawei.com" , "xhao@linux.alibaba.com" , "prime.zeng@hisilicon.com" , Barry Song , Mel Gorman References: <20220822082120.8347-1-yangyicong@huawei.com> <20220822082120.8347-5-yangyicong@huawei.com> <1e8642d5-0e2d-5747-d0d2-5aa0817ea4af@arm.com> <1125554b-c183-23c4-5516-95b918a761cc@arm.com> <2AB9EC05-16B4-46F8-B716-53941C1C9A50@vmware.com> From: Anshuman Khandual In-Reply-To: <2AB9EC05-16B4-46F8-B716-53941C1C9A50@vmware.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663555605; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CvSYQMBmGkyg42GaPIwdG9Wkhc3ASNm0FyuLG63pD50=; b=Rrk8WPJ/e5m7A99I+YL4eZVLIqjQr6Ew/roJxScnGnv5QHrRcm+E0QFC3ly4HOnQUnTQ1Q iDfSHBrAna2TeRVlpToIojKNvoZacpMv12PP9y6CvlazsXDXgV9KFbM1dz/02Qw6zhGr2g bRKy5CeHz+Eu0TVlzHjXMWqr6wXiHy4= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf26.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663555605; a=rsa-sha256; cv=none; b=jI+asg87ayxruXTCF+6zHsswb3A3mhE+tJ9xC9UPau5iCYFTTKEOnnL6cjcq2ELh3PQTul jAUSQK4umX2i+dPpClo11Mk5ICJa5fPltgEJTnIcMp8xc2EcqlD2fQckZ9KB4+ZLIoRRUr L1Zq8uhBEAeM7srZ1kHsq0K9GJKSMc0= Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf26.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Rspam-User: X-Stat-Signature: 94mc6p15ytwib8n8fyaukx9nu1d6hc1p X-Rspamd-Queue-Id: EBE99140006 X-Rspamd-Server: rspam12 X-HE-Tag: 1663555604-929818 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/15/22 20:01, Nadav Amit wrote: > > >> On Sep 14, 2022, at 11:42 PM, Barry Song <21cnbao@gmail.com> wrote: >> >>> >>> The very idea behind TLB deferral is the opportunity it (might) provide >>> to accumulate address ranges and cpu masks so that individual TLB flush >>> can be replaced with a more cost effective range based TLB flush. Hence >>> I guess unless address range or cpumask based cost effective TLB flush >>> is available, deferral does not improve the unmap performance as much. >> >> >> After sending tlbi, if we wait for the completion of tlbi, we have to get Ack >> from all cpus in the system, tlbi is not scalable. The point here is that we >> avoid waiting for each individual TLBi. Alternatively, they are batched. If >> you read the benchmark in the commit log, you can find the great decline >> in the cost to swap out a page. > > Just a minor correction: arch_tlbbatch_flush() does not collect ranges. > On x86 it only accumulate CPU mask. Thanks Nadav for the clarification.