From patchwork Tue Jun 12 07:16:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 10459501 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 461F1602A0 for ; Tue, 12 Jun 2018 07:16:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3394D2863D for ; Tue, 12 Jun 2018 07:16:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 280B428676; Tue, 12 Jun 2018 07:16:47 +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 ABD732863D for ; Tue, 12 Jun 2018 07:16:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 667406B026F; Tue, 12 Jun 2018 03:16:45 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5F0F26B0270; Tue, 12 Jun 2018 03:16:45 -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 4B9E06B0271; Tue, 12 Jun 2018 03:16:45 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f69.google.com (mail-pl0-f69.google.com [209.85.160.69]) by kanga.kvack.org (Postfix) with ESMTP id 05A4D6B026F for ; Tue, 12 Jun 2018 03:16:45 -0400 (EDT) Received: by mail-pl0-f69.google.com with SMTP id 89-v6so13558834plc.1 for ; Tue, 12 Jun 2018 00:16:44 -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=UeJXj3CMAoPwIwqZfbqygB977XIHkUSCcx5B2Hn+DmQ=; b=BO5jmL7r7qpzZQ+c1awU+of+ezezzgyw7R6PHm3f1HIpOLren4zot3judL0nRoRSY4 QOa3wEiB+jYgEopI2x9h3Su7I7Dz7AolDpNKtbsm4r+OQgbU5Y+p/SPAiXzB2H2MHeFR +6F4hy6Q7XrHiqGXLRyUJJwqIAt+wGTeotksdo+q6PiIl6TRL7caS8qqhD3FveYPruHE o2qAbPC1G2e3t7mdhQNvw0Pjcvvg99rhS78lb79zbH61Huw54IpUz5MZr4ZsPifUeRaT f38msfE8uKYGATA7vrdJngpI7DWLBP0uqc3UrmIE6VGIl1VWkG4F8OSRj+oPj1QAL2cn oZGw== X-Gm-Message-State: APt69E2kvctXwzakBlfkiqxKjniK/kKpn+0zH3rmZqdoV5+m1ZWgS3il ixtEaIe4Jos6skbNy7H2/bEyBdjLu/KAybIp29U+m0kOv6GblZDM2b5qELA9cHLCxJDS7qqTjtE +1CR6BNQLvGjRcA2LEgJ+9Vt3Zu9urR5aHse8mO21ZH62HK0JjZmz2tlQOLQ2zVUkVZ55Uuj1Cm msIf2ZwDu9jDg5gq6qyqDxW0+iI/Hbrzzd69bzsUiVNgzZ8E5K4+xWWqZyAm7y+tvsMDDXZPXaM w9/+iZfGe/lK8n73qIMxRVUoUYgkBI8EouO/AQuhrTDdpuUHjN715TQbwZYd/p6XXsA3a0G0f5k xJJ27T6TqOULpv0E5MJBTmtRKoiQH5psDtcO6qISN0Cc7DtY8HRrq6/demFlDzCdZCoOIeHDvTT O X-Received: by 2002:a17:902:e10f:: with SMTP id cc15-v6mr2825795plb.100.1528787804724; Tue, 12 Jun 2018 00:16:44 -0700 (PDT) X-Received: by 2002:a17:902:e10f:: with SMTP id cc15-v6mr2825756plb.100.1528787804005; Tue, 12 Jun 2018 00:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528787803; cv=none; d=google.com; s=arc-20160816; b=fN5HQgkUKNND6ub3sDiB8105nIGpLtAzVfBRrQh6l7kZNh7e5VzUe99CETOGuqIq4j f+ni25T300oOOBuo10eeziMySe2WWH1kmhMUCh/bN9F9SJ9vx0oCKFfhf5Sy0Xape7Py 0Hgxg+emwz8mwA7TdaLY4cjZOfKacHPjqcKttxIDb4FlrDl4M4b9R6u3NH2tnDZz7fra BzeBY0AwJdiRxqK6h+9OGKilsme/tzijrnX1cKdJ3hf5ufSWO7u2UPegffDHcYPzWRWl ydMeX+gH1f67PVbkv1ydBdOGfqSpO/V3t4vq+4S/NKWnXn5kdItuIqrsqGLxtUBXI6q9 T33w== 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=UeJXj3CMAoPwIwqZfbqygB977XIHkUSCcx5B2Hn+DmQ=; b=zfBFfTMEiaVmpMZ0JBWS/KD0fJ9ceaKw/ce+EzHs2wyYqYoKXmQQ6sULOj/w7SHYwY b0wGyAv1VNTnip5Wag+IYX4v2srqGwm4WWsbtsEIYM89eWnW1aIy9sqdeMNSGzE3fwaJ 2rJqiavv6ZVsAE4Cx9LyUoBMZmct67uuy3I5AZVQomUG6GhLOyL56Fp0ngxi25kSfUdM VqoVLruU++3K+d43swN9sHnKrgippqrK8Y/C2rhzMRbxtgdZcuFTKX0qtsocgdhow/tT mvlcPOxJyduS4Lm0hywgdgVWonWJg6Q38u3hKPJF9QyorL61kJXVybqkQfi4z3Y7sjoA Simw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ogiK1yEo; 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 33-v6sor78565ply.63.2018.06.12.00.16.43 for (Google Transport Security); Tue, 12 Jun 2018 00:16:43 -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=ogiK1yEo; 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=UeJXj3CMAoPwIwqZfbqygB977XIHkUSCcx5B2Hn+DmQ=; b=ogiK1yEovhVUab3BhHEu/AHpR/rEyEO2PpFGn1tZqh+iGk53co0HkrxfJxzasxOdQd PIIek7Q5BpRnpdAEkqrYGquGcCix2NBO+vRKRLGRLVoG6gx8WzylQQTjZ+AtkIkfQ7Ya HmWlcnH0hsRB9/CL3qOYtJ5clUUjLstita+KHNKdgF8W+jVc6sJtlYDOMk4rw+zLoq4A dOW0PDYzcAC4tZS8LZFVOo0BnJgVka9xaMsthpWhq3sZKSHgxJDI8O4xeMim892enVFD mEmXH80f1tivaM+OQ74S5o1pGnmVM21wEugdn8OXaM6PVOqN9T2oFARmDqaPs+MDBYt6 EtyA== X-Google-Smtp-Source: ADUXVKKjn5b1FU5ZJz4p4T7h4oz/qf8hxpSHs5HlOjRAnWbhLJkb7OLtPyhYAj32KH8b/i1djjJ35w== X-Received: by 2002:a17:902:700a:: with SMTP id y10-v6mr2748427plk.249.1528787803621; Tue, 12 Jun 2018 00:16:43 -0700 (PDT) Received: from roar.local0.net (59-102-70-78.tpgi.com.au. [59.102.70.78]) by smtp.gmail.com with ESMTPSA id q24-v6sm649324pfh.26.2018.06.12.00.16.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 00:16:43 -0700 (PDT) From: Nicholas Piggin To: linux-mm@kvack.org Cc: Nicholas Piggin , linuxppc-dev@lists.ozlabs.org, linux-arch@vger.kernel.org, "Aneesh Kumar K . V" , Minchan Kim , Mel Gorman , Nadav Amit , Andrew Morton , Linus Torvalds Subject: [RFC PATCH 1/3] Revert "mm: always flush VMA ranges affected by zap_page_range" Date: Tue, 12 Jun 2018 17:16:19 +1000 Message-Id: <20180612071621.26775-2-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180612071621.26775-1-npiggin@gmail.com> References: <20180612071621.26775-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 This reverts commit 4647706ebeee6e50f7b9f922b095f4ec94d581c3. Patch 99baac21e4585 ("mm: fix MADV_[FREE|DONTNEED] TLB flush miss problem") provides a superset of the TLB flush coverage of this commit, and even includes in the changelog "this patch supersedes 'mm: Always flush VMA ranges affected by zap_page_range v2'". Reverting this avoids double flushing the TLB range, and the less efficient flush_tlb_range() call (the mmu_gather API is more precise about what ranges it invalidates). Signed-off-by: Nicholas Piggin Reviewed-by: Nadav Amit --- mm/memory.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 7206a634270b..9d472e00fc2d 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1603,20 +1603,8 @@ void zap_page_range(struct vm_area_struct *vma, unsigned long start, tlb_gather_mmu(&tlb, mm, start, end); update_hiwater_rss(mm); mmu_notifier_invalidate_range_start(mm, start, end); - for ( ; vma && vma->vm_start < end; vma = vma->vm_next) { + for ( ; vma && vma->vm_start < end; vma = vma->vm_next) unmap_single_vma(&tlb, vma, start, end, NULL); - - /* - * zap_page_range does not specify whether mmap_sem should be - * held for read or write. That allows parallel zap_page_range - * operations to unmap a PTE and defer a flush meaning that - * this call observes pte_none and fails to flush the TLB. - * Rather than adding a complex API, ensure that no stale - * TLB entries exist when this call returns. - */ - flush_tlb_range(vma, start, end); - } - mmu_notifier_invalidate_range_end(mm, start, end); tlb_finish_mmu(&tlb, start, end); }