Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1420702rda; Mon, 23 Oct 2023 12:01:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLvV0O9AmN70d7P13/N1T0CXG/39ow4zL+0ZS7WW/JkQqGAFTXQG3i+9r2/PldbSNoXGtS X-Received: by 2002:a17:902:d506:b0:1c2:1068:1f4f with SMTP id b6-20020a170902d50600b001c210681f4fmr10126397plg.17.1698087719217; Mon, 23 Oct 2023 12:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698087719; cv=none; d=google.com; s=arc-20160816; b=OGoBBL9MX69UWDcBDDS7H0+iQRgZT7H3I1PRCRvK/s28J7CcuVKJN4EDoQzOBmvpf5 YwLTcEl9DG1GvlSufjsQV5CFCY41cKdNT07IsShR2BgEo8VLba6NgqDIT4HyOGQg8E2E 1ALr399ulAch1TJEFKTn5bbZX7BpMHVqSnsZOwh9arBfDJnzEBFX21mK0iNrQdBsBFUA Yl5WrHoyz77vHhWCUjK0Ee6RkbNoT88FiUq2ESunfZoGM9lU3jIDc2G9VkurBWMYzLyg ErfUS6Nu4FZvSw49ivmF6yBtl5EgxDIR5cgAi2t1EV6qiXynaQuMdda2JhXzX0hna+Fo cX5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Zqg2MrbwUBHop12bezxykXk1XkJASgD3Vjm9dX2RSP8=; fh=4OSpxeiBwsuIzSsgUf+PjxsJgx9x8GY3HkIgnmcCqx8=; b=BFP/qS0g4teouNurzZzqQJeNkSjX/+xcpvqE1TORjOMESpnQPp0UkPdyu69KBe/t+7 oh0/8/iXtDamtgzdrdjXYUxr3f3UNdTAfr+1DU6HbdX93b82zVHAkmFLlUc0owtoxRAn iXcrqpbGAsqDGZ3xy31iOtYNl3AbcDJYJaJZbFvQPT4ckCkkRTOJxCoV8f7IK5ybdvn0 g88dKDtfwDf850FXfv8F6Hdv8j4oR8uyEekKp7BHo7cIxr3q29zfKODEjy/Ku8aMs/t0 bULtLQX4NBUYHj2Sod/MF/2l3zMYRc8PUUBZ62S+MmWaKwo7op7mmkzfJVU67r2bfOVk GgwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nhRwBvf5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id b21-20020a170902d89500b001c1fe58a1e8si6908342plz.576.2023.10.23.12.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:01:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=nhRwBvf5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id EC2068080ED4; Mon, 23 Oct 2023 12:01:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230386AbjJWTBu (ORCPT + 99 others); Mon, 23 Oct 2023 15:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbjJWTBr (ORCPT ); Mon, 23 Oct 2023 15:01:47 -0400 Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C827100 for ; Mon, 23 Oct 2023 12:01:45 -0700 (PDT) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-5a7af45084eso35111717b3.0 for ; Mon, 23 Oct 2023 12:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698087704; x=1698692504; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Zqg2MrbwUBHop12bezxykXk1XkJASgD3Vjm9dX2RSP8=; b=nhRwBvf5B5dVVjrNs1IllqUTDPbpqQ2HLwbaDjehM4okzVtkSNbXs6CB3yjfNNnKyU T+VSaeTDQT1IigKk+2mPUvmzayOLYNoJsY5H4AwfanRQf85egQ3zUxgHcRVt+mrRRIuA 2NceyG2QR+0kXSE0PgTuISBHzETzhFxFzgxc3nbA+6+XZ1R63ryySr8lnuHiXFqrxRLz KLp008cIeW+e53wHbLk2MY5rLtMjGrFIBuI4+4Pk3QO/BEuhK6M+aHnDkPKUVGCcvvY7 F7bNHVg4FIo7B/f3xfHnF0Y3ipbrsumona9sJGhIgedO/pP98VLCd0pHIkkTnIZn1oIJ UnfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698087704; x=1698692504; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zqg2MrbwUBHop12bezxykXk1XkJASgD3Vjm9dX2RSP8=; b=J8YUQg6vrrDQ9RREcVSY7wsBLJZrcGMyVqQRfgSLX8yyhkDJ2nOiIP92H/NSvgv4mX A4BcliQXMKGrgN7wsueAYknc7jqZjD2TfhknT7cNVSq/yl2avwFk8vLMflUFdLDPtp71 WNMjTo5RAW1ang2CqhFNgvsN/uQIyJmtSBfXVLOQiaIurRkoHlXxhUGvGZX5icc+gdho ZsiOqT39CpG6VhPoSH5gJegrfjkFAJI1vUM83AjiFd3s1+ZvAZlD38WBzWc3Kiw4FCtx /px0pRzAhaa4X2YdODDCb5iKSlRf4lGD/le9ejvmvF+4fIe65X3nHBIlz/U6ciJK+4pl RBdw== X-Gm-Message-State: AOJu0YwrkEnbubeMzloqgfLOnQFvwVbvCfRolwzQRsKoT0mrjlWkmmE7 5gIaJcowjvCjbuu2j4jR9UyPAz2gBiSQ4aCP5vCOeQ== X-Received: by 2002:a81:65c2:0:b0:583:3c54:6d89 with SMTP id z185-20020a8165c2000000b005833c546d89mr8889708ywb.44.1698087703993; Mon, 23 Oct 2023 12:01:43 -0700 (PDT) MIME-Version: 1.0 References: <20231009064230.2952396-1-surenb@google.com> <20231009064230.2952396-3-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Mon, 23 Oct 2023 12:01:32 -0700 Message-ID: Subject: Re: [PATCH v3 2/3] userfaultfd: UFFDIO_MOVE uABI To: Peter Xu Cc: akpm@linux-foundation.org, viro@zeniv.linux.org.uk, brauner@kernel.org, shuah@kernel.org, aarcange@redhat.com, lokeshgidra@google.com, david@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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 23 Oct 2023 12:01:57 -0700 (PDT) On Mon, Oct 23, 2023 at 11:37=E2=80=AFAM Peter Xu wrote= : > > On Mon, Oct 23, 2023 at 10:43:49AM -0700, Suren Baghdasaryan wrote: > > > Maybe we should follow what it does with mremap()? Then your current= code > > > is fine. Maybe that's the better start. > > > > I think that was the original intention, basically treating remapping > > as a write operation. Maybe I should add a comment here to make it > > more clear? > > Please avoid mention "emulate as a write" - this is not a write, e.g., we > move a swap entry over without faulting in the page. We also keep the pa= ge > states, e.g. on hotness. A write will change all of that. Understood. > > Now rethinking with the recently merged WP_ASYNC: we ignore uffd-wp, whic= h > means dirty from uffd-wp async tracking POV, that matches with soft-dirty > always set. Looks all good. > > Perhaps something like "Follow mremap() behavior; ignore uffd-wp for now" > should work? Sounds good. Will add in the next version. Thanks! > > -- > Peter Xu >