From patchwork Mon Feb 19 06:04:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byungchul Park X-Patchwork-Id: 13562183 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 B47D2C48260 for ; Mon, 19 Feb 2024 06:04:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B18466B0085; Mon, 19 Feb 2024 01:04:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FE1B6B0088; Mon, 19 Feb 2024 01:04:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 850CF6B008C; Mon, 19 Feb 2024 01:04:27 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6F82F6B0085 for ; Mon, 19 Feb 2024 01:04:27 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 24085A0264 for ; Mon, 19 Feb 2024 06:04:27 +0000 (UTC) X-FDA: 81807513774.09.E98CF9C Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf18.hostedemail.com (Postfix) with ESMTP id 7262B1C0008 for ; Mon, 19 Feb 2024 06:04:25 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708322665; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=JD5mtfEWkRjuaUV9XVtob8Xf345yQ1B8wbzU19SAuqU=; b=gAXoIsH/Qc4SvmWQxerRZnv2/vjstz5yPaXXpO845A9h6Oho2opkAFBAIwN9fbG+C382UK E47zHUTibPAJCeE/f5bK255Q9bTvLKdmMSIPbnMpX67cLHpdYpHeB1RuKz5KeCkI4Gag72 /EeKNQrE31FnqXqa2WxfFlRZpolham4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708322665; a=rsa-sha256; cv=none; b=cFHKVswjHQ4WOG329bs+Ck5AADz8YPGGGcnog8oB2Ca40uRYmHW6T+gHeGPQN6Tp6wH5w5 Z/RtkE5dGIwM6dkfdaszoJpsZH5xOftugSKnxRtI8Q5CaJOvIE25gOv+PdYRdiB8/z8/hW wjagF57nZTgrDfs80A0WrZm8gyE6WFI= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com; dmarc=none X-AuditID: a67dfc5b-d6dff70000001748-cc-65d2ef61944a From: Byungchul Park To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: kernel_team@skhynix.com, akpm@linux-foundation.org, ying.huang@intel.com, namit@vmware.com, vernhao@tencent.com, mgorman@techsingularity.net, hughd@google.com, willy@infradead.org, david@redhat.com, peterz@infradead.org, luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, rjgolo@gmail.com Subject: [PATCH v8 4/8] x86/tlb, mm/rmap: Separate arch_tlbbatch_clear() out of arch_tlbbatch_flush() Date: Mon, 19 Feb 2024 15:04:03 +0900 Message-Id: <20240219060407.25254-5-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240219060407.25254-1-byungchul@sk.com> References: <20240219060407.25254-1-byungchul@sk.com> X-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eCTaUem1doeSze 85LJY9OqTjaPTZ8msXu8O3eO3ePEjN8sHvNOBnq833eVzWPxiw9MHlt/2Xk0Tr3G5vF5k5zH u/lv2QIEorhsUlJzMstSi/TtErgyjt65x1Ywh7Pi/K+pTA2Ml9i7GDk5JARMJN7dvMgEYrMJ qEvcuPGTGcQWETCTONj6B6iGi4NZ4COTxOrvHSwgCWGBVIklXw4ydjFycLAIqEp0Hw0ACfMK mEpcW/CXEWKmvMTqDQeYQUo4gebsPigEEhYCKjlxdTLTBEauBYwMqxhFMvPKchMzc0z1irMz KvMyK/SS83M3MQJDe1ntn4k7GL9cdj/EKMDBqMTDmyFyKVWINbGsuDL3EKMEB7OSCK9704VU Id6UxMqq1KL8+KLSnNTiQ4zSHCxK4rxe4akJQgLpiSWp2ampBalFMFkmDk6pBsamzamHwoue 9HD822LlxrN/Z4ZrsL3Y5t3pB2qLz2j/+F7t9vWkqnDkyweCp+Zc+u/TwOSztuTpkvsH7R/s qp94Y/+RJ0tLj31mOv0u5eQ9zbm9z/M5AkR5NV8W9s6Zvo5FIv7v9RxOyVV74zg4bDjsEhkm f4icdm7WlZfe4mdsb3q8Njv0ny9TiaU4I9FQi7moOBEAFcVlHGkCAAA= X-CFilter-Loop: Reflected X-Stat-Signature: gjeesc3ifosukoshby979m3389rbke3u X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 7262B1C0008 X-Rspam-User: X-HE-Tag: 1708322665-517262 X-HE-Meta: U2FsdGVkX19azO8VVzBkymSB2g9rVNaEyG28hT/eo3VER0pOR5DoE9Fmqtg3AVJiGRjFDxX4kmeCRgqhaBs2GKdn3ypKwy56DfXS7ggCY+0SvW480ZEdU/yr5mQcdiUSQeXI2FTyBeEhKVRHlkfiRE73hAIuXNwZrDq8qUHGWcUNTK/ak7BbEgXZ0pFeEBbq8DAJlH4ygOzW55M5GZI3jDwkjUBcVglQIIqe4O+rFQCL99GwndiYQT98tyaMsqK0+tspq4cf9/tdCePecOO5pIdbPJsQ6wURR0zos8OSDANXlJcWagfz9pg19K9K87w1PpNEx5Fde0AQfHhJBgV0cBw2lgAfnBgRE+vJXuW6y3z0PTlDZov8YZeXAIAhqNV6fPgVP29aT2xB60NgWAzVdWwFIPtjAaA9t6mN1Ym9PwDECtHoduQ3ayR5dVIRUZgO8FR84jVntpL07Gz2SfUZTPA16NzROHkieF85gzM2BK7ONJfpmLgIj9gPt5WU+FzeFj1xvr6rS6qBKhh+Uho2+uHvA58P/8l9b2bmaZojTnZxh6TIig9XsdSFgzbJ6BhiJkWQhQNnV7ZZ4DDilDNdPcxJGDh1EEeTk0S0XEefekbPsQ+V1zoAdYCpniTUz66fp2bfirr+oj5/qNodoMNbA71sJAGFTvB4NhxOuMVJOmRQEBgEakV1Qnmt0y1O91nkQggqC2zec+0ID5lIf4OC4o7FwemAcIpKJMQ/go2/lA4kqhL0t1RjAz9/w4C3rOIR 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: List-Subscribe: List-Unsubscribe: This is a preparation for migrc mechanism that requires to avoid redundant TLB flushes by manipulating tlb batch's arch data after arch_tlbbatch_flush(). However, we cannot because the data is getting cleared inside arch_tlbbatch_flush(). So separated the part clearing the tlb batch's arch data out of arch_tlbbatch_flush(). Signed-off-by: Byungchul Park --- arch/x86/mm/tlb.c | 2 -- mm/rmap.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 453ea95b667d..941f41df02f3 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -1268,8 +1268,6 @@ void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch) local_irq_enable(); } - cpumask_clear(&batch->cpumask); - put_flush_tlb_info(); put_cpu(); } diff --git a/mm/rmap.c b/mm/rmap.c index da36f23ff7b0..b484d659d0c1 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -643,6 +643,7 @@ void try_to_unmap_flush(void) return; arch_tlbbatch_flush(&tlb_ubc->arch); + arch_tlbbatch_clear(&tlb_ubc->arch); tlb_ubc->flush_required = false; tlb_ubc->writable = false; }