From patchwork Thu Aug 23 08:47:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 10573567 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 7FB71112E for ; Thu, 23 Aug 2018 08:47:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D1CD2BA27 for ; Thu, 23 Aug 2018 08:47:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 616272BA41; Thu, 23 Aug 2018 08:47:32 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F03B32BA27 for ; Thu, 23 Aug 2018 08:47:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D3B026B2924; Thu, 23 Aug 2018 04:47:29 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CEA6B6B2925; Thu, 23 Aug 2018 04:47:29 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB13D6B2926; Thu, 23 Aug 2018 04:47:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f72.google.com (mail-pl0-f72.google.com [209.85.160.72]) by kanga.kvack.org (Postfix) with ESMTP id 6A8E46B2924 for ; Thu, 23 Aug 2018 04:47:29 -0400 (EDT) Received: by mail-pl0-f72.google.com with SMTP id bg5-v6so2230177plb.20 for ; Thu, 23 Aug 2018 01:47:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=IRhZgLPRx4tzi/e3fxP2vHoZGo1V/TLqfKDUUNoAm38=; b=lXqnTK5HWhT3G4JSls5Fu9yIpnMdwDWRwXxbs9iwsX3gtsqlZHnn94UcbB3UIGExHo xxOtHlra5gHwEOYlKN0Knul1oNfBOQTH7Ml//qOWN83fbaWqUm7j4H3ZBTAuIOU+Y7eI QY4vFUth8AyPU+pDrF4DPlvWSmQnn0FBymLQ3OnuvCAMrnuBcyhd//3RtVLXhh/h81ws 4HxgTONWxPMe8cM2oh07hV6l4U7Wt3R1My841QvDM8Izmua6oBl2W9jz6Rqyd+9eEIwS EdBcY909tgfWTIjqmZFx49/LfmGnI4uMlIOlWJESGVrAKFFCabDuLE1/u8v/phs9t+zl ebyg== X-Gm-Message-State: AOUpUlEpU6ySkU4b6habz6r9cb3EEyaed2YdZLHva9izW1PfYcETUyVm 6oAea3plTJC8tCw5n0kHj1dYNoAqxVvktyf26p2DGAtT6alIYQ/H/VxWWz2AatTiKJ0Ue/zB5sW wBkn/rXWpOedDPxBOZ4owWnBbwQ63AoAUX/h5z+GlSI5bLSP3RfCzNgR+MUy/7g7tB0ATOySghL WbC0zmwupCclc+Mcc9IcJFQkJxpkn8s76DZT/W+HoAwee+SGW1U0g9eh5k3jebBowRWeliCRPC9 Y1bALrRRHrmnjBmPmgdyZh0P7Z857Ny5K4PXU0frh+yvHxguO3FtPt51hAmijiQ1ZYw/OtemawK bT+k8RQH4eyUAWm7X8/yN3+aNbbMnUQH9WhZ3tQrzvPRGHINpSabMlGqZm/eSirQiRjyFDdh1ZO 6 X-Received: by 2002:a63:5856:: with SMTP id i22-v6mr15368069pgm.232.1535014049021; Thu, 23 Aug 2018 01:47:29 -0700 (PDT) X-Received: by 2002:a63:5856:: with SMTP id i22-v6mr15368043pgm.232.1535014048328; Thu, 23 Aug 2018 01:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535014048; cv=none; d=google.com; s=arc-20160816; b=ctcKv0/tqLVoOe89Z5t/v9SeYiUh99iBh1Lm421/jFvVvV06Dv4Ugr8HIpswmaMp4V 7B72myqTc/gftXn5zJexoaEgjIiMSdO/TjWDnRSObRd9jSX4NRU37uw+PGCXbt7+6HA9 86VnLsgiNLa++f3ZE81WHtuQny+qWDcHdvaLXKJlVngVKTnHUrpQYxF9hwoEAtCzRH55 HWPx2K39PZvzoLeFDuUMKJLXLiFbwdBZHxtpb1bxMwTYSeVzeh1qdNdkUg42OLEKLzoi fQ3GJTWpAen1BETIrF+pI3ETmIeavIRdTmBuEfP0uLhhJZrSzdFGP9dReM3sVN7x4LBJ EfLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=IRhZgLPRx4tzi/e3fxP2vHoZGo1V/TLqfKDUUNoAm38=; b=DUq6HPS3NqLGLpcrGYGE2FtXbJ8lbW3s702GeQRADlMIwGt/aHCfHsXQrZJNAjcPsN c5BuHdB+nENNfB7iTJNCzVzPPR3WZFvPM6ULIweWpMFRwrQquOimwLLXyIF4bpvvkKqo HPvit/RQg+5AYeBfL8NbjcySFXxP61vxAxuZIHMhlGL43lR4Nma7+eLYUd6vqzMzGemb KvPNLe4E/KobCzqq3ia1z8A/taB+3zeS6ORZieV/esxSAuKYeOGLu2dwOSJxt3pXhw/Z kie2APcXe8s3iW7FQg/0bAcD9ozwdJ6+mawgtcazcqH2VKnjZSbNlJ0YI3lohhspI+br 6Uvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e85lCNW5; spf=pass (google.com: domain of npiggin@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=npiggin@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v2-v6sor1111968pgt.196.2018.08.23.01.47.28 for (Google Transport Security); Thu, 23 Aug 2018 01:47:28 -0700 (PDT) Received-SPF: pass (google.com: domain of npiggin@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e85lCNW5; spf=pass (google.com: domain of npiggin@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=npiggin@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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=IRhZgLPRx4tzi/e3fxP2vHoZGo1V/TLqfKDUUNoAm38=; b=e85lCNW5ZhdjUCei/RAj9byezOvy9sEmiiZkPkURq+UAHjwaE5/PxcfLUapq8XVJlx pWoX2yLTmaYHUL4Yfgg1iYWsY9wPSO8gwLR7qh58C5BrmBbJkiKMhK2whmZZpP3h+kd0 MRW0MDqKR/7vgpjZJrJ7FIHLKjH/U0pfrvPoBQZXbhEQ0LNW2c4OBwVhhYET0X5XChl1 YFAW706vZ4vJwGDdKbtiuwMAjyv7nyWXFnwwOMAjDaoOyMWikwDcvWDfaNLPI+JCr768 /xJSyNYzqbXu6PKmfyoDn30oJq6Z+etT3FcNl6LjVJtUjvhPdfu883Zi+1ZQ1NE3vj8Q Wrpg== X-Google-Smtp-Source: AA+uWPzgnKVeyGDrwd1X5Y4sSxuoZ5U4azvkGjVyP7iTgSuBQqhduD/7xVxtxH+hKFgoJPhXiXJFnA== X-Received: by 2002:a63:1c47:: with SMTP id c7-v6mr16501905pgm.38.1535014048116; Thu, 23 Aug 2018 01:47:28 -0700 (PDT) Received: from roar.ozlabs.ibm.com. ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id w5-v6sm5170503pfn.44.2018.08.23.01.47.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Aug 2018 01:47:27 -0700 (PDT) From: Nicholas Piggin To: Peter Zijlstra Cc: Nicholas Piggin , torvalds@linux-foundation.org, luto@kernel.org, x86@kernel.org, bp@alien8.de, will.deacon@arm.com, riel@surriel.com, jannh@google.com, ascannell@google.com, dave.hansen@intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, David Miller , Martin Schwidefsky , Michael Ellerman , linux-arch@vger.kernel.org Subject: [RFC PATCH 1/2] mm: move tlb_table_flush to tlb_flush_mmu_free Date: Thu, 23 Aug 2018 18:47:08 +1000 Message-Id: <20180823084709.19717-2-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180823084709.19717-1-npiggin@gmail.com> References: <20180823084709.19717-1-npiggin@gmail.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Acked-by: Will Deacon Reviewed-by: Rik van Riel --- mm/memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 19f47d7b9b86..7c58310734eb 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;