Received: by 10.223.185.116 with SMTP id b49csp3213047wrg; Mon, 5 Mar 2018 16:41:16 -0800 (PST) X-Google-Smtp-Source: AG47ELvskvkn8nvYYlK/ijoOi0Im0vtCKyBAOUJQfDcaNJxlSwVTCoHyAhpEHw+BJlKj5vRIpaB7 X-Received: by 10.98.21.200 with SMTP id 191mr16932033pfv.166.1520296876847; Mon, 05 Mar 2018 16:41:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520296876; cv=none; d=google.com; s=arc-20160816; b=PYIE7Psy01U06QgDd9H1oDP/Gzz3iO8Nu0JbzxQ5TNuJDJKbj2E6FlhCm0YqQUTcnD dom+cXgbjIhi3IoaD5/zhysLhAuR6Q0861BoVfjOZVE4WDflZR5AG1BuVyDV8JDvtqSw vRZXytr+GpkEcbO0MyGOwaoK5iuu0tbMYV+DFYnJ1Rra2Kw4Vg/yBV/lsXrHzyHSPM1d 0H2uSrPM2r+BTQ/8UajLXphYIqAQvrL8njFNh+XVxYEFZCe5DU5BaDZAtYWHNbudVJjy H0rliMiBmoDIUWvrPeEdzEz1Ri17rEs9DY0tBTbAO2Z0NFDHBcpm8KoIwAHq77wterpt 7U8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=otHhPS2Xtqdl+OJrvNJSD0ms96hggNmFVdjQtPvXJzU=; b=CVSnNOiA+sPHzkiI9TOdOcEypl1d+elzYFsg32wn7FRN+wBpTJnR1/fYhDixjImUAW c04sf4TUZLyEILpnr/ypTad6ZKM7P6jZ+Vrw+grzo5wnyy7YKo8z7n0Uxtj9KqcTheaa ExvnQSHgGeqkDOy4feuTBbYjT5KMIX4f9+YGMcBntGMWErK80tAzGNVUmMPjU6sEiJM/ 5b4hHcX9qCLlMlBXKQBOImxp+UCoGXVyE6CmTNVeNP8lXW4g+9xSlYge+qzu8niufP1v bqpEKoPkD+obBi862plbEIVAHHrap5WS4FiLSKRahywyslv4p7kUjZRqJ2GO4orRqBi4 DNaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=KW5JbozY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l91-v6si10127236plb.345.2018.03.05.16.41.03; Mon, 05 Mar 2018 16:41:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=KW5JbozY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933273AbeCFAjk (ORCPT + 99 others); Mon, 5 Mar 2018 19:39:40 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:42662 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932984AbeCFA0Q (ORCPT ); Mon, 5 Mar 2018 19:26:16 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w260LuS4073996; Tue, 6 Mar 2018 00:26:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=otHhPS2Xtqdl+OJrvNJSD0ms96hggNmFVdjQtPvXJzU=; b=KW5JbozYC+qqwUvd4KYXFSv6OyqU9O4wZSsEp9EJXa3Tt+Ctz+JmGzSftl2V7y0HPgW0 jpPFcOuDrn88m+Lt1wVlpVIUUq1ocJujNUBhlGevw9oewbSLjQkvyxsD1Gl0T1mgU080 w/1JGmUxqaAMOyi5+eMIoXgJCkWFHHtwh70jcUpL+VkTpzHN7pUsPMVafeFbHI+uR+mY swwmBQpyfIIXMPJezSSiDID0xKjlR0YxAw2SvRbJKWThCnEC7lL119BkAgst0HLUmWwQ LcYGnxswC+LUtA5ZIw+uwO7F8EEheSDDXXAczUHaS9HSrxaqgZbnPURdXzObODGQF5HN 7g== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2ghe5xgeys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Mar 2018 00:26:11 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w260QALB024907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Mar 2018 00:26:10 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w260QAHZ032665; Tue, 6 Mar 2018 00:26:10 GMT Received: from localhost.localdomain (/98.216.35.41) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 16:26:10 -0800 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux-kernel@vger.kernel.org, Alexander.Levin@microsoft.com, dan.j.williams@intel.com, sathyanarayanan.kuppuswamy@intel.com, pankaj.laxminarayan.bharadiya@intel.com, akuster@mvista.com, cminyard@mvista.com, pasha.tatashin@oracle.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Subject: [PATCH 4.1 14/65] x86/mm: Remove flush_tlb() and flush_tlb_current_task() Date: Mon, 5 Mar 2018 19:24:47 -0500 Message-Id: <20180306002538.1761-15-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180306002538.1761-1-pasha.tatashin@oracle.com> References: <20180306002538.1761-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8823 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803060003 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Lutomirski commit 29961b59a51f8c6838a26a45e871a7ed6771809b upstream. I was trying to figure out what how flush_tlb_current_task() would possibly work correctly if current->mm != current->active_mm, but I realized I could spare myself the effort: it has no callers except the unused flush_tlb() macro. Signed-off-by: Andy Lutomirski Cc: Andrew Morton Cc: Borislav Petkov Cc: Brian Gerst Cc: Dave Hansen Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Michal Hocko Cc: Nadav Amit Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/e52d64c11690f85e9f1d69d7b48cc2269cd2e94b.1492844372.git.luto@kernel.org Signed-off-by: Ingo Molnar Cc: Hugh Dickins Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 227d6f0e79f809e448d3157fbfd00eb54dcbb54e) Signed-off-by: Pavel Tatashin --- arch/x86/include/asm/tlbflush.h | 9 --------- arch/x86/mm/tlb.c | 17 ----------------- 2 files changed, 26 deletions(-) diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h index 433eeaafe498..d9ee4674c235 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h @@ -197,7 +197,6 @@ static inline void __flush_tlb_one(unsigned long addr) /* * TLB flushing: * - * - flush_tlb() flushes the current mm struct TLBs * - flush_tlb_all() flushes all processes TLBs * - flush_tlb_mm(mm) flushes the specified mm context TLB's * - flush_tlb_page(vma, vmaddr) flushes one page @@ -229,11 +228,6 @@ static inline void flush_tlb_all(void) __flush_tlb_all(); } -static inline void flush_tlb(void) -{ - __flush_tlb_up(); -} - static inline void local_flush_tlb(void) { __flush_tlb_up(); @@ -295,14 +289,11 @@ static inline void flush_tlb_kernel_range(unsigned long start, flush_tlb_mm_range(vma->vm_mm, start, end, vma->vm_flags) extern void flush_tlb_all(void); -extern void flush_tlb_current_task(void); extern void flush_tlb_page(struct vm_area_struct *, unsigned long); extern void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, unsigned long end, unsigned long vmflag); extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); -#define flush_tlb() flush_tlb_current_task() - void native_flush_tlb_others(const struct cpumask *cpumask, struct mm_struct *mm, unsigned long start, unsigned long end); diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 4ce6569ad963..262abde154eb 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -265,23 +265,6 @@ void native_flush_tlb_others(const struct cpumask *cpumask, smp_call_function_many(cpumask, flush_tlb_func, &info, 1); } -void flush_tlb_current_task(void) -{ - struct mm_struct *mm = current->mm; - - preempt_disable(); - - count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); - - /* This is an implicit full barrier that synchronizes with switch_mm. */ - local_flush_tlb(); - - trace_tlb_flush(TLB_LOCAL_SHOOTDOWN, TLB_FLUSH_ALL); - if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids) - flush_tlb_others(mm_cpumask(mm), mm, 0UL, TLB_FLUSH_ALL); - preempt_enable(); -} - /* * See Documentation/x86/tlb.txt for details. We choose 33 * because it is large enough to cover the vast majority (at -- 2.16.2