Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp910034lql; Tue, 12 Mar 2024 01:22:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6SL3/+y93GPdXSFpBAGCDDKn8Qrw8ENASvapM41bZC8CKW17N4J77UG60ulm2hHboxydNltTiI6Q7zzY7KT6Ug6hWJ1DdGvHAoAN3sQ== X-Google-Smtp-Source: AGHT+IHdhs2oTLkkpjwKVnXCkXH6FwTzSqILsvOXMXClgxp4tURB8UC1v34amvmhUEkJQdfi3ZRk X-Received: by 2002:a50:d757:0:b0:565:665b:9c82 with SMTP id i23-20020a50d757000000b00565665b9c82mr5918938edj.8.1710231761329; Tue, 12 Mar 2024 01:22:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710231761; cv=pass; d=google.com; s=arc-20160816; b=stWvTzR86Pj/5KO2ECp6a7/cKLBQs2LOSLrEPPKTeBU9JfwExFqU7jUledcr5tKIs4 DMD+GBwPdzYBjMfxrtm/W7i9LzQfoAWBs47G6R8YIY1HykAJbXB4cb42SeNbsdEcddrf Hedle5E8EHX7hJfcM8foEgXh8B6zVxUsjZ/Y6QQNXk5G43iVj+MErePlnmL7h3k3KTqx vxicWmlXiLD1zIEy5mZ9FAaapTr2bUG0/oCcgMTowwvZhJI2vunLksebnnDcpwmjrmN0 Txm08HkW0+sgZ149w6OOU9r+jgZLP0MYavBnogyCUYuU6FONYQMEhJzsvD54keN44JhP TksA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=8EDFdCBwmXqN33aqI7afTbviqKeQA7knJzhc/Ir0Ntk=; fh=LfSVGp1Da83kJreEwJf4bv7GmbbPWYHff5c5FJ2Khuw=; b=xcJhXZN6N1+PdwQpJ/1ExDHQT4NqE2VMc2CK3GLj47f/QIQcxwRXmtWV+GcGqFi1Ik R2xkoj+uuiQ3B6Bst18r/2q33l9shqdtlWr/HlYkE4Bid9R++yU5+XP+x7e4BxavCYoY lw6IjF1FjEYEj6k2hmpAuajrJo9iU6bxZqkiBNu8HLGQXWK923IUibaqncgj0ug9QX++ E+msyUJcYs6yeFJppGKYYiuRiVtfkpo+jixtXWCA6z5ie0E+6p8x3sLgVvymTk73kmut kr/QBpYpu1w4j6Bs/HnBtEH0pcRaX/i25xli1G062ZxJcmLIlRROwwMXli8MUF4cAf1i iPEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="P/HgYrYJ"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-99948-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y18-20020a056402441200b00566495c8931si3274810eda.320.2024.03.12.01.22.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 01:22:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99948-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="P/HgYrYJ"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-99948-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DF3C11F21D9A for ; Tue, 12 Mar 2024 08:22:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94AF569D09; Tue, 12 Mar 2024 08:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="P/HgYrYJ" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E44066997E for ; Tue, 12 Mar 2024 08:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710231754; cv=none; b=KQowZJdMIIlZlr4M8TKQw5yk34JRuFk3SmqL76ZWpfBo22gAQKnXnF/4gAfRB2MIJhUw/DtBiM6Md+HlIeRd8AFzlPoqyVu3xxuowb1Em/yOfB4hhiI/Teev4idlEFCKH5UXOKiryGsGFyf4tSJnIyZGmHORb+6qtkNacDrrt8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710231754; c=relaxed/simple; bh=Js5Y2ruMyrBZCWGdUGX22PYWuOKjgSJ/fC03lSY7p9Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=X8vJWE5ktig30ZIKOApFdWthbxA/LmAAb9CO6QuF9tHqyEKmj1DBPVOQsVlUTXQbQD7wIbQOCDb+fYErs5MP+exwR70W/ZYz0waBY74pA5t+JvyXIl/nbOGdWPKeUVChwpW/g6U/mJrhrj2monBhomGILhZpZFuNhSDc2V/zNGk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=P/HgYrYJ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710231751; 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:autocrypt:autocrypt; bh=8EDFdCBwmXqN33aqI7afTbviqKeQA7knJzhc/Ir0Ntk=; b=P/HgYrYJcw6oecUuTs67tvFrjtRAwHaiGc0ZR1ULWHiWtr7ox4BzbntatzzWykBav+KP70 ew8M9Hfj2uZlWlkE+R0N72Sn23nqL4j/6vBawnDw6joeSa0wZuDy61nDeHv2i2y6Ycj//U krFvB4hIOHgE8AYMh3tGZfFBvBZrB4U= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-146-vw2uHxCsM5GGZxYOwzLzqg-1; Tue, 12 Mar 2024 04:22:29 -0400 X-MC-Unique: vw2uHxCsM5GGZxYOwzLzqg-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-513b2e92c19so1650092e87.3 for ; Tue, 12 Mar 2024 01:22:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710231748; x=1710836548; h=content-transfer-encoding:in-reply-to:organization:autocrypt: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=8EDFdCBwmXqN33aqI7afTbviqKeQA7knJzhc/Ir0Ntk=; b=Eo9zhxaUQQhweVRPeH9z1uTYmavUJvN/a8uM83DsX6cl0/KDkNXRkS6hRAvZibgQZq HIloKO4N/pt8yR4B7vWtd2F8SgTVmsGVj5FRnuGw8SpMVpJ+uKOtV8EWKm7bzaQohLwB 6PUZ03/qwAQMe3yTKvorA6Pq4+ieMB3+G4kD9AmTVYH4/tWy8ssEaCuQ76rzL6Tqv6lf CgKUPM5+EyjuvonHJGr1Suu5yuYuGjiqw61GxmiXxkFrkpj07TPHSjX3INcNM/hQ3h+T nYiZw+s7r9MKFy71hpPU9+bx6l+L3wnDXp9CWuThj15ojEvPbmCtjEW4zdDwPvJBGmgj LiYw== X-Forwarded-Encrypted: i=1; AJvYcCVy/F4txK/yf92tt/HCa13sNWUdNToJTUD1pDRiR57n2Loixips9hnIBgK8y9QmP2BS1A/Q/Rw/WkQ7tKqUgjG8kYZr4JSEuHJbQgI8 X-Gm-Message-State: AOJu0YwnIZ3Am55whvm2BMJMvs9MWn172kB5z3Zdb2Gt65GHriqq97PP Vqyb/CrwZhNKn3XbR6STObW+sk/EWwUWZ38CAf3tMRKX09SdLfV3Yf+GvGBaHR/IOvRpN/u08P2 1FioHnWxrZcl47Vxs6skPEjiyuffmwzgCYz7wlxZjJPHwazOxd+Tg6STeB6j1YQ== X-Received: by 2002:a19:7414:0:b0:513:2999:5ef3 with SMTP id v20-20020a197414000000b0051329995ef3mr5758194lfe.7.1710231748029; Tue, 12 Mar 2024 01:22:28 -0700 (PDT) X-Received: by 2002:a19:7414:0:b0:513:2999:5ef3 with SMTP id v20-20020a197414000000b0051329995ef3mr5758178lfe.7.1710231747619; Tue, 12 Mar 2024 01:22:27 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:4f00:a44a:5ad6:765a:635? (p200300cbc7074f00a44a5ad6765a0635.dip0.t-ipconnect.de. [2003:cb:c707:4f00:a44a:5ad6:765a:635]) by smtp.gmail.com with ESMTPSA id q11-20020adff94b000000b0033e95bf4796sm4880973wrr.27.2024.03.12.01.22.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Mar 2024 01:22:27 -0700 (PDT) Message-ID: Date: Tue, 12 Mar 2024 09:22:25 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm64/mm: adds soft dirty page tracking To: Shivansh Vij Cc: shivanshvij@loopholelabs.io, Catalin Marinas , Will Deacon , Joey Gouly , Ryan Roberts , Mark Rutland , Marc Zyngier , Andrew Morton , Kemeng Shi , "Mike Rapoport (IBM)" , "Matthew Wilcox (Oracle)" , Anshuman Khandual , James Houghton , Rick Edgecombe , Peter Collingbourne , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: Content-Language: en-US From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuC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ag5O3LLNk+3x3q7e0uo06XMaY7UHS341ozXUUI7wC7iKfoUTv03iO9El5f XpNMx/YrIMduZ2+nd9Di7o5+KIwlb2mAB9sTNHdMrXesX8eBL6T9b+MZJk+mZuPxKNVfEQMQ a5SxUEADIPQTPNvBewdeI80yeOCrN+Zzwy/Mrx9EPeu59Y5vSJOx/z6OUImD/GhX7Xvkt3kq Er5KTrJz3++B6SH9pum9PuoE/k+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12.03.24 02:16, Shivansh Vij wrote: Hi, > Checkpoint-Restore in Userspace (CRIU) needs to be able > to track a memory page's changes if we want to enable > pre-dumping, which is important for live migrations. > > The PTE_DIRTY bit (defined in pgtable-prot.h) is already > used to track software dirty pages, and the PTE_WRITE and > PTE_READ bits are used to track hardware dirty pages. > > This patch enables full soft dirty page tracking > (including swap PTE support) for arm64 systems, and is > based very closely on the x86 implementation. > > It is based on an unfinished patch by > Bin Lu (bin.lu@arm.com) from 2017 > (https://patchwork.kernel.org/project/linux-arm-kernel/patch/1512029649-61312-1-git-send-email-bin.lu@arm.com/), > but has been updated for newer 6.x kernels as well as > tested on various 5.x kernels. There has also been more recently: https://lore.kernel.org/lkml/20230703135526.930004-1-npache@redhat.com/#r I recall that we are short on SW PTE bits: " So if you need software dirty, it can only be done with another software PTE bit. The problem is that we are short of such bits (only one left if we move PTE_PROT_NONE to a different location). The userfaultfd people also want such bit. Personally I'd reuse the four PBHA bits but I keep hearing that they may be used with some out of tree patches. " https://lore.kernel.org/lkml/ZLQIaSMI74KpqsQQ@arm.com/ -- Cheers, David / dhildenb