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=-6.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 17BC1C4363D for ; Wed, 23 Sep 2020 06:52:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 77166235FC for ; Wed, 23 Sep 2020 06:52:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Iyt2V0sD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77166235FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0A6366B0003; Wed, 23 Sep 2020 02:52:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 055846B0055; Wed, 23 Sep 2020 02:52:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E863C6B005A; Wed, 23 Sep 2020 02:52:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id CEFAC6B0003 for ; Wed, 23 Sep 2020 02:52:57 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 92B273625 for ; Wed, 23 Sep 2020 06:52:57 +0000 (UTC) X-FDA: 77293408794.27.talk89_630269f27154 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 6F7F43D663 for ; Wed, 23 Sep 2020 06:52:57 +0000 (UTC) X-HE-Tag: talk89_630269f27154 X-Filterd-Recvd-Size: 3728 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Sep 2020 06:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600843976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wkDalf6dpTOKDWnNv+ft21nXrG8JW1W9t9KYuN4hJoc=; b=Iyt2V0sDD5TAl4n6xFoPes1q19qTYhieoFmCBTLFP9V+VInEMP9zetY8j0l9v/AD8HCWdi 9BbSu3/AW3jNJSUccchIE3ipidun6e12040t74Yupyz3sEmUTNcPoXNZ2uFlo01J7DQdRi QHP186OuuXQzgJAsLXHTJ7u7ssR3890= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-24-HTRZin0UOEWzwhxFBk4ilQ-1; Wed, 23 Sep 2020 02:52:51 -0400 X-MC-Unique: HTRZin0UOEWzwhxFBk4ilQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E15161891E8B; Wed, 23 Sep 2020 06:52:48 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.186]) by smtp.corp.redhat.com (Postfix) with SMTP id E3CCB5D9CC; Wed, 23 Sep 2020 06:52:38 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 23 Sep 2020 08:52:48 +0200 (CEST) Date: Wed, 23 Sep 2020 08:52:38 +0200 From: Oleg Nesterov To: Peter Xu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jason Gunthorpe , Andrew Morton , Jan Kara , Michal Hocko , Kirill Tkhai , Kirill Shutemov , Hugh Dickins , Christoph Hellwig , Andrea Arcangeli , John Hubbard , Leon Romanovsky , Linus Torvalds , Jann Horn Subject: Re: [PATCH 3/5] mm: Rework return value for copy_one_pte() Message-ID: <20200923065237.GA21395@redhat.com> References: <20200921211744.24758-4-peterx@redhat.com> <20200922100840.GA11679@redhat.com> <20200922101815.GB11679@redhat.com> <20200922153612.GF19098@xz-x1> <20200922154845.GE11679@redhat.com> <20200922160330.GH19098@xz-x1> <20200922165354.GG11679@redhat.com> <20200922181306.GJ19098@xz-x1> <20200922182317.GH11679@redhat.com> <20200922184905.GM19098@xz-x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200922184905.GM19098@xz-x1> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 09/22, Peter Xu wrote: > > On Tue, Sep 22, 2020 at 08:23:18PM +0200, Oleg Nesterov wrote: > > > > But I still think that !pte_none() -> pte_none() transition is not possible > > under mmap_write_lock()... > > > > OK, let me repeat I don't understans these code paths enough, let me reword: > > I don't see how this transition is possible. > > Though I guess I'll keep my wording, because I still think it's accurate to > me. :) > > Can we e.g. punch a page hole without changing vmas? punch a hole? I don't know what does it mean... However, I think you are right anyway. I forgot that (at least) truncate can clear this pte without mmap_sem after pte_unmap_unlock(). So I think you are right, the current code is wrong too. Thanks! Oleg.