Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp191009pxk; Tue, 22 Sep 2020 23:56:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0amwZeV93aY1sL8hEA4N2dPKArHGU5NhupPOFDK7LlHrV0R/m/2Bo6mgWlEbK/iDQh5Za X-Received: by 2002:a17:906:d965:: with SMTP id rp5mr8370248ejb.364.1600844184042; Tue, 22 Sep 2020 23:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600844184; cv=none; d=google.com; s=arc-20160816; b=meur4M9WbVNYVyaf43FyF9peYjHtcHSkrz5I4DgJ+xIk1qQAYVAyhIJeeKnTSnvVQD Kf2qpu47f5WBFQCI12StU3s1qStHb5nlL+xho9uYk00XA1cNxeNK0B52u8uAJ1qKfLIT VuVmWeff1o8qCgQSKladO5tEnm98Q/Fgvhif7kKV3F4kktEKmkXiqdXufBiOYurQRU6a ziq9W0JTWDN2rdChZlbC9pl0AhyWnpxEQiwhBOkh0LFf1TRmDa2ryiIJIoP43i+8lAmW EaPffnxDS9b5Pt1hIvNDo7G7L9TG6D7Bxl3Uql+Bs2dKOGTphI14OrYsVUGRawrEw1U4 139w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wkDalf6dpTOKDWnNv+ft21nXrG8JW1W9t9KYuN4hJoc=; b=lgRGWDjezCk+3h0+aDsDlQpGhWpNFVyPZsAQSUyzRdYAgeeWH7EuOqojVuby2K+jXd 2mHcFSgYar3tNT48Ij01q4ctB2bJSymCAtL6bIKkFzlnYsVriP372CJGO0IINXjfJd/O 9c9CMr6QpDMfHXnxaqx6ZBzdjhHhrt4Ok+R1ur6qWDyrrWDRCerGJ7BEzak1ccjPzmlo CpFfXvggVmFNPPDzK2VXzod1RSxzFW6oU6wTmP/beXTh23W0pznzN0LXU70V21SvsIfP Bhf2TGeCewtp+QtGik7RTCVIxQdm9apF/PS0AG6GMAeNPffalvxB6vi5CXxoxPTuhG9G GJZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Iyt2V0sD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mc3si12118314ejb.404.2020.09.22.23.56.00; Tue, 22 Sep 2020 23:56:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Iyt2V0sD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbgIWGw5 (ORCPT + 99 others); Wed, 23 Sep 2020 02:52:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28395 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbgIWGw5 (ORCPT ); Wed, 23 Sep 2020 02:52:57 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.