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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8FC0C38A02 for ; Fri, 28 Oct 2022 04:26:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 137746B0074; Fri, 28 Oct 2022 00:26:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E87F6B0075; Fri, 28 Oct 2022 00:26:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF1338E0001; Fri, 28 Oct 2022 00:26:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id DF05E6B0074 for ; Fri, 28 Oct 2022 00:26:20 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A6126A0B67 for ; Fri, 28 Oct 2022 04:26:20 +0000 (UTC) X-FDA: 80069071320.19.30A996F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 899ED1C000D for ; Fri, 28 Oct 2022 04:26:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666931178; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1cEAc7Hi237RKPiSEF0PtMgwXplwCqgvBPVDp1f9TTo=; b=Bh6n1VyjJDCMzEq14Yvmo8LpQMaAUEfQCR5sxboXPlw+Yo49/jX+t0sYOoH/6u8qevciSG Rb3jVCgDhKIUlQ99QijWx4AXF9F4c2cXYXWaoR1FQMYpTyGdZbC4PRSu2QwKm8WUS23v64 MiuQOTNSjeSEpS3Nf0kNv6e4TwZivYU= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-311-bHhKkag7NMGjyNrJuZrSsw-1; Fri, 28 Oct 2022 00:26:17 -0400 X-MC-Unique: bHhKkag7NMGjyNrJuZrSsw-1 Received: by mail-wr1-f71.google.com with SMTP id i14-20020adfa50e000000b0023652707418so912430wrb.20 for ; Thu, 27 Oct 2022 21:26:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1cEAc7Hi237RKPiSEF0PtMgwXplwCqgvBPVDp1f9TTo=; b=f6sd8Rgt3V4ed51CK5CdNGe4SLIjP1EqZpicrMnTyRY0M7YdGX+5Lx5YiZ+wAGgXCf 5CAgn92ZLGeoz4ad5oopaEaekNEFY91IXO0dmRudBUtwgAsBn5Ty2GL3KHugxJM2rDlY O6S2/GfQXe2uoUm+Inz5eR2Sc0WoFf2GuXQ0Jz+Hd3zfoXkS0NZNjQmIHZV3PbLB41di 5BGrVSdSeHX7kg7qVT/hYH5c3Mg+HEXn60db2gEz4TqPRH3DkBsJahrtcrAGLhnZIcU5 wNMGMWu6nGfeZnvW7N7tEEBOUflH91nqQGfrLuxYaVzfcBMogpMCU18NuPnjx8LKa9BR 1Pmw== X-Gm-Message-State: ACrzQf3rlaJ/JWon0gO5MtQrtIV2I4gESgJ6i67brz6j0YWxu8Vf2aiw I66FixQIDfPL/0C21TqFbkA5jCV5hKJHvOm+gYvSShLK4nNZ2LY2JNq1HYMOF3PZAKCG5wzcNS/ xadTvgOoBUSs= X-Received: by 2002:a05:600c:474a:b0:3c8:3299:5ba9 with SMTP id w10-20020a05600c474a00b003c832995ba9mr8166643wmo.3.1666931176212; Thu, 27 Oct 2022 21:26:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Zv8+uSxnn7hDyJbhoEG4ao9e9S+br+6l/SCoLy9GsSBv11BVKx+wXcm58HTu4ykyFZ8UVxQ== X-Received: by 2002:a05:600c:474a:b0:3c8:3299:5ba9 with SMTP id w10-20020a05600c474a00b003c832995ba9mr8166625wmo.3.1666931175905; Thu, 27 Oct 2022 21:26:15 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:c100:8448:bf98:23a4:ac94? (p200300cbc704c1008448bf9823a4ac94.dip0.t-ipconnect.de. [2003:cb:c704:c100:8448:bf98:23a4:ac94]) by smtp.gmail.com with ESMTPSA id o12-20020a5d58cc000000b00236705daefesm2577551wrf.39.2022.10.27.21.26.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Oct 2022 21:26:15 -0700 (PDT) Message-ID: <623247f8-6b1d-b517-2053-6d5fb2cb418c@redhat.com> Date: Fri, 28 Oct 2022 06:26:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH STABLE 5.10] mm/memory: add non-anonymous page check in the copy_present_page() To: Hugh Dickins , Peter Xu Cc: Yuanzheng Song , akpm@linux-foundation.org, gregkh@linuxfoundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20221024094911.3054769-1-songyuanzheng@huawei.com> <3823471f-6dda-256e-e082-718879c05449@google.com> <8aad435-bdc6-816f-2fe4-efe53abd6e5@google.com> <432c4428-b6d4-f93-266-b920a854c3c@google.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <432c4428-b6d4-f93-266-b920a854c3c@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Bh6n1Vyj; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666931180; a=rsa-sha256; cv=none; b=8W5QxMAHM/SpD5HCdm37ArElGoASvQz2hjlGh4jiwB+SpudVQ+z22SIKU91ieX8TTQKyIg 9+R3AQNnOwZE/YeCEkG1h/ydZetrngxt1vqiKXrVes8T0Z/7/Tm5os3t3PoOVOxXU88o+q Aad9PqvB/x5XSkUQS7BmxDyYG9+htPs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666931180; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1cEAc7Hi237RKPiSEF0PtMgwXplwCqgvBPVDp1f9TTo=; b=1Yxclb2Zf8Xnfvxph3drjA5eIOPwVmMZBARdicox817MPzKgBybLf1nn2Q8bipdgQQBVjL NeLSoibUKkJZiOQv3aHHa4pfKykHPQFSvN1+09V0Bv9QovYGdaB738FjcuGNNOQC53ea8E 8V+kQFaEBUe4hC26tquzFD6pXS9FVDs= X-Rspam-User: X-Rspamd-Queue-Id: 899ED1C000D Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Bh6n1Vyj; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: z9iuhrsty9qp6pwu59npxd9rd1qghx35 X-Rspamd-Server: rspam10 X-HE-Tag: 1666931179-956246 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 28.10.22 03:32, Hugh Dickins wrote: > Reinstating Cc stable, which I removed just before the discussion settled. Sorry for not reading the full thread before and considering Peters mail; I had to take short cuts :) > > 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!) Unless someone tells me why I am obviously wrong Acked-by: David Hildenbrand -- Thanks, David / dhildenb