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 7D1A9CDB482 for ; Thu, 19 Oct 2023 15:41:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 019448009D; Thu, 19 Oct 2023 11:41:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE5B48000B; Thu, 19 Oct 2023 11:41:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D391E8009D; Thu, 19 Oct 2023 11:41:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BEA9C8000B for ; Thu, 19 Oct 2023 11:41:11 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 80F0A4055D for ; Thu, 19 Oct 2023 15:41:11 +0000 (UTC) X-FDA: 81362624742.18.A67B03A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id A9137100034 for ; Thu, 19 Oct 2023 15:41:07 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZG6lyz0j; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf14.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697730067; 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=JJr/PRGCFlMD3E/uH7FWSeqfLKgpGGhQWrbZ5EJs+i0=; b=Ia18GvWdIyoIg9l/9x6LS/UlhZgFCa3jNYm4g3vKCD/Iwu2hBKcCNiKw71ALFJLYI14gWO IHhCn+CW5LySF1ndf2MF69YlPwRAoDFPlNSYJWIIZi8JfWmkR9mWHassspJtZDnxkgAHly bjH+O2VpjrFh/yw+Q5SXzLECjoTgO4c= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZG6lyz0j; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf14.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697730067; a=rsa-sha256; cv=none; b=jjCp/J/3QQ7NU00d80pTKIKoGvBAI3PN9F/7QNOq9ayWM5ekbOZvAhEUrOsIrCUEMRpUuQ +ScW27+Rzi6SUmiIQoW+R/1O9PduUq8iltCU4qaKPJV35mAcPfjGOn3lE//4BbIfk8lGGs xfmML+hcdE0w6CdoNUjGH5Xxlef7sEQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697730066; 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=JJr/PRGCFlMD3E/uH7FWSeqfLKgpGGhQWrbZ5EJs+i0=; b=ZG6lyz0jlR/gXhohR3V4zbMBBvXgNSGKBjlImPdS0jgYGLuTav0Yt4WwMSnQ1NAg5sak5f 3v+8u0AImWH3AKm3EzGEavRsZ/y7n6PHf+EMoP6IdrJ2729M2eb73JhmY0+AqhZ4Xz5gcS Xi4aAbs39ZOeUZEoLovPv3ECMLCEiGo= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-144-2qF-ruJcOGO2APH9iv-XPg-1; Thu, 19 Oct 2023 11:41:05 -0400 X-MC-Unique: 2qF-ruJcOGO2APH9iv-XPg-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4077e9112b4so31201105e9.2 for ; Thu, 19 Oct 2023 08:41:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697730064; x=1698334864; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JJr/PRGCFlMD3E/uH7FWSeqfLKgpGGhQWrbZ5EJs+i0=; b=FlCJCp7mFgmwNaqw3h3CSMMhIX3Sxg2vbMMo1RcqmQnj/uWtyiI2bNNns7R/LE2Cfn wCL/wQdfBHRhZX5FNYjmEbnqI4/KD57iYufldOVKrxa62BkCea+q+Hg5KxCrdHSsj6yU wJYYyTt3ChWTaO1iuSoh6aHnspqBJP+bH/dRbKTAFFb+LzBEGOwWY2jp/rVSBFvb1IEW VsV4sPyY0B/qjVCl2AG7q3HY4ad+HPJAYgUl3WzEgwqPUrjxK/SKC8ylGrNe5gJnevX0 x4YtHLGyonR1n+7Xbf2d82y31AzmJOj2keML54eKD5qPvL4eThv8hyPGowKCFTDj7FGY +Iug== X-Gm-Message-State: AOJu0YxHc/7C5xEi3fz8GiQq03QC0jimxxy8FiKWW2fjf3utJ/XxHWHs Ev13Ql7BteSnnJCnT2ZQEt4nwM2Q1E/fAbKE4HI1ldX7AgG0z/p6W9f09OwEG9dJExhAxqoQJu8 wXn3yRfSffjo= X-Received: by 2002:a05:600c:4592:b0:408:2686:e1cb with SMTP id r18-20020a05600c459200b004082686e1cbmr1998643wmo.23.1697730063996; Thu, 19 Oct 2023 08:41:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHKkD2UN+e0cvlgFYNJSwe9iV/QR1vJcmNnxULpah0wDYZWON0YAd8NW45+8h/OjODMZZOPg== X-Received: by 2002:a05:600c:4592:b0:408:2686:e1cb with SMTP id r18-20020a05600c459200b004082686e1cbmr1998620wmo.23.1697730063400; Thu, 19 Oct 2023 08:41:03 -0700 (PDT) Received: from ?IPV6:2003:cb:c70b:500:6a06:17fc:810b:b054? (p200300cbc70b05006a0617fc810bb054.dip0.t-ipconnect.de. [2003:cb:c70b:500:6a06:17fc:810b:b054]) by smtp.gmail.com with ESMTPSA id x9-20020a05600c420900b004065e235417sm4630990wmh.21.2023.10.19.08.41.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Oct 2023 08:41:02 -0700 (PDT) Message-ID: Date: Thu, 19 Oct 2023 17:41:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/3] userfaultfd: UFFDIO_MOVE uABI To: Peter Xu Cc: Lokesh Gidra , Suren Baghdasaryan , akpm@linux-foundation.org, viro@zeniv.linux.org.uk, brauner@kernel.org, shuah@kernel.org, aarcange@redhat.com, hughd@google.com, mhocko@suse.com, axelrasmussen@google.com, rppt@kernel.org, willy@infradead.org, Liam.Howlett@oracle.com, jannh@google.com, zhangpeng362@huawei.com, bgeffon@google.com, kaleshsingh@google.com, ngeoffray@google.com, jdduke@google.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com References: <214b78ed-3842-5ba1-fa9c-9fa719fca129@redhat.com> <478697aa-f55c-375a-6888-3abb343c6d9d@redhat.com> <205abf01-9699-ff1c-3e4e-621913ada64e@redhat.com> <12588295-2616-eb11-43d2-96a3c62bd181@redhat.com> <8d187891-f131-4912-82d8-13112125b210@redhat.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WmavOT9sttGQXdPCC5ynI+1ymZC1ORZKANLnRAb0NH/UCzcsstw2TAkFnMEbo9Zu9w7Kv AxBQXWeXhJI9XQssfrf4Gusdqx8nPEpfOqCtbbwJMATbHyqLt7/oz/5deGuwxgb65pWIzufa N7eop7uh+6bezi+rugUI+w6DABEBAAHCwXwEGAEIACYCGwwWIQQb2cqtc1xMOkYN/MpN3hD3 AP+DWgUCXw7HsgUJEqkpoQAKCRBN3hD3AP+DWrrpD/4qS3dyVRxDcDHIlmguXjC1Q5tZTwNB boaBTPHSy/Nksu0eY7x6HfQJ3xajVH32Ms6t1trDQmPx2iP5+7iDsb7OKAb5eOS8h+BEBDeq 3ecsQDv0fFJOA9ag5O3LLNk+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: 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 X-Rspamd-Queue-Id: A9137100034 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: d5god61qqoqxoiuuux4q9efa9p3ayq3n X-HE-Tag: 1697730067-338709 X-HE-Meta: U2FsdGVkX18WnW1vSJSQWouYEc1WG0t9scwF9Y0gmhaEHYvRcEBnp9ybZEcA6S5BRfUeTrnfF06L7bUkK/MrU/ZG5f+tWlkZLklLYkpcp6CniROtSBUolrPpu8P2a1dhHlyQHNBiRj181ME0+PjEUAAk7ebrlLQFfI677AuqNxnyCH9hs8NHYMN57kn/MdJ4Dy5B2sA/EzgDiKTdJU3SbhjENyCuWBgnhi4wc9kkKVeQJzRQy7jcmeKo59XRXOD3Z3zrTWcs3ZKAjRp4ELdjkLPVujp3SnQinA4O6OpVAChruwvO73IT6OeGsiSx5JGN772CF03o54F04zeE5duAKGR1E08u8HUt0CNaZGhZTrDrzoOFtcBWy/VHyQbGj21bcQKtBaFRe8qZ9sAEHKDP5VVQkmE6bqDRYXSeQ2CeujN3inVfaCNrdaf9EppRRiIuszG2ryOxZeVUX71+TR9qHNYydubTotHmf20j+jB+3q2W0O04QSW0Xq18M42peGnag2AqCIAEmilEMt3fSHeW1t1iW6eHotOEwQLm8r9Y4ZuyUhXXUN4JK6O4Pjs0EuVZjd9IFHBwAzPkCLMuc+57Wt5dS55M/KWBvox/kyL+rSBW/TFn/86puUwI+FUzsqfJRSMoC+tm4Rv4k97HFCGxpQ2RzdmGiVLRldWdg1EijCG+B40w2e6o09i1JXGtwMQYDfMQ4i7hBz9m2pagCnMYv81vhnQV4hlo94YcND0rXLm7EXgROQ+nfKpZVRCOGJYYcSs0kljH9L92pQwDNjm960ueMdhnmDrCFOfXKtkSPFIf3h3bSwy1F/v3lHfOdF+8inG7o8+yICT4q0ZW6xWu1wSDQHTm6PCdDikgUPgjyN46bcnZQHlH3ipztlyUOD6sEdmM9Gzku+PdpINIvd/2vppLpSVwT4Pk+4LwaNOih/i5BJ65lL+kQApaIPT6EjtoYSqKnjY0TDCxE1PYODH mFS1NDWY FbKd+/kbFFRu9I0jnnRRuN6+fsdQbbnyLtUlZsc6DH2V9SSX7KStyu8gF6OH6tGeMT2mlXHjSN/VaKkWrFIjjKK16RLnkhk3a05fyCzaxH9QYAt52U9KgHHY/MPmLhsk8CUC+q9bp9OofBoeida0HqcCKGB1svFCAeC7DBbd/T7Elnr9PhSmqPIcCGGWCkHfjqmI1/Z1CYY1ly1i8PtgFCf309npDk5IeCTAi1IPobCbAbKoiJd0G+Q5uUKBGs9zEQdqN5/KgEVa0LI5G11ri0mX4BJy/RpKJnT+Eqa9QhknQ7NMyzXMfh9qFriIas8hWd6Rgoji9/6j6wk+u5liL+jb4vPGjCxRJbMv53OBimZSYH+/NE9utbBpP8EqrqUXJbfgJgizdviKXiCaUEOKJF+JouIiYYbJGg2LRAj3Zs6I/5QI8XSSpIDcW16hqNAA/aAmL//roqzpahHl3EQdmoi3H14nV7+4VgXcBQBcrjVkpWw41OFys0jbb7RiSYLISWPejtrfsVycnSwicrU4MI+EMZ4AZ4gzfpfoeoVTw47UQvwU= 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 17.10.23 20:59, Peter Xu wrote: > David, > > On Tue, Oct 17, 2023 at 05:55:10PM +0200, David Hildenbrand wrote: >> Don't get me wrong, but this feature is already complicated enough that we >> should really think twice if we want to make this even more complicated and >> harder to maintain -- because once it's in we all know it's hard to remove >> and we can easily end up with a maintenance nightmare without sufficiently >> good use cases. > > Yes I agree it's non-trivial. My point is adding cross-mm doesn't make it > even more complicated.. afaics. That's not my main point. It can easily become a maintenance burden without any real use cases yet that we are willing to support. > > For example, could you provide a list of things that will be different to > support single mm or cross mm? I see two things that can be different, but > I'd rather have all of them even if single-mm.. > > - cgroup: I assume single-mm may avoid uncharge and charge again, but I > prefer it be there even if we only allow single-mm. For example, I'm > not 100% sure whether memcg won't start to behave differently according > to vma attribute in the future. > > - page pinning: I assume for single-mm we can avoid checking page pinning > based on the fact that MMF_HAS_PINNED is per-mm, but I also prefer we > fail explicitly on pinned pages over UFFDIO_MOVE because it doesn't > sound correct, and avoid future changes on top of pinning solution that > can change the assumption that "move a pin page within mm" is ok. > > Is there anything else that will be different? Did I miss something > important? Again, that's not my main point. All I'm asking for is to separate it out, make it a separate flag, and include it once we have reasonable use cases that we are actually willing to support -- including actual data why it's beneficial to have. For the single-mm use it has been shown that there are reasonable, existing use cases exist, and I think we are willing to support that. This patch set is close to doubling (!) the size of mm/userfaultfd.c, and it already has every possible smell of maintanance nightmare IMHO. It does things that shouldn't be specific to some MM subsystem. I'm happy to see any possible complexity reduced. Moving pages between MMs is added complexity. But I will stop arguing further; I hope I made my point clear and I have other things to work on than fighting against overly-complicated uffd features. > > [...] > >> BTW, wasn't there a way to do VM live-upgrade using fork() and replacing the >> binary? I recall that there was at some time either an implementation in >> QEMU or a proposal for an implementation; but I don't know how VM memory was >> provided. It's certainly harder to move VM memory using fork(). > > Maybe you meant the cpr project. I didn't actually follow that much > previously (and will need to follow more after I took the migration > duties.. when there's a new post), but IIUC at least the latest version > needs to go with file memory only, not anonymous: > > https://lore.kernel.org/all/1658851843-236870-1-git-send-email-steven.sistare@oracle.com/ > > Guest RAM must be non-volatile across reboot, which can be achieved by > backing it with a dax device, or /dev/shm PKRAM as proposed in... > > Guest RAM must be backed by a memory backend with share=on, but > cannot be memory-backend-ram. The memory is re-mmap'd in the > updated process, so guest ram is efficiently preserved in place > > My understanding is there used to have solution for anonymous but that > needs extra kernel changes (MADV_DOEXEC). Probably, I also stumbled over a paper from 2019 that mentioned that that. > > https://lore.kernel.org/linux-mm/1595869887-23307-1-git-send-email-anthony.yznaga@oracle.com/ > > I saw that you were part of the discussion, so maybe you will remember some > more clue of that part. > Ouch, 2020. But my comments were only regarding mshare, not MADV_DOEXEC. In fact, I don't even know why both discussions/threads show up as a single one there.. > IIUC one core requirement of the whole approach is also that it will cover > VFIO and maintenance of device DMA mappings, in which case it'll be > different with any approach to leverage UFFDIO_MOVE because VFIO will not > be allowed here; again I hope we start with forbid pinning. But it should > be much cleaner on the design when with UFFDIO_MOVE, just not working with > VFIO. > > One thing I'd need to measure is latency of UFFDIO_MOVE on page fault > resolutions. I expect no more than tens of microseconds or even less. > Should be drastically smaller than remote postcopy anyway. > > I'm probably off topic.. To go back: let's try to figure out what is > special with cross-mm support. It'll be very weird in the future for > anyone to propose a patch just add a feature flag and declaring cross-mm > support, if the code is mostly all there. Nothing stops us from discussing > what a cross-mm design will need. Again, I hope I made my point clear. > > [...] > >> Is that and will that remain the case? I know people have been working on >> transparent user-space swapping using monitor processes using uffd. I >> thought there would have been ways to achieve that without any corporation >> of the dst. > > Any example? Nothing concrete, I only heard about uffd monitors that implement user-space based swapping. I don't recall if they require some kind of support from a library that gets loaded into these processes, Same thoughts regarding CRIU using uffd. > > For what I am aware, all corporation requires uffd desc forwarding. I > think the trick here is any userfaultfd desc must be created by its own > process, so far nobody else. That's more or less saying "I want to do > this" from its own opinion. The next is forwarding that to someone else. > Parent process is fine taking uffd of child with EVENT_FORK, as I > mentioned, but besides that nothing else I can think of that can violate > this guard to manipulate a random process. Do you have any idea how CRIU makes that work (at least I recall that they wanted to use UFFD). -- Cheers, David / dhildenb