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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE5D9FA3741 for ; Fri, 28 Oct 2022 01:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235532AbiJ1BcQ (ORCPT ); Thu, 27 Oct 2022 21:32:16 -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-Google-Smtp-Source: AMsMyM4XBcp/I/fJ3W6TgmzA2JGzNhm3lSOLz+l1rdRK8SGnaXXOumsAPQYQ+sr7f9e1Avdx/C5cdg== 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 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