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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B18D5E8FDB8 for ; Tue, 3 Oct 2023 21:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241141AbjJCVJS (ORCPT ); Tue, 3 Oct 2023 17:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232236AbjJCVJQ (ORCPT ); Tue, 3 Oct 2023 17:09:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1C7683 for ; Tue, 3 Oct 2023 14:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696367309; 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=iZqudPdFmsqAX0i25tQhq4N6QuLZbaMC0GnCxXAloB4=; b=c9UaHypHg+Ox5IW82cqS2rl2voJV/9EYq/TddKRyYx07i9kGqdNMdMGKtNqeXPpWHvCoCO ck5F24qJ8AqBYvWhE/jjiv6A3JWF3AxgNICg4A+PLVbrk+PKHL8LOnWGh7d5geDVnEFrsl brdwVepy6GY4fPkedELjAFMFc9kkDgM= 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-208-0XS9oMMGPxWCPfgVOOQV1Q-1; Tue, 03 Oct 2023 17:08:11 -0400 X-MC-Unique: 0XS9oMMGPxWCPfgVOOQV1Q-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4059475c174so11224965e9.0 for ; Tue, 03 Oct 2023 14:08:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696367290; x=1696972090; h=content-transfer-encoding:in-reply-to:organization: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=iZqudPdFmsqAX0i25tQhq4N6QuLZbaMC0GnCxXAloB4=; b=rGY6wkuTbANfN/7WfAkophuarKyLDE/M1uphDQOEZZ+vWX/9AMWf69qYAYfi72N7mb e6xsT2qgx8eDMyFlyBwb5JiuzQztMdh3sOgcAEQwlBm5YXaHFyH+nVAarkGmQPZmWtp5 V0dUDNFn/mImmApqWvgoxTudJDz7mnyA3KPPxzAOzLO7biFGcDIFdDN41efLk6BkOWmf E5+Ou1byZgYU46DoIBC2O+ndMNEFYwgZ7p6ecJMM4ND46LYQnP0AmB2qQ6Vfvr+z2gIF 7d/dF5mASr7Sri0bPIfXfx6qrDciLhHQkPa6uUwHSp1NBrrA4cjAy1XVN9CYozPPXN1I CjlQ== X-Gm-Message-State: AOJu0YynNuwfvYJ6P4jSzjLuVo8aSWiJ0oqIJi1UM5G1moNWPmE7O7s0 TozQtbopXFxRcuhiD3QoLQWGeT0PsbDJMrqZKW9Y/+9fMFrYrWu8AjoBTc4jZ24M+l4km2zDUOH Ds+LLjubI+VVduQ/f1Rs96Y/Q X-Received: by 2002:a7b:c451:0:b0:401:aa8f:7562 with SMTP id l17-20020a7bc451000000b00401aa8f7562mr649093wmi.11.1696367290208; Tue, 03 Oct 2023 14:08:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3Eewd0OYhzLMEft9jgHfzauv7z/0zio9oUhdJ+EuXuDZ6P60kvlN4IwqdpM02c5om1hVGew== X-Received: by 2002:a7b:c451:0:b0:401:aa8f:7562 with SMTP id l17-20020a7bc451000000b00401aa8f7562mr649063wmi.11.1696367289788; Tue, 03 Oct 2023 14:08:09 -0700 (PDT) Received: from ?IPV6:2003:cb:c736:1b00:e1fc:b01b:70f5:1985? (p200300cbc7361b00e1fcb01b70f51985.dip0.t-ipconnect.de. [2003:cb:c736:1b00:e1fc:b01b:70f5:1985]) by smtp.gmail.com with ESMTPSA id z15-20020a1c4c0f000000b003fee6e170f9sm31441wmf.45.2023.10.03.14.08.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Oct 2023 14:08:09 -0700 (PDT) Message-ID: Date: Tue, 3 Oct 2023 23:08:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI Content-Language: en-US To: Peter Xu , Suren Baghdasaryan Cc: Lokesh Gidra , Jann Horn , 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, 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: <85e5390c-660c-ef9e-b415-00ee71bc5cbf@redhat.com> <9434ef94-15e8-889c-0c31-3e875060a2f7@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03.10.23 22:21, Peter Xu wrote: > On Tue, Oct 03, 2023 at 01:04:44PM -0700, Suren Baghdasaryan wrote: >> Ok, I think it makes sense to implement the strict remap logic but in >> a way that we can easily add copy fallback if that's needed in the >> future. So, I'll change UFFDIO_REMAP to UFFDIO_MOVE and will return >> some unique error, like EBUSY when the page is not PAE. If we need to >> add a copy fallback in the future, we will add a >> UFFDIO_MOVE_MODE_ALLOW_COPY flag and will implement the copy >> mechanism. Does that sound good? > > For the clear failing approach, sounds all good here. > > For the name, no strong opinion, but is there any strong one over MOVE? See my reply regarding MOVE (+zero-copy optimization) vs. REMAP. Just my thoughts. REMAP reminds me of mremap, which would never perform any copies, because it can just do more expensive page remappings (modifying VMAs etc.). > MOVE is a fine name, however considering UFFDIO_REMAP's long history.. I > tend to prefer keeping it called as REMAP - it still sounds sane, and > anyone who knows REMAP will know this is exactly that. Sorry I have to ask: has this ever been discussed on the list? I don't see any pointers. If not, then probably the number of people that know about the history can be counted with my two hands and that shouldn't be the basis for making decisions. But again, remap vs. move is for me a semantical difference; and as I am not a native speaker others might disagree and I might be just wrong. -- Cheers, David / dhildenb