Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7811625rwd; Tue, 6 Jun 2023 17:12:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7YlOviayhEZfITHwdLvYIZC4amdEt4lNBFUAY9JyhorqWeHJgC5AK6zHZQ7wJNxLXp9Z9h X-Received: by 2002:a17:902:d487:b0:1af:d812:d27 with SMTP id c7-20020a170902d48700b001afd8120d27mr4600117plg.9.1686096768143; Tue, 06 Jun 2023 17:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686096768; cv=none; d=google.com; s=arc-20160816; b=qpDpbN5dByzHrobNidJtFg0qCiAqCRP4pjMOGl/crWxbWX2cOnjGmS3+QAll6M5Ywx ZTxPRZw/9u+PHFemPTT6bme+h5XtTq2zUxz+dhyvVpl/nXtWMXjH8m1GgBhEDZ64Utv0 VQzgJgx4jj8VS7g0f6ZhDLKX3Vaee2Q9873iFFcV7P/GpzPXud7S5aK7Qyc09ViN/m2W 6Y0GBc8WEdlLwKRnSdZzUxRdKMzQPuvUveyNq6BRCuaEADn+D7teRiNnd7qbDiOoq83e fhTN85PgdfZyeEFx/d/UCOg1c6fWUzpY+sTFVol8oTj2bxv9HQV8pqu9lMSrO8wV1cwp 4ANQ== 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=9wMQpL8mT6QlCCs1bXrVw+rZK5wYXsmA2UlxqlGl7R0=; b=VyB5yTpfha+zXEcD8+4EEdd4JFMZ7D/w+HDyIopESMN1vXl/QaMEuGkmVtZJ9wrNJS +PpDDMWKmWfgh24KyVF+H76JuUWj5oUh3u5/Qag7eI39VbG9FcGQApuvqO9LnclVtyOF X5K+2pX4RjOZYdKJugfQ2InShqinQ2CMukPjIPJJdosehwCrXHes91oTam10v1+q7vGz ERnwKjQhY2mp+PYNTK1JZK8ek6lsJWmd0XC+CXYJYiCsGMvpYPL5DxPy4gqvU+DP7JS8 HXytaC9g7tqLYs5fcBYJGrkfGAYlZW8vwNqFNEgRGXbNLdr9cI8NuzcG6fHKRlB7ZK32 1rgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=KLfXcWyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j1-20020a63cf01000000b0053087bce16esi7806280pgg.830.2023.06.06.17.12.35; Tue, 06 Jun 2023 17:12:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=KLfXcWyr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234424AbjFFXUK (ORCPT + 99 others); Tue, 6 Jun 2023 19:20:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240321AbjFFXT1 (ORCPT ); Tue, 6 Jun 2023 19:19:27 -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 7EF982102 for ; Tue, 6 Jun 2023 16:18:51 -0700 (PDT) Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-565ba2c7554so66762377b3.3 for ; Tue, 06 Jun 2023 16:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686093530; x=1688685530; 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=9wMQpL8mT6QlCCs1bXrVw+rZK5wYXsmA2UlxqlGl7R0=; b=KLfXcWyrdR+obKSMHxp4g6iQaKYQlgTEDHnSvEqd1pr5TquZGqzxtQH7J0TtNrk9t9 wSC1wIZPg1Y7kJBFH4wCkk9fmF7+dRl1AhQA8+s1UdIRvrXCNBFeFfckgm6QE4lMZlE8 7xNxP+/xT9Hodt7l6CLuplh42dj7XGAVN8qoGAIItLVvIYl74Jluk/rJcWCGzFOFH7Qe 8cayTUAf71/QVjLKPsLixZFvLBnERD2oXEEAhfHTSKgOqENgOdwRbKjgDfgTex6odnGp KPnHV5HqHjwMLZniSQpKrASM337DwMbF4olR9iDRllw+6epc1QMpo8+70hdqIY8c9Kcy 4R+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686093530; x=1688685530; 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=9wMQpL8mT6QlCCs1bXrVw+rZK5wYXsmA2UlxqlGl7R0=; b=haOI8TPtprpMBfOa43M8MEmplEdq6n/fq72DNVrmCeDT1eM64zQde91i5JqHz+c+Ra Bl+IxiLZbR+3mhrJXxTRXM7pya4fttDNqgiPx/dbOpcFg57pOHzwl8yWPfeiBRi2/aih xpBEbOzC1HGGmWS/0Y8XHl1ZpXto1YIEgNkCVaMASM03u05Ml3/Sax4qkzPiI5UDeJZN rK4ViKX2YXM7bNsVducCafYOszbMB5P/sITSOx8xAYyB58YRt9k2S5s9K41mzQxFftNc /CsNEXARjrDrRuU3qpinckeA+yxmAugMNy2beaqLg3mqvjxe0fOihgbnvCLqTrkU9o06 tSzg== X-Gm-Message-State: AC+VfDz3kqhzETIZ5luX1q6dqk96xC/EtRBVHE0g8hSsI1+DmDjyYUWR SNwlQCknqPG5ph057/gAlD33phORT9Pt0dA8X8f2lw== X-Received: by 2002:a25:ad66:0:b0:b99:53e9:ba97 with SMTP id l38-20020a25ad66000000b00b9953e9ba97mr3440908ybe.43.1686093530541; Tue, 06 Jun 2023 16:18:50 -0700 (PDT) MIME-Version: 1.0 References: <27ac2f51-e2bf-7645-7a76-0684248a5902@redhat.com> <3059388f-1604-c326-c66f-c2e0f9bb6cbf@redhat.com> <6403a950-7367-0b00-8cd5-2f0a32dac953@suse.cz> In-Reply-To: <6403a950-7367-0b00-8cd5-2f0a32dac953@suse.cz> From: Suren Baghdasaryan Date: Tue, 6 Jun 2023 16:18:39 -0700 Message-ID: Subject: Re: RFC for new feature to move pages from one vma to another without split To: Vlastimil Babka Cc: Peter Xu , David Hildenbrand , Lokesh Gidra , Axel Rasmussen , Andrew Morton , "open list:MEMORY MANAGEMENT" , linux-kernel , Andrea Arcangeli , "Kirill A . Shutemov" , "Kirill A. Shutemov" , Brian Geffon , Kalesh Singh , Nicolas Geoffray , Jared Duke , android-mm , Blake Caldwell , Mike Rapoport Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 6, 2023 at 1:15=E2=80=AFPM Vlastimil Babka wro= te: > > On 4/13/23 17:36, Peter Xu wrote: > > On Thu, Apr 13, 2023 at 10:10:44AM +0200, David Hildenbrand wrote: > >> So instead, we consider the whole address space as a virtual, anon fil= e, > >> starting at offset 0. The pgoff of a VMA is then simply the offset in = that > >> virtual file (easily computed from the start of the VMA), and VMA merg= ing is > >> just the same as for an ordinary file. > > > > Interesting point, thanks! > > FYI, I've advised a master thesis exploring how to update page->index dur= ing > mremap() to keep things mergeable: > > https://dspace.cuni.cz/bitstream/handle/20.500.11956/176288/120426800.pdf > > I think the last RFC posting was: > https://lore.kernel.org/all/20220516125405.1675-1-matenajakub@gmail.com/ > > It was really tricky for the general case. Maybe it would be more feasibl= e > for the limited case Lokesh describes, if we could be sure the pages that > are moved aren't mapped anywhere else. Lokesh asked me to pick up this work and prepare patches for upstreaming. I'll start working on them after I finish with per-vma lock support for swap and userfaultd (targeting later this week). Thanks for all the input folks!