From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C117C4CED1 for ; Thu, 3 Oct 2019 11:02:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1C23F21A4C for ; Thu, 3 Oct 2019 11:02:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="j3MiQ+sp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C23F21A4C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8854B6B0005; Thu, 3 Oct 2019 07:02:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 835D46B0006; Thu, 3 Oct 2019 07:02:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 723F36B0007; Thu, 3 Oct 2019 07:02:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4ED886B0005 for ; Thu, 3 Oct 2019 07:02:34 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id EDC808243762 for ; Thu, 3 Oct 2019 11:02:33 +0000 (UTC) X-FDA: 76002184986.22.linen01_508409407aa06 X-HE-Tag: linen01_508409407aa06 X-Filterd-Recvd-Size: 5126 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Oct 2019 11:02:33 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id t3so1991041edw.13 for ; Thu, 03 Oct 2019 04:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=2yr0v9T8YeaaTatF75tYCF7LKBpK+bmv6hiDMUW5HMs=; b=j3MiQ+spuIixpMTCuFWJg5r+P0mU4h1/50zeP/MX/3xA/u/FlgZn96nR6SghMXoebG u8T88+aeUpJDVPQxUrzRIWq2auwDcYLwQQrwkEwquVpRb3Oez18pnd3uXcAfypmQ8oYB JVyQhw6zflogMsiitL7VDEtYZFiFC56jzzVK33qUdzJegN8ujS8/OA4dvjvm+9hOcmfa 9e+RWVn+35pxabziZXtdsV/9M20BZgoigeZDyacArnReXFyqWGXX1U7LHsY/sz3QO/3r MtZ/EsI70QcdaJFpD9t2kzgON2tLP9fD+B9UzXIV1ntfoB5wzec9ldWWtXCKuhppCcA2 jlDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=2yr0v9T8YeaaTatF75tYCF7LKBpK+bmv6hiDMUW5HMs=; b=G6xiq6RfF7xhe3vtYGwyYTlvkAhgO+4Agi7wVhW+NJNInPnO7Rh+Pvn0EUppjCQPWX iItHMf4/sM1e8giFTgraJafwqrs8Mv7Cyw82kfLQD7uA5YV/aR99g0wHdIi0z7V82fXJ Z9WuCkW66eQUH57sLjQ2ksE9YdsFwgrHZMG2ZY61+DPEWYQsocp5FOpAoyn5NbXUT1Uk Nb6ABIXWX27RVAHcIE581JPJjcDtqZntHe7Fsys6ljj4zKdgbRmqm/RWIyk6h3UupMO6 6bl16Tit8dHVepf/c+WLPQb1nLPZMnDtgveCuhb8CK7weuiALuHc9vuF6G4dGciL/9LW cw5A== X-Gm-Message-State: APjAAAW8sNHx8thDlBl4EK+FC/xa3eSnlL18ISkUVgtOROjpZdzYonQt 8A4x7hnV5cudYQiFVsfFjSovHg== X-Google-Smtp-Source: APXvYqy+QWEEIgbVQAodYl+ftjM1HBFJ1R08+8l0ilUCkgY1I2L0f65weTelyk44C89o8KMG8zuR4Q== X-Received: by 2002:a05:6402:184d:: with SMTP id v13mr9020898edy.56.1570100551931; Thu, 03 Oct 2019 04:02:31 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id a3sm404503edk.51.2019.10.03.04.02.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Oct 2019 04:02:31 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 499B9101174; Thu, 3 Oct 2019 14:02:32 +0300 (+03) Date: Thu, 3 Oct 2019 14:02:32 +0300 From: "Kirill A. Shutemov" To: Thomas =?utf-8?Q?Hellstr=C3=B6m_=28VMware=29?= Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, Thomas Hellstrom , Andrew Morton , Matthew Wilcox , Will Deacon , Peter Zijlstra , Rik van Riel , Minchan Kim , Michal Hocko , Huang Ying , =?utf-8?B?SsOpcsO0bWU=?= Glisse Subject: Re: [PATCH v3 1/7] mm: Remove BUG_ON mmap_sem not held from xxx_trans_huge_lock() Message-ID: <20191003110232.mltuantcw5pcrybo@box> References: <20191002134730.40985-1-thomas_os@shipmail.org> <20191002134730.40985-2-thomas_os@shipmail.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20191002134730.40985-2-thomas_os@shipmail.org> User-Agent: NeoMutt/20180716 Content-Transfer-Encoding: quoted-printable 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: On Wed, Oct 02, 2019 at 03:47:24PM +0200, Thomas Hellstr=F6m (VMware) wro= te: > From: Thomas Hellstrom >=20 > The caller needs to make sure that the vma is not torn down during the > lock operation and can also use the i_mmap_rwsem for file-backed vmas. > Remove the BUG_ON. We could, as an alternative, add a test that either > vma->vm_mm->mmap_sem or vma->vm_file->f_mapping->i_mmap_rwsem are held. >=20 > Cc: Andrew Morton > Cc: Matthew Wilcox > Cc: Will Deacon > Cc: Peter Zijlstra > Cc: Rik van Riel > Cc: Minchan Kim > Cc: Michal Hocko > Cc: Huang Ying > Cc: J=E9r=F4me Glisse > Cc: Kirill A. Shutemov > Signed-off-by: Thomas Hellstrom The patch looks good to me: Acked-by: Kirill A. Shutemov But I looked at usage at pagewalk.c and it is inconsitent. The walker takes ptl before calling ->pud_entry(), but not for ->pmd_entry(). It should be fixed: do not take the lock before ->pud_entry(). The callback must take care of it. Looks like we have single ->pud_entry() implementation the whole kernel. It should be trivial to fix. Could you do this? --=20 Kirill A. Shutemov