Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1055118imm; Fri, 12 Oct 2018 10:58:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV60iFY2zZp8JJdY6+JCnnmt0u2gcx39oZYkrFOYVso13zNiDFQ/JuIPdj4UIO1Pg/xczgNtF X-Received: by 2002:a63:fa09:: with SMTP id y9-v6mr6419023pgh.177.1539367127476; Fri, 12 Oct 2018 10:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539367127; cv=none; d=google.com; s=arc-20160816; b=NheS+AELaV6MZ4koGN/bMOEbqpX18EolCqe+Jmh3rv3em2IdzUXpp+NzsjetowId2G 6haWs9VNmu5ni+oyMxBMCA8CajQHxB4QgbBljQ1piFK0RCMsJIIIZGAH+/0Rw+EJdCl0 +1pMWELZo+gjVIcY3/frlEAe7tyX2Nh3yyTDSog1Zy8DVLQdBMI4t8qYVtl6044p4UbZ Fo4DeJN/qYlO4krp9yEjt3NDwTfvYoOLCihuiJ4jWcYOjLOHyX93/cbvfx2P/V93k5uo LMRCEpSWv/3CdsakuVhip1D46M1Ixdm3P6mve7EL3+feqq0cjzvHODGd8Yscp/BeKHpn yB6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=h8ZfLOq21st+p3EMn5Wa1q1ialE+Y3bpQCobqUZxNpA=; b=N8g2sxYx9efKwl0F0BvFDzgZpX4kcaPrY7qMjJv39gsofCWwqVd+P5IaqQeGgfBoqw L5L3/4UXrEqvf/dZwcKbYv1eYeWgRRgdk7BoStKu0xJG7JeNFWO9c19iyy5t2oA0RIyg 2AAANRyDw3hizd4539LeWr+5ZlS+lvs1dm1JtxOL81Wm7sRc8sNGff6+hXQadPqY4IdL X+9QRI2UHMTNQmNdRwlGKv86Wdl1Yw/mRMpz6M8oZh3qmzDzDFG/mChHHJuI8GzaV28s 1OIE2zIH71f0bw8cFtGx+v/1pjIIruVsqC1PKQ/34OTeQdE3PakdGPvroN4YHZYfikWo 8ONw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y1-v6si1881340pgf.78.2018.10.12.10.58.32; Fri, 12 Oct 2018 10:58:47 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbeJMBbl (ORCPT + 99 others); Fri, 12 Oct 2018 21:31:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57420 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbeJMBbl (ORCPT ); Fri, 12 Oct 2018 21:31:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D490C04FF85; Fri, 12 Oct 2018 17:58:02 +0000 (UTC) Received: from sky.random (ovpn-120-22.rdu2.redhat.com [10.10.120.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51AB66CA52; Fri, 12 Oct 2018 17:58:01 +0000 (UTC) Date: Fri, 12 Oct 2018 13:58:00 -0400 From: Andrea Arcangeli To: Jerome Glisse Cc: Zi Yan , linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org, 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 , Michal Hocko Subject: Re: [PATCH] mm/thp: fix call to mmu_notifier in set_pmd_migration_entry() Message-ID: <20181012175800.GD7395@redhat.com> References: <20181012160953.5841-1-jglisse@redhat.com> <20181012172422.GA7395@redhat.com> <20181012173518.GD6593@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181012173518.GD6593@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 12 Oct 2018 17:58:02 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 12, 2018 at 01:35:19PM -0400, Jerome Glisse wrote: > On Fri, Oct 12, 2018 at 01:24:22PM -0400, Andrea Arcangeli wrote: > > Hello, > > > > On Fri, Oct 12, 2018 at 12:20:54PM -0400, Zi Yan wrote: > > > On 12 Oct 2018, at 12:09, jglisse@redhat.com wrote: > > > > > > > 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() and add > > > > call to mmu_notifier_invalidate_range(). Note that we are already > > > > Why the call to mmu_notifier_invalidate_range if we're under > > range_start and followed by range_end? (it's not _range_only_end, if > > it was _range_only_end the above would be needed) > > I wanted to be extra safe and accept to over invalidate. You are right > that it is not strictly necessary. I am fine with removing it. If it's superfluous, I'd generally prefer strict code unless there's a very explicit comment about it that says it's actually superfluous. Otherwise after a while we don't know why it was added there. > We can remove it. Should i post a v2 without it ? That's fine with me yes. Thanks, Andrea