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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61F9BECE57E for ; Mon, 9 Sep 2024 22:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Mime-Version:References:In-Reply-To:Message-Id:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4lbaYuxtmVBFbdE5PyZzV4g5TY5seZg4JkZw+9mBAa4=; b=oNXZ6L/oR/bRqyPPAlMpOUl5fq L3WeMG8vben3DHsYupvvnQ5I5kJ6CBVzUtjR7yRsN8iVLUJhtlclhGZWQ4cSkEtfRBrp2Pz3KJ0Ec Y74uaC+t+4dR4OvzdOXlY1yQkrerz+J6SJ0kSVtlICge1Gp7a6aKaiS8RjZKivyUCoL+FFCbpQHKW Cp3qBKPwnDZ1FJ4Ncvi6ub4BRe+y4nINTeZQl1S3fjM5uvJXVuRglb7PjTBACafxM2u5WHvqGMjyS IjgBRfpU7XQKOzHgnXGB31TBLxzx5leZC847XS4g98Ig8afL4Rs4ogS85lv/P+PWfbks5jxSVpdxD snig0CrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1snmqS-00000003TUl-2pK2; Mon, 09 Sep 2024 22:26:52 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1snmpQ-00000003THt-3Kt9 for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2024 22:25:50 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 380BA5C0146; Mon, 9 Sep 2024 22:25:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6907C4CEC5; Mon, 9 Sep 2024 22:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1725920747; bh=4DtzlsFCtPBbW6YIoPEm8DoQZTy56mCz90TYajj6fEU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=1eDi1aFNs3Up7hg68+tzcLXlQmtYG+Rjn7OjkCaE09QrgYshaLno0Sr9g50pUA9za 8wKei6dV52DSkpwvoHrI6kRfW+qyoTV5lxxfddYuXlIHsjmkk3KwGb2nM9OHlPIDvT v88QXWRdkWSyqDF1kZnmg001pde8cmzkhaPTXYWo= Date: Mon, 9 Sep 2024 15:25:46 -0700 From: Andrew Morton To: Peter Xu Cc: Yan Zhao , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Gavin Shan , Catalin Marinas , x86@kernel.org, Ingo Molnar , Paolo Bonzini , Dave Hansen , Thomas Gleixner , Alistair Popple , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sean Christopherson , Oscar Salvador , Jason Gunthorpe , Borislav Petkov , Zi Yan , Axel Rasmussen , David Hildenbrand , Will Deacon , Kefeng Wang , Alex Williamson Subject: Re: [PATCH v2 07/19] mm/fork: Accept huge pfnmap entries Message-Id: <20240909152546.4ef47308e560ce120156bc35@linux-foundation.org> In-Reply-To: References: <20240826204353.2228736-1-peterx@redhat.com> <20240826204353.2228736-8-peterx@redhat.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240909_152548_937869_4A03AA1E X-CRM114-Status: GOOD ( 20.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 3 Sep 2024 17:23:38 -0400 Peter Xu wrote: > > > @@ -1686,8 +1706,11 @@ int copy_huge_pud(struct mm_struct *dst_mm, struct mm_struct *src_mm, > > > * TODO: once we support anonymous pages, use > > > * folio_try_dup_anon_rmap_*() and split if duplicating fails. > > > */ > > > - pudp_set_wrprotect(src_mm, addr, src_pud); > > > - pud = pud_mkold(pud_wrprotect(pud)); > > > + if (is_cow_mapping(vma->vm_flags) && pud_write(pud)) { > > > + pudp_set_wrprotect(src_mm, addr, src_pud); > > > + pud = pud_wrprotect(pud); > > > + } > > Do we need the logic to clear dirty bit in the child as that in > > __copy_present_ptes()? (and also for the pmd's case). > > > > e.g. > > if (vma->vm_flags & VM_SHARED) > > pud = pud_mkclean(pud); > > Yeah, good question. I remember I thought about that when initially > working on these lines, but I forgot the details, or maybe I simply tried > to stick with the current code base, as the dirty bit used to be kept even > in the child here. > > I'd expect there's only performance differences, but still sounds like I'd > better leave that to whoever knows the best on the implications, then draft > it as a separate patch but only when needed. Sorry, but this vaguensss simply leaves me with nowhere to go. I'll drop the series - let's revisit after -rc1 please.