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.1 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 C6AAFC433B4 for ; Tue, 18 May 2021 23:45:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A63ED61074 for ; Tue, 18 May 2021 23:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230509AbhERXqa (ORCPT ); Tue, 18 May 2021 19:46:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32232 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230088AbhERXq2 (ORCPT ); Tue, 18 May 2021 19:46:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621381509; 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=NyB3nRYXEIw9i58PAbApIYiWHD6bmSqOFX83eNLmrgQ=; b=L23rmrEU7y+LtH+385bATlZv4vdTC+aY0qDj2XLeoC2nWIcZcUQ+d6bNyWz65/p9qUcacg 4QCQXY0G9itvCftdHheyKFx9ddzWvhSwUEQ4qbyG7gIibHXQUElByZutKLqK+4ZFumMRAX YX3BfxGVfIQB8gjADYes/PDuLFvEJLU= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-8-vZNFEjmRMb-fME-QsHCLUg-1; Tue, 18 May 2021 19:45:08 -0400 X-MC-Unique: vZNFEjmRMb-fME-QsHCLUg-1 Received: by mail-qt1-f197.google.com with SMTP id j12-20020ac8550c0000b02901dae492d1f2so8602595qtq.0 for ; Tue, 18 May 2021 16:45:08 -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=NyB3nRYXEIw9i58PAbApIYiWHD6bmSqOFX83eNLmrgQ=; b=VYXmzVGZgBGIaY1vWYyswfQqzHVLPqTc7gXwQlqcdgcyv2tpUKC0/ONlDhJvJQrOSK Hga0xJOPyy4/jpazo0N/0YRQ3mXBDZ6a108aqWpHSbzzLHnigTUkA3o1Dey2IvsWYFyN 3yEpD5K6EyVHnEhu8+adq5xRrkRKp0OpbUZMOcMbEWZgRCN4aUZnyNikeZXlvSRoArIz 6Lfkpszc7VD/s/vxKyk5BifxFtXdwIBten7CTJ1hN+VaztKawgwDH6BYl1BzYNWXaluS O/gdvreknetSXFTsNVdwP2A03rQbgjeoK2DJIzSyLI6bnL9Xyhl0PmUtK8DrE1DOvY9T S3WQ== X-Gm-Message-State: AOAM531N4zaC1/T1SmyE4RNc8h6v7yMxnYAxA3l4TbG0MhVTiHBcUGGk VQEWAezXaGj1Q+fdgsPLksExfYrHqvqRv3rPWXhgcTiCdZLj75hGqlsFcv2BATkvAegTAJltoOH 3tGm2QfUqV1383bzU3mR4KLRJ X-Received: by 2002:a05:622a:350:: with SMTP id r16mr7491990qtw.27.1621381507345; Tue, 18 May 2021 16:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7ExMzzZXtIx7iGUTcSpCi16S7VAiLXsFhzha61Te2cv+Okvdh1uyfL/4TjC80GU7c5+ldwA== X-Received: by 2002:a05:622a:350:: with SMTP id r16mr7491943qtw.27.1621381506771; Tue, 18 May 2021 16:45:06 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-72-184-145-4-219.dsl.bell.ca. [184.145.4.219]) by smtp.gmail.com with ESMTPSA id 7sm15927040qtu.38.2021.05.18.16.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 16:45:06 -0700 (PDT) Date: Tue, 18 May 2021 19:45:05 -0400 From: Peter Xu To: Jason Gunthorpe Cc: Alistair Popple , linux-mm@kvack.org, nouveau@lists.freedesktop.org, bskeggs@redhat.com, akpm@linux-foundation.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, jhubbard@nvidia.com, rcampbell@nvidia.com, jglisse@redhat.com, hch@infradead.org, daniel@ffwll.ch, willy@infradead.org, bsingharora@gmail.com, Christoph Hellwig Subject: Re: [PATCH v8 5/8] mm: Device exclusive memory access Message-ID: References: <20210407084238.20443-1-apopple@nvidia.com> <20210407084238.20443-6-apopple@nvidia.com> <47694715.suB6H4Uo8R@nvdebian> <20210518173334.GE1002214@nvidia.com> <20210518194509.GF1002214@nvidia.com> <20210518230327.GG1002214@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210518230327.GG1002214@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 18, 2021 at 08:03:27PM -0300, Jason Gunthorpe wrote: > Logically during fork all these device exclusive pages should be > reverted back to their CPU pages, write protected and the CPU page PTE > copied to the fork. > > We should not copy the device exclusive page PTE to the fork. I think > I pointed to this on an earlier rev.. Agreed. Though please see the question I posted in the other thread: now I am not very sure whether we'll be able to mark a page as device exclusive if that page has mapcount>1. > > We can optimize this into the various variants above, but logically > device exclusive stop existing during fork. Makes sense, I think that's indeed what this patch did at least for the COW case, so I think Alistair did address that comment. It's just that I think we need to drop the other !COW case (imho that should correspond to the changes in copy_nonpresent_pte()) in this patch to guarantee it. I also hope we don't make copy_pte_range() even more complicated just to do the lock_page() right, so we could fail the fork() if the lock is hard to take. -- Peter Xu 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 C16E2C433B4 for ; Wed, 19 May 2021 16:29:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8739561007 for ; Wed, 19 May 2021 16:29:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8739561007 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=nouveau-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B3E76EE2B; Wed, 19 May 2021 16:29:12 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 628FC6E106 for ; Tue, 18 May 2021 23:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621381511; 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=NyB3nRYXEIw9i58PAbApIYiWHD6bmSqOFX83eNLmrgQ=; b=A2azpbbzdV/hO2S7UbDnm1Fx2eXKsptBL034xKb3UlLDkbq81PQhDZoUD4pgiUcK6YbySp XAV6Hn5WoWOcGs+xbPOZraJ7jR6wdTngSdwgpPkXNVruH7qkCECWrI5UYYCTXVCwBM+k5p 7y6JT25I5ausTL1NAx1XNt1E63DVrKY= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-Ua3gkldDPBSdLsXYAw_KHQ-1; Tue, 18 May 2021 19:45:08 -0400 X-MC-Unique: Ua3gkldDPBSdLsXYAw_KHQ-1 Received: by mail-qk1-f198.google.com with SMTP id r25-20020a05620a03d9b02903a58bfe037cso2507814qkm.15 for ; Tue, 18 May 2021 16:45:08 -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=NyB3nRYXEIw9i58PAbApIYiWHD6bmSqOFX83eNLmrgQ=; b=X89g4tL4YvpYgP7PL7EIAgefvER0qqRazDDENx7GcMhCeFYcLatPi84qxHQOzsX1qP pENlRRFfuT7XE5Fe+FGXEE4pkNIYQlwRm0zqNKqsQNNg+wma2xwgFYUFjeqF+josuMRi f0wjFRKs0lDXVVHkCkuAl4hyQrJXqRLKVKviZYGm3s8dXakuVDoFDmAPD/nQwcnCRa70 Ty2G4cwtLwU9Gjl1yN51B4VCbKjvdBsqJ/bwZT75OYh9NcOTzrJ2XFo8PopFJDY3BRY3 3B5WkrdEjvpnywY2RxtIItTp4+0sWVJUzgXggGndEN3U5B6uBosYr78vUg/aermM8FcI t0OQ== X-Gm-Message-State: AOAM530Twnfy4UraxqK6KlVcwH2lRKsjEmYM03usU2P7rb/bMjB/fk52 XAmAzvntYJZFWzKicwONaalKRJB6w2JNl7phCS+uFWrMkEX0Pz1EGjOnxvJO+tl2Av/LLLn+joI ozlx4M+o80RMMZa0/2sbmY7LHFA== X-Received: by 2002:a05:622a:350:: with SMTP id r16mr7491995qtw.27.1621381507347; Tue, 18 May 2021 16:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7ExMzzZXtIx7iGUTcSpCi16S7VAiLXsFhzha61Te2cv+Okvdh1uyfL/4TjC80GU7c5+ldwA== X-Received: by 2002:a05:622a:350:: with SMTP id r16mr7491943qtw.27.1621381506771; Tue, 18 May 2021 16:45:06 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-72-184-145-4-219.dsl.bell.ca. [184.145.4.219]) by smtp.gmail.com with ESMTPSA id 7sm15927040qtu.38.2021.05.18.16.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 16:45:06 -0700 (PDT) Date: Tue, 18 May 2021 19:45:05 -0400 From: Peter Xu To: Jason Gunthorpe Message-ID: References: <20210407084238.20443-1-apopple@nvidia.com> <20210407084238.20443-6-apopple@nvidia.com> <47694715.suB6H4Uo8R@nvdebian> <20210518173334.GE1002214@nvidia.com> <20210518194509.GF1002214@nvidia.com> <20210518230327.GG1002214@nvidia.com> MIME-Version: 1.0 In-Reply-To: <20210518230327.GG1002214@nvidia.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-Disposition: inline X-Mailman-Approved-At: Wed, 19 May 2021 16:29:11 +0000 Subject: Re: [Nouveau] [PATCH v8 5/8] mm: Device exclusive memory access X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rcampbell@nvidia.com, willy@infradead.org, linux-doc@vger.kernel.org, nouveau@lists.freedesktop.org, bsingharora@gmail.com, Alistair Popple , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, hch@infradead.org, linux-mm@kvack.org, bskeggs@redhat.com, daniel@ffwll.ch, akpm@linux-foundation.org, Christoph Hellwig Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Tue, May 18, 2021 at 08:03:27PM -0300, Jason Gunthorpe wrote: > Logically during fork all these device exclusive pages should be > reverted back to their CPU pages, write protected and the CPU page PTE > copied to the fork. > > We should not copy the device exclusive page PTE to the fork. I think > I pointed to this on an earlier rev.. Agreed. Though please see the question I posted in the other thread: now I am not very sure whether we'll be able to mark a page as device exclusive if that page has mapcount>1. > > We can optimize this into the various variants above, but logically > device exclusive stop existing during fork. Makes sense, I think that's indeed what this patch did at least for the COW case, so I think Alistair did address that comment. It's just that I think we need to drop the other !COW case (imho that should correspond to the changes in copy_nonpresent_pte()) in this patch to guarantee it. I also hope we don't make copy_pte_range() even more complicated just to do the lock_page() right, so we could fail the fork() if the lock is hard to take. -- Peter Xu _______________________________________________ Nouveau mailing list Nouveau@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/nouveau 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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 55A48C433ED for ; Tue, 18 May 2021 23:45:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1C087610CB for ; Tue, 18 May 2021 23:45:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C087610CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FD4E6E101; Tue, 18 May 2021 23:45:18 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 61FE66E101 for ; Tue, 18 May 2021 23:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621381511; 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=NyB3nRYXEIw9i58PAbApIYiWHD6bmSqOFX83eNLmrgQ=; b=A2azpbbzdV/hO2S7UbDnm1Fx2eXKsptBL034xKb3UlLDkbq81PQhDZoUD4pgiUcK6YbySp XAV6Hn5WoWOcGs+xbPOZraJ7jR6wdTngSdwgpPkXNVruH7qkCECWrI5UYYCTXVCwBM+k5p 7y6JT25I5ausTL1NAx1XNt1E63DVrKY= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-jH_YRZ3WPKuLXRsXkkAolg-1; Tue, 18 May 2021 19:45:08 -0400 X-MC-Unique: jH_YRZ3WPKuLXRsXkkAolg-1 Received: by mail-qt1-f200.google.com with SMTP id 69-20020aed304b0000b02901c6d87aed7fso8489531qte.21 for ; Tue, 18 May 2021 16:45:08 -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=NyB3nRYXEIw9i58PAbApIYiWHD6bmSqOFX83eNLmrgQ=; b=BE360ngBKHOwT/5BelaIRu3q/06dfa0KWns9JMbP8aX9F5Oo2KeMoIQyMia05MNOQM B1P9BxCL8VZvQigWIhXmRqeApNUtjUJT4hBH5GdZkyrpO0+sbiBxW5ny2kDZMkNDqsdq geLho/D3yHkdbHgYEeN4bbCXAaZSYF/jAnztdzHQuz5jQj+1xufsU8jTTyFCgmpyUvP8 sfR2q6curRWbkhioXoUnL6+J755i/BEVeVcBdhNtGkGbj1MgwKcC1VJzZQRSvwVqhX7s m9AE+LlMMI0+hefkQ9xDcAdOHWw0RVvIdblKNMvbeAYGWKyXAPVxzK/QWEobayrvSoeK k44g== X-Gm-Message-State: AOAM5302s9onzhljUa/ey0ylquLFPtlIj2q6gGUXpyzzXWvGp/gN+w1I umyICWo3BhxtdxSGXuwTQSiiCuwpj2n49HGkP9Q1YVYjSJZ2F4Gh4y5jbOE4f/FRjTH5X+rRHUe pox03okvnXi+t4iMCStDW1krg/2DV X-Received: by 2002:a05:622a:350:: with SMTP id r16mr7491996qtw.27.1621381507347; Tue, 18 May 2021 16:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7ExMzzZXtIx7iGUTcSpCi16S7VAiLXsFhzha61Te2cv+Okvdh1uyfL/4TjC80GU7c5+ldwA== X-Received: by 2002:a05:622a:350:: with SMTP id r16mr7491943qtw.27.1621381506771; Tue, 18 May 2021 16:45:06 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-72-184-145-4-219.dsl.bell.ca. [184.145.4.219]) by smtp.gmail.com with ESMTPSA id 7sm15927040qtu.38.2021.05.18.16.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 16:45:06 -0700 (PDT) Date: Tue, 18 May 2021 19:45:05 -0400 From: Peter Xu To: Jason Gunthorpe Subject: Re: [PATCH v8 5/8] mm: Device exclusive memory access Message-ID: References: <20210407084238.20443-1-apopple@nvidia.com> <20210407084238.20443-6-apopple@nvidia.com> <47694715.suB6H4Uo8R@nvdebian> <20210518173334.GE1002214@nvidia.com> <20210518194509.GF1002214@nvidia.com> <20210518230327.GG1002214@nvidia.com> MIME-Version: 1.0 In-Reply-To: <20210518230327.GG1002214@nvidia.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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rcampbell@nvidia.com, willy@infradead.org, linux-doc@vger.kernel.org, nouveau@lists.freedesktop.org, bsingharora@gmail.com, Alistair Popple , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, hch@infradead.org, linux-mm@kvack.org, jglisse@redhat.com, bskeggs@redhat.com, jhubbard@nvidia.com, akpm@linux-foundation.org, Christoph Hellwig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, May 18, 2021 at 08:03:27PM -0300, Jason Gunthorpe wrote: > Logically during fork all these device exclusive pages should be > reverted back to their CPU pages, write protected and the CPU page PTE > copied to the fork. > > We should not copy the device exclusive page PTE to the fork. I think > I pointed to this on an earlier rev.. Agreed. Though please see the question I posted in the other thread: now I am not very sure whether we'll be able to mark a page as device exclusive if that page has mapcount>1. > > We can optimize this into the various variants above, but logically > device exclusive stop existing during fork. Makes sense, I think that's indeed what this patch did at least for the COW case, so I think Alistair did address that comment. It's just that I think we need to drop the other !COW case (imho that should correspond to the changes in copy_nonpresent_pte()) in this patch to guarantee it. I also hope we don't make copy_pte_range() even more complicated just to do the lock_page() right, so we could fail the fork() if the lock is hard to take. -- Peter Xu