From patchwork Fri Oct 12 18:10:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 10639085 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 7F674112B for ; Fri, 12 Oct 2018 18:11:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70B552C506 for ; Fri, 12 Oct 2018 18:11:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E9912C50E; Fri, 12 Oct 2018 18:11:06 +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=-2.9 required=2.0 tests=BAYES_00,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 696782C4C5 for ; Fri, 12 Oct 2018 18:11:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73A606B0279; Fri, 12 Oct 2018 14:11:04 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7114A6B0282; Fri, 12 Oct 2018 14:11:04 -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 6010D6B0283; Fri, 12 Oct 2018 14:11:04 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id 3789E6B0279 for ; Fri, 12 Oct 2018 14:11:04 -0400 (EDT) Received: by mail-qt1-f200.google.com with SMTP id n1-v6so12763455qtb.17 for ; Fri, 12 Oct 2018 11:11:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; bh=G6rLZKb9OY4fvudIZr1iNu+u8wfXgM7u0KQfYWKYB0I=; b=rMAexwKKvpV7roll7BZH30abG/JWlf/1tOTCCeoEl1mc7jWlA7fHEBajWIAYgGss1l 6ccv/lCkYeosc0Nvk/32HCBSeNz3tsKbboWNVjVBagLXk53xW8Z0NdjeK1dCG+wXYsgx SL4nLL3nCa8AkGf7QkddzWXX6k4X/qAT1PB3Lzfk6Ou8oXnRlfW3Dta2j9Li3wwCbnDt oTYuJDeNysfbT5n2kNenLKpV/dKyYLhd+YP6ZyPjKA3j8aTe2Zg9fdbtkYWhjV5k3b0q KbyCPzaGIpbI/ER59NFbCcOJtgwt4hEOsM/M9hxRG8PvDgm7ROu01icmIecuurCzfXgQ UGng== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of jglisse@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=jglisse@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: ABuFfogJRhe59bN8AqoqseszKzNrzV8A95IkI3S+R43WHfbkJzRgV9Py M8eE5RREr3ARYIfs9tzyaQCGZmqhmbyR2Oy+Qr0xGF43PJwKg9O6ykY+0gTgIpExCCsQSCNi3BG hCVExAbxGAYg1A9ZzeyT/TvuKLoM5SvW2A98RfcE2aI5LMKtq0pOsoZRyS+hD8OMDRg== X-Received: by 2002:ac8:f57:: with SMTP id l23-v6mr6966616qtk.158.1539367864012; Fri, 12 Oct 2018 11:11:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV62X7xJODeAFfW43R1YUNASArzOGz4ZGorsymR6QvjiEuqj4wPPaH00LGCvi0aABmJUZjCiz X-Received: by 2002:ac8:f57:: with SMTP id l23-v6mr6966577qtk.158.1539367863471; Fri, 12 Oct 2018 11:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539367863; cv=none; d=google.com; s=arc-20160816; b=Equp34rV9tZ40PuHtM9Y4ZBq8IHQbIgtxjv96orWrEiK/6UK5MUu7Mnahrrjj7uIpD GzKbSLQeG+B12pTkK+iMRjvWbuNyn7bT8u3oX9hYG9dKBfr38cufQw9eKlNiCipRDCxF KfBpGe2FLlGoCSY7aLEj3m3GG20ea6SpqC56VjpBpfWvXoWnmPR86Ecv/FQ5DOq/OLIE WSli9U7QWTaaA2ixGUmBiZfJer0KqVvMdrzEFeqZJ8NLryWZ7METDEsSUhFebG3N+7ot timkblA3DSFPuVkqE9V3ODQydYgB1Cy5tRzzQYKYfIvAbmg70FQIPRxuFCff11ADxEnM 3bBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=G6rLZKb9OY4fvudIZr1iNu+u8wfXgM7u0KQfYWKYB0I=; b=zIYHSZnfKcjA9UN8uQMQcLwLlgU5hjNc6D5rkhtrc+x8W9VgLHs7GMNLz7kuF2fwX8 O54qDEcUeGmpr6STUKvG4L/SP64ScKbZvuCWrurkl22IlTRnkcZ3AVkm+CRGtCqRH0rB qPPX0BMQINgFVziGFm1ifdRAYnB77IsFmKLZL78TdgA/jZA4HVCWxFZBMqHsdqB3GLG7 JNwA6YLVep/tCImUBtrptvejIe0u0P75b0bok/XdH6L6XtM/RtMh6dFfAItfkmPNM5cE nTqNOoaCfqBk2ZVSdoQ60EFVKf3kOd+egNqsCE9Uv2u2zfSoXuZI4W/CZBjzWOe704xq vvbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of jglisse@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=jglisse@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id t31-v6si1452802qtd.113.2018.10.12.11.11.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 11:11:03 -0700 (PDT) Received-SPF: pass (google.com: domain of jglisse@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jglisse@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=jglisse@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7462E3082E72; Fri, 12 Oct 2018 18:11:02 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-125-5.rdu2.redhat.com [10.10.125.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 13099105705C; Fri, 12 Oct 2018 18:10:59 +0000 (UTC) From: jglisse@redhat.com To: linux-mm@kvack.org Cc: Andrew Morton , linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Greg Kroah-Hartman , "Kirill A . Shutemov" , "H. Peter Anvin" , Anshuman Khandual , Dave Hansen , David Nellans , Ingo Molnar , Mel Gorman , Minchan Kim , Naoya Horiguchi , Thomas Gleixner , Vlastimil Babka , stable@vger.kernel.org Subject: [PATCH] mm/thp: fix call to mmu_notifier in set_pmd_migration_entry() v2 Date: Fri, 12 Oct 2018 14:10:56 -0400 Message-Id: <20181012181056.7864-1-jglisse@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 12 Oct 2018 18:11:02 +0000 (UTC) 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 From: Jérôme Glisse Inside set_pmd_migration_entry() we are holding page table locks and thus we can not sleep so we can not call invalidate_range_start/end() So remove call to mmu_notifier_invalidate_range_start/end() because they are call inside the function calling set_pmd_migration_entry() (see try_to_unmap_one()). Changed since v1: - removed call to invalidate_range() and updated commit message Signed-off-by: Jérôme Glisse Reported-by: Andrea Arcangeli Reviewed-by: Zi Yan Acked-by: Michal Hocko Cc: Andrew Morton Cc: Greg Kroah-Hartman Cc: Kirill A. Shutemov Cc: "H. Peter Anvin" Cc: Anshuman Khandual Cc: Dave Hansen Cc: David Nellans Cc: Ingo Molnar Cc: Mel Gorman Cc: Minchan Kim Cc: Naoya Horiguchi Cc: Thomas Gleixner Cc: Vlastimil Babka Cc: stable@vger.kernel.org --- mm/huge_memory.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 533f9b00147d..a5b28547e321 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2885,9 +2885,6 @@ void set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw, if (!(pvmw->pmd && !pvmw->pte)) return; - mmu_notifier_invalidate_range_start(mm, address, - address + HPAGE_PMD_SIZE); - flush_cache_range(vma, address, address + HPAGE_PMD_SIZE); pmdval = *pvmw->pmd; pmdp_invalidate(vma, address, pvmw->pmd); @@ -2900,9 +2897,6 @@ void set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw, set_pmd_at(mm, address, pvmw->pmd, pmdswp); page_remove_rmap(page, true); put_page(page); - - mmu_notifier_invalidate_range_end(mm, address, - address + HPAGE_PMD_SIZE); } void remove_migration_pmd(struct page_vma_mapped_walk *pvmw, struct page *new)