Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7639577rwd; Tue, 6 Jun 2023 14:02:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zlcIoWNo2Xho9Cx2GTwQZxwpwTKBDc44WNgvBjm53YuCSY1sPar+8b90Nd4QDifC0sLS/ X-Received: by 2002:a05:6358:beaf:b0:129:c6d6:ce40 with SMTP id di47-20020a056358beaf00b00129c6d6ce40mr936926rwb.15.1686085325551; Tue, 06 Jun 2023 14:02:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686085325; cv=none; d=google.com; s=arc-20160816; b=dO1/3a4RW97VXce86NUM86EYp6bLGTH3lfC7wbG3mK+g0Iwv/S2y4VMMjfA5jfY2cN wtYkE7FNQzKEe0uuaaaRa1KRtJWdnKOxv2ZLxQNRxxGh3I/3VQpdpVBIFNlK4d5fwHda 0olgIwR7mMC18/ExS/yhDyUtTHfUVa0PeddSkSox/zDmkuP3r4x0t8o/n6kU/VAXi8+m uirw16uenn/tfqPV+qrtElG8tJgZOXch9TbzOjb7prRztgUyn4fT2EgzSblg3/Nr+h96 zcfbYHLgRspdutV0lr26VCR0Bpkwvb37SZanmPDopT9wJ7XzWO0csYJUkREsRzHf6K0r fGjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=GRdaNaKr0mVo9Z+XRAEpnMDkFT3nh/DoMeZkPYisvDM=; b=nt5h0RuStmh+zmedqUeQNE2zaxhOL88rYquP9jAiGOi/UTDKN2Sw5mylfK3uCd1ZBM XfsZQSkbOaW+YwJL8Hujlr9rJJnYJCLw73qn8ZzUu+TkY2/Qt/hZ9C6qLaPUW9jO91GM FXqY9WqnlXsr8rrjfobhIV5F7zPnPRO0Y8PtHymcqbT/ouC14Up4j703rAqd9bfpVJhs Jf2oJRi/QDiZmgfTCf4iLZHafpSYZZyoj1D4OWaf8w/qPZxjlANvYS4+1cW6RSGjIRq2 D8k98UcOBjkzSdIr/+DG+9SJS3JjD8OiTQMbWVJKBB6Dj3n0MHlqOAGJE8wgFQiP+Zkg 8aBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="ioC/quvR"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=di+1KcQG; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bs5-20020a632805000000b0053eee173733si7795456pgb.227.2023.06.06.14.01.50; Tue, 06 Jun 2023 14:02:05 -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=@suse.cz header.s=susede2_rsa header.b="ioC/quvR"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=di+1KcQG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237506AbjFFUPo (ORCPT + 99 others); Tue, 6 Jun 2023 16:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234226AbjFFUPm (ORCPT ); Tue, 6 Jun 2023 16:15:42 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E6099E for ; Tue, 6 Jun 2023 13:15:40 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 303A71FD8C; Tue, 6 Jun 2023 20:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1686082539; h=from:from:reply-to: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=GRdaNaKr0mVo9Z+XRAEpnMDkFT3nh/DoMeZkPYisvDM=; b=ioC/quvRSy7NIVr6dNWhuWtynvA0QHib3x3S1200yPrmXu2hDy+rvxNYTFGDhG7eKVL3vP bTDfDeW4uGxoFQVUVijBy/FNL/9x29uPcy7FJHUXN45DEF8OyNwrbO7+KSiMmmv4moTaZ8 Iv6s8+xTPSPSSRjcvDa3HluXs9GpxIs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1686082539; h=from:from:reply-to: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=GRdaNaKr0mVo9Z+XRAEpnMDkFT3nh/DoMeZkPYisvDM=; b=di+1KcQGyUMmvlbPmv74BZ6926czHaKCgvmzYYBCsAS/yPE5NoWqPz1hcrz7+wV9ZUpM1G aXnFibq0THq8DYAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EEB1E13776; Tue, 6 Jun 2023 20:15:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id q0y8OeqTf2RPJwAAMHmgww (envelope-from ); Tue, 06 Jun 2023 20:15:38 +0000 Message-ID: <6403a950-7367-0b00-8cd5-2f0a32dac953@suse.cz> Date: Tue, 6 Jun 2023 22:15:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: RFC for new feature to move pages from one vma to another without split To: Peter Xu , David Hildenbrand Cc: Lokesh Gidra , Axel Rasmussen , Andrew Morton , "open list:MEMORY MANAGEMENT" , linux-kernel , Andrea Arcangeli , "Kirill A . Shutemov" , "Kirill A. Shutemov" , Brian Geffon , Suren Baghdasaryan , Kalesh Singh , Nicolas Geoffray , Jared Duke , android-mm , Blake Caldwell , Mike Rapoport References: <27ac2f51-e2bf-7645-7a76-0684248a5902@redhat.com> <3059388f-1604-c326-c66f-c2e0f9bb6cbf@redhat.com> Content-Language: en-US From: Vlastimil Babka In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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 file, >> 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 merging 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 during 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 feasible for the limited case Lokesh describes, if we could be sure the pages that are moved aren't mapped anywhere else.