Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2325452imm; Fri, 7 Sep 2018 14:42:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbwPpWBf+7w1HNBQmIkj0sAEdrtakSmX1Rf3ReacbeDnZEZ4mNCvA/XPr9MFukRshLzA0xk X-Received: by 2002:a62:808c:: with SMTP id j134-v6mr10763605pfd.120.1536356529540; Fri, 07 Sep 2018 14:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356529; cv=none; d=google.com; s=arc-20160816; b=zU7cZEHVi0pCnkR4pQuZNjmFGSiKhdOkWmRhVtGNXzPKYpFKeM+skv6Zbwp3Nm1Jz8 gwaVo30tJwY1EuXx6FnxhFklxQ9bNvYTtd4lVEXydd7MTe3tkJPJowkymFW9Cp9dh13R kxNowSaOfxaIPJT4Ks7Gw8TVFF0yUNE5IofP+2dIRNyT9nCOo3RwTGvZj+ytLrhy76pY i8vZ4zlvsYqqLrLbbyd0/70hh9iN8FKUIQXBrHPJDiBRKXOfw5PbcR/IH3oQ1soBkxD2 WBGozj+HkFyRfn73oubafcBAUa6DP0AcNwXIXDhB6Nn05qcQMiDQsG1JSH4Uw7n/M8TF H3Aw== 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=yQC/Xxq/xGzBcQZTm++gfKWGiSON8fe61/7yHalHGwc=; b=x1WKSGC8Kl44SCsfGHo+xwrXzuf7RSjwtghcWpoTp0Ypza2c4RmFrpD8ekdoWMjsXE tckG6ttoxtw0iGz1TwxwNGH1AKVp0iLzJ3AmTHtvktinMY6cVTzKhrfmDI8vq/1Zxsnw zaiPqOqEa5yUC8r9a2OVtbUnXJhZdgRxhaciy93ta2Bph+a0XONcYsO4yEz8LMIQNfkf mdakSPHUxR4j/v+14K/HGWys+S6wTHRwkfVD/Kky8KYyMmHzBILy2OsBR4brTzkaMUCK uO65J2OaEWxeiaOrCxQqlqP1VYZO2sMjEPtDPUuuEWW9a0mUs+RlZaafZYe6QO8EepVk WnWA== 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 e7-v6si9354098pgc.233.2018.09.07.14.41.54; Fri, 07 Sep 2018 14:42:09 -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 S1730154AbeIHCXo (ORCPT + 99 others); Fri, 7 Sep 2018 22:23:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54688 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728473AbeIHCXn (ORCPT ); Fri, 7 Sep 2018 22:23:43 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B279E1010; Fri, 7 Sep 2018 21:40:47 +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 4.4 29/47] mm/tlb: Remove tlb_remove_table() non-concurrent condition Date: Fri, 7 Sep 2018 23:10:25 +0200 Message-Id: <20180907210907.796949765@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210904.607934824@linuxfoundation.org> References: <20180907210904.607934824@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 4.4-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 @@ -361,15 +361,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) {