Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2328250imm; Fri, 7 Sep 2018 14:45:16 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda1+85UgapqKQrAvNsEEZIqEVvEI+VvYWfZm/+9hL+BMtzkXG08p9sfnlzKIGTIx4CrR2yS X-Received: by 2002:a63:2445:: with SMTP id k66-v6mr10452200pgk.405.1536356716575; Fri, 07 Sep 2018 14:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356716; cv=none; d=google.com; s=arc-20160816; b=WVaIpuqkva7mlBc326yChwg7oViF+4Q1BXm8xepPQJJXdvShlLE6V8vzBk/SlP+zae Amz6DQQwuek0StmIx1eMksNy1EtJUzhfILmDStJjIg45PY+uxi0rq6lpkWGo7FHvw1BX 8iUXAu0MPXNEUkt2vDOBLRrl6KuNcQkGEIJjFjXSn/7y/yHyLVHeoUKndyNjmbGtlOV/ givXUlc73dbKOm1T0mjig7l9U+iWG983iUNdQT9O9xD/wvOJb3xn5+A7ejrrEQ01ylZm qQML6O3MH5psKVoh60zFt9VP8a0OgATBhPjDi0Gul6se9k8Kq68JKdLr/SP9UhHBS6bq Uekg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from; bh=W5Us6uayJZPDXpCZh/Ou08qd5XFHywLacYQuaMwMuyY=; b=UZ0uLZ1fUR8hzSVE0WJT5uI+MPBQtCcoPGHAMZm0DTY//1krfBulyby7e7YiFDwLfp AvqNOfdjZScAk0UCpaNd8xUOvRchc7PByK9tEEkysrzZzDbl8AKMImy4D3rk7eNs1mhr VX/2UjOBgtE/CCrvtpW3GoDb//wcM2fQ0bDatkkqXyllDqDPPMrxTxDqS1XJlsKZVQD6 wIdp/xjrDYhhGXTKlTo2kQY5SEbLCCqORGUqroGSXfT+/ysFypJ0604Y81L++Zl6tIP6 SSx6DEqsMPaA8IRkyKRH+EK9G1pfe/ECFjFdSMpjqbGG12gB69tHowZfOXCeN3xtCSIa cPiA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s25-v6si9265977pgd.539.2018.09.07.14.45.01; Fri, 07 Sep 2018 14:45:16 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730876AbeIHC0W (ORCPT + 99 others); Fri, 7 Sep 2018 22:26:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56894 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729993AbeIHC0W (ORCPT ); Fri, 7 Sep 2018 22:26:22 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E0C26BBF; Fri, 7 Sep 2018 21:43:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , "Peter Zijlstra (Intel)" , Rik van Riel , Nicholas Piggin , David Miller , Martin Schwidefsky , Michael Ellerman , stable@kernel.org, Linus Torvalds Subject: [PATCH 3.18 17/29] mm/tlb: Remove tlb_remove_table() non-concurrent condition Date: Fri, 7 Sep 2018 23:10:38 +0200 Message-Id: <20180907210910.759447458@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210909.523240901@linuxfoundation.org> References: <20180907210909.523240901@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Zijlstra commit a6f572084fbee8b30f91465f4a085d7a90901c57 upstream. Will noted that only checking mm_users is incorrect; we should also check mm_count in order to cover CPUs that have a lazy reference to this mm (and could do speculative TLB operations). If removing this turns out to be a performance issue, we can re-instate a more complete check, but in tlb_table_flush() eliding the call_rcu_sched(). Fixes: 267239116987 ("mm, powerpc: move the RCU page-table freeing into generic code") Reported-by: Will Deacon Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rik van Riel Acked-by: Will Deacon Cc: Nicholas Piggin Cc: David Miller Cc: Martin Schwidefsky Cc: Michael Ellerman Cc: stable@kernel.org Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/memory.c | 9 --------- 1 file changed, 9 deletions(-) --- a/mm/memory.c +++ b/mm/memory.c @@ -359,15 +359,6 @@ void tlb_remove_table(struct mmu_gather { struct mmu_table_batch **batch = &tlb->batch; - /* - * When there's less then two users of this mm there cannot be a - * concurrent page-table walk. - */ - if (atomic_read(&tlb->mm->mm_users) < 2) { - __tlb_remove_table(table); - return; - } - if (*batch == NULL) { *batch = (struct mmu_table_batch *)__get_free_page(GFP_NOWAIT | __GFP_NOWARN); if (*batch == NULL) {