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.3 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 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 0C0FAC4363D for ; Tue, 22 Sep 2020 16:03:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7E0EF208A9 for ; Tue, 22 Sep 2020 16:03:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="itEcT1Vs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E0EF208A9 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 D6FD690004C; Tue, 22 Sep 2020 12:03:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D464290000A; Tue, 22 Sep 2020 12:03:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C344890004C; Tue, 22 Sep 2020 12:03:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id AE42C90000A for ; Tue, 22 Sep 2020 12:03:42 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 493238249980 for ; Tue, 22 Sep 2020 16:03:42 +0000 (UTC) X-FDA: 77291167884.13.death08_4211baa2714f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 9F9DF18140B67 for ; Tue, 22 Sep 2020 16:03:41 +0000 (UTC) X-HE-Tag: death08_4211baa2714f X-Filterd-Recvd-Size: 4787 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Sep 2020 16:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600790617; 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=kwkIumcqGzjBzZptTpViZugyJRhZCaJYwosFjtUl6TY=; b=itEcT1VsoXnlM1iI2+6BSOCIjCsSRX6zB6+az4bTbdRP7EPqNO/yUHuVthbAG5Trb8Yt9T NWPTX1V22P6OCVOSvduY3R2HKjhrlW2tR4Rq3Flt8FM3/aUugjDYZ3KtJBZDb0+g2KKOB6 uzbhjdQ6swPY7zSIcSI9Kf2RsZCtR4Q= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-eE6-UxQAO3eVD_S7AOnX7w-1; Tue, 22 Sep 2020 12:03:35 -0400 X-MC-Unique: eE6-UxQAO3eVD_S7AOnX7w-1 Received: by mail-qv1-f72.google.com with SMTP id p20so11972576qvl.4 for ; Tue, 22 Sep 2020 09:03:34 -0700 (PDT) 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:in-reply-to; bh=kwkIumcqGzjBzZptTpViZugyJRhZCaJYwosFjtUl6TY=; b=Jg90Q9GFFPlfQXkRHGtDW92M5J+Kf+o4aaQH3+CAsRE7yLXmgaSvlPVbpu78oz11ir wlWGshAoljOga02UOw8l80x/2UTg/0s/db3hCMbPCgX9PokJH9PjMDXihNemovMwyL94 jjGU3Ey5pajqQE9WPTdleQq/ga6MtMO2atlWhaTtKRr0vhBFj/7mwNfA5O96dQu96aSh 5gHwQMyTsBT3GEUWQyBzWQUX2VA5zCRtXQYakCeg+nmvdyiIWXPk/j1ApHC8vDsIr+Ta +r/C9Mjb74fAUClJW3HPDj9TH+GN5dL37KA2/5rC5NtcxEUrv20A8lCf5B013wpEhKqk rO6A== X-Gm-Message-State: AOAM532h3O9xXbYalhxGV5B1jKFgMlmhgDhSd1cyxDlxinzO8J0QopFy rdsbOShlMmFc6zJUNCVhYd2IgEg1K0t2mGUHAmuRbgubjDbWf89bwy8kizgfIRZeFY84nBq9Jvi 6hnkXq8JbDtg= X-Received: by 2002:a05:620a:4d9:: with SMTP id 25mr656114qks.285.1600790614354; Tue, 22 Sep 2020 09:03:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2WBpmEkrnIE7L5wh6n1brq8SIFLzkrPhF79h+d4jS9KuED2W2JmtaudJI0E5w+F+buxkp2w== X-Received: by 2002:a05:620a:4d9:: with SMTP id 25mr656011qks.285.1600790613347; Tue, 22 Sep 2020 09:03:33 -0700 (PDT) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-11-70-53-122-15.dsl.bell.ca. [70.53.122.15]) by smtp.gmail.com with ESMTPSA id s20sm11692461qkg.65.2020.09.22.09.03.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 09:03:32 -0700 (PDT) Date: Tue, 22 Sep 2020 12:03:30 -0400 From: Peter Xu To: Oleg Nesterov 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: <20200922160330.GH19098@xz-x1> 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> MIME-Version: 1.0 In-Reply-To: <20200922154845.GE11679@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 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... :) Extremely corner case, but maybe still good to fix, extra clearness as a (good) side effect. -- Peter Xu