Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1615232rwi; Thu, 27 Oct 2022 18:57:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WH2gu8KnLgCOqMktmYAZZjZ9s8GxdfD3Xsgp3Ogoe/4LxQucXJS+hgqmQ2uCdsau8WSyi X-Received: by 2002:a65:5583:0:b0:461:25fe:e982 with SMTP id j3-20020a655583000000b0046125fee982mr44189840pgs.4.1666922262496; Thu, 27 Oct 2022 18:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666922262; cv=none; d=google.com; s=arc-20160816; b=ltMYXH1hszOh0dG2p6sotGyYg5t3NZCA3V63uCyC4hAdcdxHoYw1korZR8k1dmXIED TrJZzkk3e1sz7nN+TYaBrXHUNGFyRlpCMYahbme2euWWQX1yInVPqcikOOy6giKK/oWT 9OKSpz1nw4hje3C0oc8KwqpuzwYqPk+yQKt4v1z+jVX4cueraQ3TcPegJXvoStTts7nS NPUjisGycGIdZUOjObLdfn0COHIfEvLl5/uEFI4vOXP8XQVe1Zvk/MvcscEXk5parWp6 7cHOoeh/IrUcKZ4xxVbIgn4z01iONxx6TdhZi6cXFDr/kfTEDOVjF67zNO2eoeQcTcVW lpgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=331LzS+zCTF3pctjI7hxcWQiOyXx0a+a6N3w5ukhHUE=; b=vnNoc+gBAs4tI1IxzmSUgpzCk1VFbrtwOlqSBzYyUkGWBgGNvpizhswkuwFj7Hi1DT w7wJTn7BwptpP0bd/5MvyqUoT+RQA0+gGFCs0O8pcypycdItwJyth24MoslP/r0RNzbn QC2KWLQDZmQHrEQ3O2+W8Gt5hawI3zAnaDgIoL5Nx/S0L9tiOPcorlKGmVffh0YmgxX4 HqF2BAcjguXYZEExx7F2V/7+BmwT29bTsxEMKzLBzq3Am7pQd4IdGiF14rF5tiF4tE87 So1EHcMEIOimgz9bCJOpK2aaTAj7DGi8tqJYp4ZLf4SaIDtGWGrqu52Y2pPfY0KahqGM i0lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kgs6Xv0q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m23-20020a170902bb9700b00186ba56635asi3097643pls.550.2022.10.27.18.57.31; Thu, 27 Oct 2022 18:57:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kgs6Xv0q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235273AbiJ1BcP (ORCPT + 99 others); Thu, 27 Oct 2022 21:32:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234184AbiJ1BcO (ORCPT ); Thu, 27 Oct 2022 21:32:14 -0400 Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54E999F35D for ; Thu, 27 Oct 2022 18:32:12 -0700 (PDT) Received: by mail-oo1-xc2b.google.com with SMTP id s125-20020a4a5183000000b0047fbaf2fcbcso589343ooa.11 for ; Thu, 27 Oct 2022 18:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=331LzS+zCTF3pctjI7hxcWQiOyXx0a+a6N3w5ukhHUE=; b=kgs6Xv0qIqMuqIGJ0UHFLm/ChHVo11DD7vFMu04CHNJJgZftpEG7Td58323QRBU/x+ TjJQYkhu7uZ24KkjRIGek7a5SljPW4FToR+YgHVJQsBjUxdJ+CwJ+i+iXhP7f/pdwfMk 8MF94v33ZvOAUNoJPSdcy/wo3bPPQQ8HK2IY96nONBMbw+Zp13LFWqEjPW9OswSD4yL8 9OTcWmJsgMWoqyH6+F2Cavbzrn/sJjxNGVzj8yx6yqipH46d64o+vETHsCCuOp3FDa/R 8G16VN9gvmP1UODU7CPnVsEfXI3NUadvYlyAiU1xwiS++uMDl9vYLCqSOUzkTqBTEvhr /ypQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=331LzS+zCTF3pctjI7hxcWQiOyXx0a+a6N3w5ukhHUE=; b=zGBp9jv0qLav5DkvqoHySLd/SGFiFOwEoeMlJrnFox/Tkk+T9LOBF7j93CLM3ozgS+ AeQ3c+Iq78ofrWqIfRqP9CXxEERosaSzHI/cZhPEFnaWsMcWb4C3ILAkpdCiWgcbcV3H gIyl0AHHi/BCkEU1DmIvJY/3+Ne/Z3RQE5qiUEBgzdauvCZSCadHyEHntqYJfeORti1a tvWQdCzoCu1hywrrCnS9BQWg/3HwiQqFRFVBlx0nmQtslgdPVPUbLzrcXxOTWKXf/hHX qSkMnG11bNhgFAeFgeW+wk6oOlI0739/rvrR6LPiSBhiIEqiHdp21jDrQAgli31M7KPP JLtg== X-Gm-Message-State: ACrzQf23YodOsGAJTn8+iao2eIRe9xn1+2hq6MNqbvg1lfpRy2fXZCDx MuavBqlFTho0lShbTfR9/ID2A2CYtuzZoA== X-Received: by 2002:a4a:ab0c:0:b0:47f:653f:693e with SMTP id i12-20020a4aab0c000000b0047f653f693emr22777153oon.86.1666920731528; Thu, 27 Oct 2022 18:32:11 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id 126-20020a4a0384000000b00480816a5b8csm1075684ooi.18.2022.10.27.18.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 18:32:10 -0700 (PDT) Date: Thu, 27 Oct 2022 18:32:01 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Peter Xu cc: Hugh Dickins , Yuanzheng Song , akpm@linux-foundation.org, gregkh@linuxfoundation.org, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH STABLE 5.10] mm/memory: add non-anonymous page check in the copy_present_page() In-Reply-To: Message-ID: <432c4428-b6d4-f93-266-b920a854c3c@google.com> References: <20221024094911.3054769-1-songyuanzheng@huawei.com> <3823471f-6dda-256e-e082-718879c05449@google.com> <8aad435-bdc6-816f-2fe4-efe53abd6e5@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reinstating Cc stable, which I removed just before the discussion settled. On Thu, 27 Oct 2022, Peter Xu wrote: > ... > > After a re-read and 2nd thought, I think David has a valid point in that we > shouldn't have special handling of !anon pages on CoW during fork(), > because that seems to be against the fundamental concept of fork(). > > So now I think I agree the !Anon original check does look a bit cleaner, > and also make fork() behavior matching with the old/new kernels, irrelevant > of the pin mess. Thanks Peter. So Yuanzheng's patch for 5.10 is exactly right. Sorry for leading everyone astray: my mistake was to suppose that its !PageAnon check was simply to avoid the later BUG_ON(!anon_vma): whereas David and Peter now agree that it actually corrects the semantics for fork() on file pages. I lift my hold on Yuanzheng's patch: nobody actually said "Acked-by", but I think the discussion and resolution have given better than that. (No 3rd thoughts please!) Hugh