From patchwork Wed Jul 25 14:06:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 10544079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E694517FD for ; Wed, 25 Jul 2018 14:14:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5A842A07E for ; Wed, 25 Jul 2018 14:14:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9BBB2A0B5; Wed, 25 Jul 2018 14:14:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.4 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,SUSPICIOUS_RECIPS autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CA41A2A07E for ; Wed, 25 Jul 2018 14:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jgdNioMhPtvYb/4Y5cePYHLS84mObFohQBa5AJD2xSo=; b=Lsxnx5OfIhNEJpis5SdMPR3A/4 R3tk5tlrmMObrfT3SKmwNpkfIDHEgQ0ZxNEmMRuSdqzJ5J2QvVFm7TW6qLsyWM26dnD8Ki9vYfWRr +Ek2YZXFl6hqLNOibcr/VCJZrt1yfyBa3obsGdZG1PHXIxqMVILv8+HfsytW+s0/A/ENUwC81wix6 3Rvrrfa7NBrA8Y1GuHgjvAdWda0bmqtXE2Lwtamwa0kAEm2oLOFdlOCUXN74wVimMw/ocHRN/DDF4 fu6D2hqDYw7xSL5PbzhREHS7ChEqBvj+Lu+XzkklYoZ4/WZaeuNLcdR2Xy9nvwTT0+7JIi4d5EAWQ qFV8G0tA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiKYF-0007OX-BF; Wed, 25 Jul 2018 14:14:03 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiKYB-0007MI-IS for linux-arm-kernel@lists.infradead.org; Wed, 25 Jul 2018 14:14:00 +0000 Received: by mail-pg1-x544.google.com with SMTP id f1-v6so5405740pgq.12 for ; Wed, 25 Jul 2018 07:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qIuwOscxl1EW4BeFkvSG6ETyVL4wwncYhTvemKPOb6Q=; b=dzwz6C7ksXXQUMV7dQjFsq+iLH4YhL4uk/iB+Bxk0woJ/mzxIeP+44zCyoQ36g30+P 6ug7/AVQxzn1Qb/Wq9Myr07U8uH4d1n5mGVHBURmbp3DM/dSZkPTXA4KAvirXXDtsrb6 a59RxONojKXjsmW98j8qJOYWW2/S63AL6zWxeZUoOuw8Vv1ITBDIHqqys1KDDg5CulUw U0vWA1AIq9Rhsiecum0dpBKgLF3nXsW/pWWdUGdJ0L/96+xh/Pkd2fJWwFOQXBvYzVnB qluufQQSbzmh+J7kD+Wl2psjbZmnNoxeALjDYjs1gk3Lxba/EBJa4WwVMfGEBa92Vfma a2ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qIuwOscxl1EW4BeFkvSG6ETyVL4wwncYhTvemKPOb6Q=; b=FDvamoGYn7g21MAAgTnaUi3BqsVPBAU4SteEEpEcJ3oZ6zxRE6BHurlpOVd5DcjU+b hz4M0du2LDPG0cDh/b0PGWDTEq6UnZXsgxLL6WeME0cOH6ZRLIUpjGugYOoyTzZp3nkg x/iZcckpnePpuu1Zqsm4pOXbz9ZhyHNF2ad9f6XDFoTvBMp0shRR0ly+IwbGMJQpcB90 C6cwLJSG2rWScMcbJMp9PWtB3tcCtuPeewxVEQl4bodVV3PawR0Dy8NmUHbSNShOaB+i xbNEzd3VrrRP9Z4CCfvciO7PTf874m7YLVIyWEPajeeQY9r51Wym1aUMhn6XcZl37st6 aa+g== X-Gm-Message-State: AOUpUlGTJdBqOOsguKr6Ok6d/qh5yi6UDz7R9A2wjoKooOrMSnqi/08Q Dh4u2LqXv7TYE3Eo+ogbexI= X-Google-Smtp-Source: AAOMgpfwf14R92RD5z2T+Q6XLzanWkVmVxsh3MPbqEVttaK81oTV2itdmfykO/Td2y3hCxZfnhMX+Q== X-Received: by 2002:a63:4450:: with SMTP id t16-v6mr20744377pgk.102.1532527615190; Wed, 25 Jul 2018 07:06:55 -0700 (PDT) Received: from roar.au.ibm.com ([61.69.188.107]) by smtp.gmail.com with ESMTPSA id d132-v6sm20923421pga.10.2018.07.25.07.06.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 07:06:54 -0700 (PDT) From: Nicholas Piggin To: linux-mm@kvack.org Subject: [RFC PATCH 1/4] mm: move tlb_table_flush to tlb_flush_mmu_free Date: Thu, 26 Jul 2018 00:06:38 +1000 Message-Id: <20180725140641.30372-2-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180725140641.30372-1-npiggin@gmail.com> References: <20180725140641.30372-1-npiggin@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180725_071359_628766_7A5F6590 X-CRM114-Status: GOOD ( 12.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Nicholas Piggin MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There is no need to call this from tlb_flush_mmu_tlbonly, it logically belongs with tlb_flush_mmu_free. This allows some code consolidation with a subsequent fix. Signed-off-by: Nicholas Piggin --- mm/memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 7206a634270b..bc053d5e9d41 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -245,9 +245,6 @@ static void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) tlb_flush(tlb); mmu_notifier_invalidate_range(tlb->mm, tlb->start, tlb->end); -#ifdef CONFIG_HAVE_RCU_TABLE_FREE - tlb_table_flush(tlb); -#endif __tlb_reset_range(tlb); } @@ -255,6 +252,9 @@ static void tlb_flush_mmu_free(struct mmu_gather *tlb) { struct mmu_gather_batch *batch; +#ifdef CONFIG_HAVE_RCU_TABLE_FREE + tlb_table_flush(tlb); +#endif for (batch = &tlb->local; batch && batch->nr; batch = batch->next) { free_pages_and_swap_cache(batch->pages, batch->nr); batch->nr = 0;