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 C73B2ECAAA1 for ; Fri, 28 Oct 2022 14:40:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C20E6B0078; Fri, 28 Oct 2022 10:40:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 573BF6B007B; Fri, 28 Oct 2022 10:40:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43A646B007D; Fri, 28 Oct 2022 10:40:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 383F76B0078 for ; Fri, 28 Oct 2022 10:40:07 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D07CDC07E3 for ; Fri, 28 Oct 2022 14:40:06 +0000 (UTC) X-FDA: 80070618012.26.9C27ECD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf04.hostedemail.com (Postfix) with ESMTP id A442B40036 for ; Fri, 28 Oct 2022 14:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666968004; 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=D8u03zJ9W/9aPpgScCpedLnCuBIcs476DTocYuAgwTQ=; b=MsI90uqhsa0YrFXIyXrlSXPrfOc4u5g6N+ZcbKjvHO/LBBvypdtQL/zkEiJQsN0cAMOp5c NTZ4lEGYwrwRIl83bWStzJEBcYDWEFYc9clXmisnuriSZuDp2oAP9fsblwUkaYR9qMGeeW R6ZTBtdvJJLzEwdbd2rogdKqVdK0TWg= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-137-kJRaglP-PvWJg5KJV-ZAmw-1; Fri, 28 Oct 2022 10:40:02 -0400 X-MC-Unique: kJRaglP-PvWJg5KJV-ZAmw-1 Received: by mail-io1-f72.google.com with SMTP id a14-20020a6b660e000000b006bd37975cdfso4478715ioc.10 for ; Fri, 28 Oct 2022 07:40:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D8u03zJ9W/9aPpgScCpedLnCuBIcs476DTocYuAgwTQ=; b=XEGSYYCyDdHpm1Ukp6bMX5wnB+oQ0s9npnC2IoDGH8t1mR9KIm0lnuai0rOVPKMWPl DLk2lFMWl34GHZTnBfaIYACmRt8LrEKgtwOCahcBQ3iZSvCSwfmn+I3ZhSK9QifCukaG JoH2oN+nbebOBE4l1d67e3JQz07K2s8AdY+uB81iW+8YF7gzBPmeOoTZqgp/qPNA89f+ gKBij1r8fMabspatHLr/7al3aOE1ZJOqew2qNUTEjMb60j8avnDF0g+bXqp19EW1XoXF DGkQRmgo+j/HHmHmw9E084So27oAl046jcp2af4PItaiBzf5yqoKbjif6IMh0EVL3pjr Vxhw== X-Gm-Message-State: ACrzQf2I6WbrEYo4tbauAx5cFFESUUHZRgKna5IM3XmDIDmOY1FF/UB3 NMEUiFBBm5pDNzEj/uijfki6WLtOgmjbEKzasr0MBngNFjLl+duCK/FaO7AbMYj7ujIHWspbf2l GTgbRItodLmc= X-Received: by 2002:a6b:3ed4:0:b0:6b6:9e4b:4c40 with SMTP id l203-20020a6b3ed4000000b006b69e4b4c40mr33778058ioa.11.1666968001860; Fri, 28 Oct 2022 07:40:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7BP97wXNo6tvFx31on64A0evagjI1RVqWCRAz+6aF8sGPc1Byafy0wFnz/lBsANsOPjWzrUA== X-Received: by 2002:a6b:3ed4:0:b0:6b6:9e4b:4c40 with SMTP id l203-20020a6b3ed4000000b006b69e4b4c40mr33778040ioa.11.1666968001559; Fri, 28 Oct 2022 07:40:01 -0700 (PDT) Received: from x1n (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id e18-20020a026d52000000b003740de9fb65sm1803968jaf.46.2022.10.28.07.40.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 07:40:00 -0700 (PDT) Date: Fri, 28 Oct 2022 10:39:59 -0400 From: Peter Xu To: Hugh Dickins Cc: 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() Message-ID: 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> MIME-Version: 1.0 In-Reply-To: <432c4428-b6d4-f93-266-b920a854c3c@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666968006; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=D8u03zJ9W/9aPpgScCpedLnCuBIcs476DTocYuAgwTQ=; b=Ty3ApjEoI5obmUlvawhfLFDMuUU9DYnJkN8b0v14ktZdW03xHVObv9DMmKSPbFjnvFVaLw 7YKZlM2o47XWu8GmR9LSmDyQVgUr8QMFRB02f+2V3mOBWdm3O1OEq3dUwjzJ6MfHEGDX6M IW7bd9z5G5PMvon1np8IVHs+EzVFlTw= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MsI90uqh; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666968006; a=rsa-sha256; cv=none; b=LfHKwFztiL4+SITXqp9ETx/gTVl6E9MrvrnBPsJScAn7g4ii1EQsIw22kKpIGtxBaw4x4l nyRYe9lFMy/gJOI8awO8bnSJQhmgs5E/8CLLAzbzdCE5Kyb+SfXSVIwLNvQhtxhMCwYzMB TahyxCMYWIhda1iURLBEgWLMsNXX744= X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: A442B40036 X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MsI90uqh; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com X-Stat-Signature: s5qh9e3zs1tfriuu6d9kbm5a4qfamco7 X-HE-Tag: 1666968004-96454 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000631, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Oct 27, 2022 at 06:32:01PM -0700, Hugh Dickins wrote: > 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. Thanks for raising this from the start, Hugh. It's definitely worthwhile to discuss this topic which is not obvious at all at least to me, and merge even the same patch would be different before/after such a discussion, since we're clearer on the side effects. > > 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!) I've acked directly on v2, note that after this discussion IMHO the comment of !Anon check can be slightly improved (e.g. add some more information on why we decided to not copy the page even if anon_vma existed), but I don't want to be harsh on any stable backports that helps resolving problems already in correct ways. Thanks, -- Peter Xu