Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp957738rdb; Sun, 18 Feb 2024 22:05:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWhF+bAMItWioS8o7njAdM6qUMnEUOKQhcHrCgfD2U08viFvKLs1d9I2+6GG+MPd1so75LM68cA2eRgmcIhOkEdLf2YfSOv54S6y1yN3Q== X-Google-Smtp-Source: AGHT+IEth9AG0CiEKOhosv/JzGS3laj/qRghT77DVsqxkBtMJkDLmqR+QJ4ooVS2XIWIHu11G9xD X-Received: by 2002:a17:906:3558:b0:a3e:9547:a390 with SMTP id s24-20020a170906355800b00a3e9547a390mr1083785eja.69.1708322718490; Sun, 18 Feb 2024 22:05:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708322718; cv=pass; d=google.com; s=arc-20160816; b=aD3KyQhEk4PUeQElkcnWoW8WIBh7uzpuxbX4tJn0zNyte+OoOdMKMWNkD20bz2FQgs h0LrsQuNnC63kOYoD+0j3heyF1Rvy95IzKDq8wqVqMvpaDLrND+pLIInHfNgHcT+k3PU zSduhXapG/EN7MgPEe5r+VXWkDyUUSPiT9U7XNEuonKBS8cYaJJ9fZg7bKwDWQqsT/uI 2+B4uxaSH7h41dVVVT4pPQ2wB1TqOKp/BwppXukH0rN5RwXURw6XfoTFUHa1Lu1fmOER uGvo4WyR0oNahuuLO6ufsewPZHPE2FtOa9bveXkp/LW41Spw9nFRMaEiMipZLcgMUmjQ lSYg== 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=I/fJb8ryqmmGEnsMy9AhDuMN2ego/v5YAM2Gbv30rAg=; b=JSHlSLNgVuCM7TakvSDUQ7YS4RhcM2FgF1uSIHHInWuCBSJEfoDd6MXlEN8TuYpb+w T2gYTkcIwPCQbiQfTb+M0I9W/WbIqdwjACu9g2KB5Mo2YPoX60hGxl3yE6taes6A3cAt y+5Wv4KfOMk89DfeenMobRxMItSvz7WL7RkCCdHqQyZzDnbQQnoEP24QVen6gF3R14mu kahCYXDWtS0TD0uW2CuKisqvRGKlP7z13QK7k6zf6p8Jtx9kBKB5Wo2fLE15d5IwGcYD AlKnjDqZOHSGAX4ugobqeLF9Mcf5CcxuHF5ZehVzMeGT8u4330BZijstpYOt6RJeTJN4 sFlg==; 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-70752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70752-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id sd20-20020a170906ce3400b00a3e60f8f818si1131960ejb.735.2024.02.18.22.05.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 22:05:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-70752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70752-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 4177A1F2269D for ; Mon, 19 Feb 2024 06:05:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D87D20B29; Mon, 19 Feb 2024 06:04:35 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BB703FE1 for ; Mon, 19 Feb 2024 06:04:27 +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=1708322674; cv=none; b=A9tL2uNCt37CMYdFrAextFqtGDGhkTzXPwYJb8awwuYKMWAWRCrvlDzQqxR288tXTxRYaLp/Q4cSc8kggQEmYrxaTE6Ad+6jL2Uf/B5W8WNq96ttHRFOD2+YDB6+3BIlzfW+avxd3RdJFRVEoxWn07F5rlTb672tVsslP7RW9ls= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708322674; c=relaxed/simple; bh=o7dB2cnQ4DdAIbh4UuP8+5q3qGaOJJ7booLY7nqK98M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=IF2pEtPazno12pGaN/vc6/89hZbKBV0HfzcIyi4N5wx4BjVATcx34zfLQwnwmkt6Qc4JQO8IRaoDskdT35cPCYkr5taAL+VVYP5xn2Z2LAIvRV7T+GduWrA+LP9qW+DtSXWdendGJus2qJm2yJ1jKdQWM0K7Da+J3yW6dhtJtMw= 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-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-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPLMWRmVeSWpSXmKPExsXC9ZZnkW7i+0upBhdXGlrMWb+GzeLzhn9s Fi82tDNafF3/i9ni6ac+FovLu+awWdxb85/V4vyutawWO5buY7K4dGABk8X1XQ8ZLY73HmCy mH/vM5vF5k1TmS2OT5nKaPH7B1DHyVmTWRwEPb639rF47Jx1l91jwaZSj80rtDwW73nJ5LFp VSebx6ZPk9g93p07x+5xYsZvFo95JwM93u+7yuax9ZedR+PUa2wenzfJebyb/5YtgD+KyyYl NSezLLVI3y6BK+PonXtsBXM4K87/msrUwHiJvYuRk0NCwETi7IsPrDD2u5sXmUBsNgF1iRs3 fjKD2CICZhIHW/8A1XNxMAt8ZJJY/b2DBSQhLJAqseTLQcYuRg4OFgFVie6jASBhXgFTiWsL /jJCzJSXWL3hADNICSfQnN0HhUDCQkAlJ65OZgIZKSHQzi6xev9DNoh6SYmDK26wTGDkXcDI sIpRKDOvLDcxM8dEL6MyL7NCLzk/dxMjMBqW1f6J3sH46ULwIUYBDkYlHt4MkUupQqyJZcWV uYcYJTiYlUR43ZsupArxpiRWVqUW5ccXleakFh9ilOZgURLnNfpWniIkkJ5YkpqdmlqQWgST ZeLglGpg7Jtfuu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op: 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