Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp79948rdb; Wed, 7 Feb 2024 22:27:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVOGnVMzn0l7pNzXZrfD/LORhDxwKR8rfzNl8ylyAX7mzvZwQKUmdgsbKQ2cNJtgEyB6eZM48z3EZ7d+G2aSqtAqjUp52r5Bxrk9/zDow== X-Google-Smtp-Source: AGHT+IEmXEvkLL31ftYqNj4XErKBwRTiIbvaMZYlPTujPfhmU0NL93NUejSo8oPQMrqgupyFC6RH X-Received: by 2002:a17:907:9726:b0:a31:1154:89a9 with SMTP id jg38-20020a170907972600b00a31115489a9mr7391429ejc.26.1707373641752; Wed, 07 Feb 2024 22:27:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707373641; cv=pass; d=google.com; s=arc-20160816; b=uCk68nm8KSv8UV35mpYDA/qlVHB52XSNapHFI44XiD8HR6X/3FURErs4thbfPj/KpZ JRLwGX1biG846/R2ogsUbEp+7Np0D4QiJUxXQzbqdRM/xk1/4mSLTYVlC92LPS/8ZuDH 6f/sTopoI+y7qOcPcsxyCrmhudR1C3r6mLlE8bJaGL0HlgjEIBQ08pNZZjSdA1T06u+C ujBu3ZjPWuN7GsRffWYbvqxmnca9zGwHrJk0XMgeC9PUKSadC2waS70izkhr9BplcUVs AiVCqxjCAX+hlHGWcFgA/iaH/NYR7g4HjouuBvx48ft88I/S0YFxpv8kNhJq++V5kMSs aRBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from; bh=JD5mtfEWkRjuaUV9XVtob8Xf345yQ1B8wbzU19SAuqU=; fh=Cd5yH+iyhAc3ndRTKefXrWo3eyOIToRrL5cGllCLBGI=; b=Ne2J3qUAfT4/L4iTVWr5fv51q7JGys+vEQlpytVDn6RdzJQeAZZJi2wlp0Ih5WkGve R1RHvSTqPPrmsO8oojG8uS2EyTp4hveOWM9jSj8ieu926DrDqO00NQ/Ao2PnP9agjnf9 Gv8hZoCTxzhguznH9bUASL9TF4AR+8BGPtqFFxPszUJgoo8U5eM6LSJbm2C2Oa5xYZDm 7pWH4xKKlP2QcE+c9+GnetCvPpCuESSv1YRCOdShTt90WlM7NOCao9aDmIr7uMMfMdPY j37LEPVyy8DaetGDHBHe2Kpt8JIWhTV1UtKxiqnUqrJhHZGJJtxihdTuQ+lkjq9Qiv+E 6AOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-57517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57517-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCU9+lSLuhFJKUncD+PsnTxoRHWfm5E38FdGMwyU+qOG6iTKnX/B0a2CCcCeHBMkX8lek6Yb4fcKqKZNrIVswTlibJluj/etSDkIpg7N/g== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id um8-20020a170906cf8800b00a37bd9cf8d4si1816044ejb.375.2024.02.07.22.27.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 22:27:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-57517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57517-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7DE9F1F2245D for ; Thu, 8 Feb 2024 06:27:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0653A69D30; Thu, 8 Feb 2024 06:26:30 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04CB367E78 for ; Thu, 8 Feb 2024 06:26:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707373589; cv=none; b=DytJG99ZsCXCwph6eafBuYKNHJVIBpQRoJhtq2556wCVymYics5yAo0K3LNPJOF9VCHWQDtU8iECx6OnuMkkqIR1Hc4KWp1y9dBeP0rgNDEwMBc7fJnyzxNHAYm1n47y8UhuM284m2B7RpNh8UHRU9n+FUzbm2BYjM2DnCtV5jU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707373589; c=relaxed/simple; bh=o7dB2cnQ4DdAIbh4UuP8+5q3qGaOJJ7booLY7nqK98M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=CME3MiiG7BIsUyFB6tqzAYUNBcEP3KDBq61nkpk0KJSibbuejffSi8+3BafiWmbNXm441YC2pGa3XpmhCr7cTUqmLG1VYdQzQA9HK/es8mP914/paVMEwly7Yl7kdsNrIYdZ6+lUY26Nd35BOSoOlazduhZpn5tZx7HrTJLWgJ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-d85ff70000001748-81-65c4740bb40b 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: [RESEND PATCH v7 4/8] x86/tlb, mm/rmap: Separate arch_tlbbatch_clear() out of arch_tlbbatch_flush() Date: Thu, 8 Feb 2024 15:26:04 +0900 Message-Id: <20240208062608.44351-5-byungchul@sk.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240208062608.44351-1-byungchul@sk.com> References: <20240208062608.44351-1-byungchul@sk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRmVeSWpSXmKPExsXC9ZZnkS53yZFUg6sTRCzmrF/DZvF5wz82 ixcb2hktvq7/xWzx9FMfi8XlXXPYLO6t+c9qcX7XWlaLHUv3MVlcOrCAyeL6roeMFsd7DzBZ zL/3mc1i86apzBbHp0xltPj9A6jj5KzJLA6CHt9b+1g8ds66y+6xYFOpx+YVWh6L97xk8ti0 qpPNY9OnSewe786dY/c4MeM3i8e8k4Ee7/ddZfPY+svOo3HqNTaPz5vkPN7Nf8sWwB/FZZOS mpNZllqkb5fAlXH0zj22gjmcFed/TWVqYLzE3sXIySEhYCJx+tMfJhj7V/cfRhCbTUBd4saN n8wgtoiAmcTB1j9A9VwczAIfmSRWf+9gAUkIC+RI3GxfzQZiswioSsy8/wVsEK+AqUTr4llQ C+QlVm84ADaIE2jQzm2nWEFsIaCaF7Mns4EMlRBoZpc43/2AFaJBUuLgihssExh5FzAyrGIU yswry03MzDHRy6jMy6zQS87P3cQIjIhltX+idzB+uhB8iFGAg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AN276tXve9odtFlun84o9f/smb82Vl6leeQrenDzqXeW0x r1kxO6y9fY1QpDXPdb0m2zdMSizFGYmGWsxFxYkAJNj2imsCAAA= X-CFilter-Loop: Reflected Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.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; } -- 2.17.1