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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1408C636C9 for ; Wed, 21 Jul 2021 16:19:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 83ABA6120E for ; Wed, 21 Jul 2021 16:19:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83ABA6120E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F33D66B0081; Wed, 21 Jul 2021 12:19:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE4606B0088; Wed, 21 Jul 2021 12:19:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAAE86B0089; Wed, 21 Jul 2021 12:19:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id BDCBB6B0081 for ; Wed, 21 Jul 2021 12:19:50 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 682ED8248047 for ; Wed, 21 Jul 2021 16:19:50 +0000 (UTC) X-FDA: 78387106140.13.261DE29 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf25.hostedemail.com (Postfix) with ESMTP id EE63FB00DE79 for ; Wed, 21 Jul 2021 16:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626884389; 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=7y5PxxinjSuGtzbBWLAF5HzlJtIegTZwJLIEdYSHihE=; b=EH68B6PVG/XFu8HOM416ijazXMwtOC71LFcvhJpoU2MzVqYXZTuXIOCm2pXnllgWfVc+W+ uq+IWQttgSJsJfO5MCIENy3bL/Cl5uXQWBT7YdHoPREZ6voQhU3/V3tZFlLa/jKIImItnE C+IqBHoAl9hoTc/VpKJIZ2FRfjtpPPw= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-561-qbdf3zDAOTGaCjtGh646cQ-1; Wed, 21 Jul 2021 12:19:45 -0400 X-MC-Unique: qbdf3zDAOTGaCjtGh646cQ-1 Received: by mail-wm1-f71.google.com with SMTP id j42-20020a05600c1c2ab0290238db573ab7so1218587wms.5 for ; Wed, 21 Jul 2021 09:19:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=7y5PxxinjSuGtzbBWLAF5HzlJtIegTZwJLIEdYSHihE=; b=jDGrzGLUI+IiMe4WxcQLFjx8LdjzOc9hcnH4O4HQTAhIoklPq2pcB+djM7VbHnF2BE 2cMq6GEkdZq0FD76P/dDmH6xJ3BHiODenUE4sjRdT4w8PvusuBDEhBnN3n3QyMfKDWu3 lp9NHCmz8kQIi+O2+o/LybCpX6RhajgdW0242CDtI6Uh38a+sYjGb8qvTPTprASBAva9 vzk1A6JDcGlqFSTdM2s3qhg3bvBzVSRP4o+7jXAEyNejB1eF653KLNI939nvy0286aPv ECS3MWZTTfBdoWtwGpWJ+xRDSO43HuTfm7SdPXaDlejNycUOLhX74PbyfTUTbFkCvtbI ZUuA== X-Gm-Message-State: AOAM531M10+4cxituTYqF859TvICuT7an6JU6S9TAbUDL8r44995LaIn tURVerltmIP40kK3IFeiV/UWKuwyqTtua3dhTMr3efgJP78+Q94Xx/f5U4YyVReT1WFAOZsbFvU 7rJ22wusmico= X-Received: by 2002:a1c:23d0:: with SMTP id j199mr19604567wmj.176.1626884383927; Wed, 21 Jul 2021 09:19:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi2aVJKRRkL7W7lwqE3FHvjYx9QJvQYekUcCXTyn1xROQV5WZPFTYQC7kuJCV/DdCtwoqcEQ== X-Received: by 2002:a1c:23d0:: with SMTP id j199mr19604543wmj.176.1626884383690; Wed, 21 Jul 2021 09:19:43 -0700 (PDT) Received: from [192.168.3.132] (p5b0c65c3.dip0.t-ipconnect.de. [91.12.101.195]) by smtp.gmail.com with ESMTPSA id n5sm26402169wri.31.2021.07.21.09.19.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Jul 2021 09:19:43 -0700 (PDT) To: Ivan Teterevkov , Peter Xu , Tiberiu Georgescu Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Axel Rasmussen , Nadav Amit , Jerome Glisse , "Kirill A . Shutemov" , Jason Gunthorpe , Alistair Popple , Andrew Morton , Andrea Arcangeli , Matthew Wilcox , Mike Kravetz , Hugh Dickins , Miaohe Lin , Mike Rapoport , "Carl Waldspurger [C]" , Florian Schmidt , "ovzxemul@gmail.com" References: <20210715201422.211004-1-peterx@redhat.com> <20210715201651.212134-1-peterx@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v5 24/26] mm/pagemap: Recognize uffd-wp bit for shmem/hugetlbfs Message-ID: <5c3c84ee-02f6-a2af-13b8-5dcf70676641@redhat.com> Date: Wed, 21 Jul 2021 18:19:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=EH68B6PV; spf=none (imf25.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam05 X-Stat-Signature: 5bkhzmdjs69ch35izpgafstwunow3mhj X-Rspamd-Queue-Id: EE63FB00DE79 X-HE-Tag: 1626884389-94631 Content-Transfer-Encoding: quoted-printable 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 21.07.21 16:38, Ivan Teterevkov wrote: > On Mon, Jul 19, 2021 5:56 PM +0000, Peter Xu wrote: >> I'm also curious what would be the real use to have an accurate PM_SWA= P >> accounting. To me current implementation may not provide accurate val= ue but >> should be good enough for most cases. However not sure whether it's a= lso true >> for your use case. >=20 > We want the PM_SWAP bit implemented (for shared memory in the pagemap > interface) to enhance the live migration for some fraction of the guest > VMs that have their pages swapped out to the host swap. Once those page= s > are paged in and transferred over network, we then want to release them > with madvise(MADV_PAGEOUT) and preserve the working set of the guest VM= s > to reduce the thrashing of the host swap. There are 3 possibilities I think (swap is just another variant of the=20 page cache): 1) The page is not in the page cache, e.g., it resides on disk or in a=20 swap file. pte_none(). 2) The page is in the page cache and is not mapped into the page table.=20 pte_none(). 3) The page is in the page cache and mapped into the page table.=20 !pte_none(). Do I understand correctly that you want to identify 1) and indicate it=20 via PM_SWAP? --=20 Thanks, David / dhildenb