Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4087474pxk; Tue, 22 Sep 2020 09:55:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBM7nsd8t7/0PgqFZJBPiGZf2abHfsCvPFtVuhXy82m7WTDCf5/xAEjKJPDoGc4H6EdkOQ X-Received: by 2002:a17:906:2b48:: with SMTP id b8mr6235170ejg.125.1600793746717; Tue, 22 Sep 2020 09:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600793746; cv=none; d=google.com; s=arc-20160816; b=Ndr4GBQHZq4wWkkWJ4PQ+jBm8SHMDeO7BGA4MdI7L16xhud8PwIVKLWOMEIY3zcOPm l7DeF9BoEZH5kINcJTFYVydc0E0tPVKRVbt/5nyJs5RQCtoCez5XW1jBs6WpETEy7Pqg jlylxq/HkzMEuBaC3lB4Rz6/kQhGWSyGToMuvLKopPuNdgAoMnLYKu/CsPw3ZarsHf7f f3GU1t462JwcYgC5vmfWjwjcXImF8Bgj31SNfzUT4nBKO2eHonrMXHJe50yvBds+fI7u Z4qng8+5MBnU3SIjpakLPEB9JVyq7AaGzjyhARqcijAeVD70pvjFJVV+h2/7t04wdxIR o37g== 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=gBHg3zNIec+WeQog3j//eJu6/QAaq+YzhOHDbDBO6PM=; b=fnrdr0+isiFfIfbDNdyj5d1JFhR/w910w/CIP/XmllgayAgkDPYwQIS7aQ4aVTjpmg +lRFUAD69aXGnPoGcfsCyvWrigpshmdCnTxa9mKdobnne0hxzX37CCA+dh1q206a5FDx l2yQvTwJibZVjCZIATohbp2mmchJBfY7jeunOtEUKLOxR1OjeCB0UhEV0he+s6OEMX3a iuF2KuTbkVDsZ2xTfP3o8XqxhcBJG+LHC89kmRvsh9cSlUWTN81cvMk/GWmm08R5S5ag 0BPu6Lvg6D8566r2lA9ZrA1NjpQ7p+WYyKMvk0jqevKhEUHrwG3dmxXUo7E+ELAxuPTi HGAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OzuMisA5; 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 i22si11505959ejy.5.2020.09.22.09.55.22; Tue, 22 Sep 2020 09:55:46 -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=OzuMisA5; 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 S1726607AbgIVQyK (ORCPT + 99 others); Tue, 22 Sep 2020 12:54:10 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:38500 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726558AbgIVQyK (ORCPT ); Tue, 22 Sep 2020 12:54:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600793648; 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=gBHg3zNIec+WeQog3j//eJu6/QAaq+YzhOHDbDBO6PM=; b=OzuMisA5eK2dDN0iDc28X9XYnam0SEsvXqcMxKYMyhvO8bC+x8160eTH1RMIBR2DRG9kHY HTvlIZ26uOjkFvcZAdNmlZd/ufJF82fO/X5WaVsGIgZNqrFG9NsjT0PdPb++bc7mm118/V T0Mzsiyr/KEUhGYQNeOSB1Az53Rq7eM= 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-182-VDiYQtyBMdir2oJfykRdmg-1; Tue, 22 Sep 2020 12:54:04 -0400 X-MC-Unique: VDiYQtyBMdir2oJfykRdmg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AFAB91891E93; Tue, 22 Sep 2020 16:54:02 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.146]) by smtp.corp.redhat.com (Postfix) with SMTP id 0344A614F5; Tue, 22 Sep 2020 16:53:56 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 22 Sep 2020 18:54:02 +0200 (CEST) Date: Tue, 22 Sep 2020 18:53:55 +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: <20200922165354.GG11679@redhat.com> References: <20200921211744.24758-1-peterx@redhat.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200922160330.GH19098@xz-x1> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/22, Peter Xu wrote: > > On Tue, Sep 22, 2020 at 05:48:46PM +0200, Oleg Nesterov wrote: > > > However since I didn't change this logic in this patch, it probably means this > > > bug is also in the original code before this series... I'm thinking maybe I > > > should prepare a standalone patch to clear the swp_entry_t and cc stable. > > > > Well, if copy_one_pte(src_pte) hits a swap entry and returns entry.val != 0, then > > pte_none(*src_pte) is not possible after restart? This means that copy_one_pte() > > will be called at least once. > > Note that we've released the page table locks, so afaict the old swp entry can > be gone under us when we go back to the "do" loop... :) But how? I am just curious, I don't understand this code enough. Oleg.