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 2DE4EC6FA86 for ; Tue, 27 Sep 2022 09:15:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3053E8E00BB; Tue, 27 Sep 2022 05:15:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B4408E00AF; Tue, 27 Sep 2022 05:15:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1559A8E00BB; Tue, 27 Sep 2022 05:15:47 -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 061838E00AF for ; Tue, 27 Sep 2022 05:15:47 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BD1E0120DF8 for ; Tue, 27 Sep 2022 09:15:46 +0000 (UTC) X-FDA: 79957307892.03.EE8FE26 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf09.hostedemail.com (Postfix) with ESMTP id 0A93C140019 for ; Tue, 27 Sep 2022 09:15:45 +0000 (UTC) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4McDRd2xl3zpV3J; Tue, 27 Sep 2022 17:12:45 +0800 (CST) Received: from [10.67.102.169] (10.67.102.169) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 17:15:40 +0800 CC: , , , , , , , , , , , , , , , , , , , , Barry Song <21cnbao@gmail.com>, , , , Barry Song , Nadav Amit , Mel Gorman , , , Subject: Re: [PATCH v4 2/2] arm64: support batched/deferred tlb shootdown during page reclamation To: Anshuman Khandual References: <20220921084302.43631-1-yangyicong@huawei.com> <20220921084302.43631-3-yangyicong@huawei.com> <168eac93-a6ee-0b2e-12bb-4222eff24561@arm.com> From: Yicong Yang Message-ID: <8e391962-4e3a-5a56-64b4-78e8637e3b8c@huawei.com> Date: Tue, 27 Sep 2022 17:15:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <168eac93-a6ee-0b2e-12bb-4222eff24561@arm.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.169] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of yangyicong@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=yangyicong@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664270146; a=rsa-sha256; cv=none; b=GwlkvseYC7mBTdIRee3oOVinGlHf1kZtj/oz6EjniD5bnDSOmDzF4rA3OXEtivZrNWXhdx CxazrcE+5Wt1QIbfpwXay+hsCdLJc4RWllX+kzAmK07OK94eMKC70Tkfm32Sl83gUBcBum Sb3iqwpNcSPEsMZTTCqpvY3kMmRI1XU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664270146; 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=uSoRL0Fyc+97MB7IyekCZBm29e+tOoJB1Mu+fgX33us=; b=JyDJ3g9206u80Vkd4wlIv2wHji6bxEf5Ssa6vq7KDUl5xCs1gD+ACPB+y+6ttxoIuPrm// QfwCfUgZ0rRi0voZ8mjz9PsPiHOkua/Yis+emK+h/Cam+F67z42jTwx7/HVnjL255Nw3T7 DikskpwySnxpOdmN2tkke9G8UpcQLD8= X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 0A93C140019 X-Rspam-User: Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of yangyicong@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=yangyicong@huawei.com X-Stat-Signature: xmh85jyzx5p6y14as88d85k47sr1x6ih X-HE-Tag: 1664270145-597967 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 2022/9/27 14:16, Anshuman Khandual wrote: > [...] > > On 9/21/22 14:13, Yicong Yang wrote: >> +static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm) >> +{ >> + /* for small systems with small number of CPUs, TLB shootdown is cheap */ >> + if (num_online_cpus() <= 4) > > It would be great to have some more inputs from others, whether 4 (which should > to be codified into a macro e.g ARM64_NR_CPU_DEFERRED_TLB, or something similar) > is optimal for an wide range of arm64 platforms. > Do you prefer this macro to be static or make it configurable through kconfig then different platforms can make choice based on their own situations? It maybe hard to test on all the arm64 platforms. Thanks. >> + return false;> + >> +#ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI >> + if (unlikely(this_cpu_has_cap(ARM64_WORKAROUND_REPEAT_TLBI))) >> + return false; >> +#endif >> + >> + return true; >> +} >> + > > [...] > > . >