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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 3D2EFC49ED7 for ; Tue, 10 Sep 2019 14:42:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F0C021D7B for ; Tue, 10 Sep 2019 14:42:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mdlhWpzQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393450AbfIJOm4 (ORCPT ); Tue, 10 Sep 2019 10:42:56 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:34360 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732465AbfIJOmz (ORCPT ); Tue, 10 Sep 2019 10:42:55 -0400 Received: by mail-io1-f68.google.com with SMTP id k13so22848847ioj.1; Tue, 10 Sep 2019 07:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qwfqdrsthj6wGMKbVfq9KS+2D4+bl2wd+HAoXgrqGpM=; b=mdlhWpzQsILASMQ7+1ikwT0fUSiwI9Yno2A8k95yLHD6P9eV0S05kOW5Jv6prsMvSt iBXlVLmgNneBJJPewyY1Iz+eUwtz//m6IWYeMweTFXG1suDqKgsSJ2xCT/kZ1HcGuX4Y n5DFuajmtetj/LpA2LEgEC9oiE4MlkG9fH5vD+eWjaUxrS6bT4PmDA2aOayknXG3RXII 9e0AvcNoE4ZxbCtIxiI/lT91HGh0dhQFb9BVLzxS7z4Bakuzjqvda8OJvgMc4cNBYsKq JywENk314egMFnOMmeOVAlHQzPFr5FrWB11JMPxvnyAvp/9VaOr3lB+4BYVwvWI0USRT DKkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qwfqdrsthj6wGMKbVfq9KS+2D4+bl2wd+HAoXgrqGpM=; b=Z9LPZMhsolBeT8q3jBZpNieT2wYdkoa/4VTmTXMcfGuh2Y6jsWSoYgTaxevanmkA/k 1Q3SR6D2IVWgmcWBJumyvlN+SD0PWYd0PZeLkHQUVHz5xdwVcsm+IV/cMaowhPw9j14v ftQ+3bWVwMvJ/rYd8bR92mNuZRDRTXPA0H0M7394VUrW1HnWrKe1/7C2L2xYZu4jrqGP Q5Ehx5hdBngM+1emZFoaN0k/jc7QEeT1nIU0OcJ8kWa949foPkFugkL9uBSngWz3RFcJ PPx1kVfzyJh+PqvbHNjGkE+QuHLBqMcAJiPQB6ZYg1BdfcsvMW0bXdFKzhgjEtDAoRWY Up0g== X-Gm-Message-State: APjAAAWbYmT0uoHevvdwytI1PNgAz8HRx7+MufoYxRvNI6BXe/wNl6Dt 7VGbILc/Y59ylpi6KcXH+rgac/wt/0SFsRstpbQ= X-Google-Smtp-Source: APXvYqw25PAt3681VzSp2aKtn4HION8cnSVVgIaDxDN4t5As0qF4aUf02XL+Yw/GC74k1NJX1qc/ljlh1hZcV/Ap7TM= X-Received: by 2002:a02:9f16:: with SMTP id z22mr31770205jal.83.1568126574433; Tue, 10 Sep 2019 07:42:54 -0700 (PDT) MIME-Version: 1.0 References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190910124209.GY2063@dhcp22.suse.cz> In-Reply-To: <20190910124209.GY2063@dhcp22.suse.cz> From: Alexander Duyck Date: Tue, 10 Sep 2019 07:42:43 -0700 Message-ID: Subject: Re: [PATCH v9 0/8] stg mail -e --version=v9 \ To: Michal Hocko Cc: virtio-dev@lists.oasis-open.org, kvm list , "Michael S. Tsirkin" , Catalin Marinas , David Hildenbrand , Dave Hansen , LKML , Matthew Wilcox , linux-mm , Andrew Morton , will@kernel.org, linux-arm-kernel@lists.infradead.org, Oscar Salvador , Yang Zhang , Pankaj Gupta , Konrad Rzeszutek Wilk , Nitesh Narayan Lal , Rik van Riel , lcapitulino@redhat.com, "Wang, Wei W" , Andrea Arcangeli , ying.huang@intel.com, Paolo Bonzini , Dan Williams , Fengguang Wu , Alexander Duyck , "Kirill A. Shutemov" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 10, 2019 at 5:42 AM Michal Hocko wrote: > > I wanted to review "mm: Introduce Reported pages" just realize that I > have no clue on what is going on so returned to the cover and it didn't > really help much. I am completely unfamiliar with virtio so please bear > with me. > > On Sat 07-09-19 10:25:03, Alexander Duyck wrote: > [...] > > This series provides an asynchronous means of reporting to a hypervisor > > that a guest page is no longer in use and can have the data associated > > with it dropped. To do this I have implemented functionality that allows > > for what I am referring to as unused page reporting > > > > The functionality for this is fairly simple. When enabled it will allocate > > statistics to track the number of reported pages in a given free area. > > When the number of free pages exceeds this value plus a high water value, > > currently 32, it will begin performing page reporting which consists of > > pulling pages off of free list and placing them into a scatter list. The > > scatterlist is then given to the page reporting device and it will perform > > the required action to make the pages "reported", in the case of > > virtio-balloon this results in the pages being madvised as MADV_DONTNEED > > and as such they are forced out of the guest. After this they are placed > > back on the free list, > > And here I am reallly lost because "forced out of the guest" makes me > feel that those pages are no longer usable by the guest. So how come you > can add them back to the free list. I suspect understanding this part > will allow me to understand why we have to mark those pages and prevent > merging. Basically as the paragraph above mentions "forced out of the guest" really is just the hypervisor calling MADV_DONTNEED on the page in question. So the behavior is the same as any userspace application that calls MADV_DONTNEED where the contents are no longer accessible from userspace and attempting to access them will result in a fault and the page being populated with a zero fill on-demand page, or a copy of the file contents if the memory is file backed. 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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 2F829C4740A for ; Tue, 10 Sep 2019 14:42:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E35E521479 for ; Tue, 10 Sep 2019 14:42:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mdlhWpzQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E35E521479 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 605EB6B0003; Tue, 10 Sep 2019 10:42:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 58FB36B0006; Tue, 10 Sep 2019 10:42:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4561F6B0007; Tue, 10 Sep 2019 10:42:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 233FA6B0003 for ; Tue, 10 Sep 2019 10:42:56 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id C857D824376B for ; Tue, 10 Sep 2019 14:42:55 +0000 (UTC) X-FDA: 75919277910.08.scent13_53bbcfbaea963 X-HE-Tag: scent13_53bbcfbaea963 X-Filterd-Recvd-Size: 5745 Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Sep 2019 14:42:55 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id n197so38066321iod.9 for ; Tue, 10 Sep 2019 07:42:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qwfqdrsthj6wGMKbVfq9KS+2D4+bl2wd+HAoXgrqGpM=; b=mdlhWpzQsILASMQ7+1ikwT0fUSiwI9Yno2A8k95yLHD6P9eV0S05kOW5Jv6prsMvSt iBXlVLmgNneBJJPewyY1Iz+eUwtz//m6IWYeMweTFXG1suDqKgsSJ2xCT/kZ1HcGuX4Y n5DFuajmtetj/LpA2LEgEC9oiE4MlkG9fH5vD+eWjaUxrS6bT4PmDA2aOayknXG3RXII 9e0AvcNoE4ZxbCtIxiI/lT91HGh0dhQFb9BVLzxS7z4Bakuzjqvda8OJvgMc4cNBYsKq JywENk314egMFnOMmeOVAlHQzPFr5FrWB11JMPxvnyAvp/9VaOr3lB+4BYVwvWI0USRT DKkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qwfqdrsthj6wGMKbVfq9KS+2D4+bl2wd+HAoXgrqGpM=; b=uXivBvYOkN0/LOJiya1i1QIPCzYCt6dJ2A6YjOw9UcmsE4kfdWhQbIHYVTPLMJA4Aq tIshRSYBgHlTIyRaP5+stroRtYq+apR40rrtBZ5oKMlXlM0XJJmzqWWkhgYIbdPe9din Wb0v43kCfOjGOjAeyfqEKotKwC/3dm3d3Q1B/rE5ZQNkLAWyQYizAOfnO5fP4c5CNH1/ MZyaT3dvSf0yQDzzuEZnRof4sfN03Pj9WmIKFIuExWY9gCRxaGtDscOgZahbsxmcGgNr 2BHTUEqJ9QvgZB8R7H5hkbrORzB0lJ2a1vTQFYiwh3yypuHL/0eNaXAkK26JbBX2KTro AE7Q== X-Gm-Message-State: APjAAAXTkgy5Li3lvZ/8P0NjMZzk9wtVWuMSWqSmO/i+6ZTOZNiZYYeG S0g+VxZJzDbKTSiWBMqxKQ0xGvobv7U2xULKTyY= X-Google-Smtp-Source: APXvYqw25PAt3681VzSp2aKtn4HION8cnSVVgIaDxDN4t5As0qF4aUf02XL+Yw/GC74k1NJX1qc/ljlh1hZcV/Ap7TM= X-Received: by 2002:a02:9f16:: with SMTP id z22mr31770205jal.83.1568126574433; Tue, 10 Sep 2019 07:42:54 -0700 (PDT) MIME-Version: 1.0 References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190910124209.GY2063@dhcp22.suse.cz> In-Reply-To: <20190910124209.GY2063@dhcp22.suse.cz> From: Alexander Duyck Date: Tue, 10 Sep 2019 07:42:43 -0700 Message-ID: Subject: Re: [PATCH v9 0/8] stg mail -e --version=v9 \ To: Michal Hocko Cc: virtio-dev@lists.oasis-open.org, kvm list , "Michael S. Tsirkin" , Catalin Marinas , David Hildenbrand , Dave Hansen , LKML , Matthew Wilcox , linux-mm , Andrew Morton , will@kernel.org, linux-arm-kernel@lists.infradead.org, Oscar Salvador , Yang Zhang , Pankaj Gupta , Konrad Rzeszutek Wilk , Nitesh Narayan Lal , Rik van Riel , lcapitulino@redhat.com, "Wang, Wei W" , Andrea Arcangeli , ying.huang@intel.com, Paolo Bonzini , Dan Williams , Fengguang Wu , Alexander Duyck , "Kirill A. Shutemov" Content-Type: text/plain; charset="UTF-8" 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 Tue, Sep 10, 2019 at 5:42 AM Michal Hocko wrote: > > I wanted to review "mm: Introduce Reported pages" just realize that I > have no clue on what is going on so returned to the cover and it didn't > really help much. I am completely unfamiliar with virtio so please bear > with me. > > On Sat 07-09-19 10:25:03, Alexander Duyck wrote: > [...] > > This series provides an asynchronous means of reporting to a hypervisor > > that a guest page is no longer in use and can have the data associated > > with it dropped. To do this I have implemented functionality that allows > > for what I am referring to as unused page reporting > > > > The functionality for this is fairly simple. When enabled it will allocate > > statistics to track the number of reported pages in a given free area. > > When the number of free pages exceeds this value plus a high water value, > > currently 32, it will begin performing page reporting which consists of > > pulling pages off of free list and placing them into a scatter list. The > > scatterlist is then given to the page reporting device and it will perform > > the required action to make the pages "reported", in the case of > > virtio-balloon this results in the pages being madvised as MADV_DONTNEED > > and as such they are forced out of the guest. After this they are placed > > back on the free list, > > And here I am reallly lost because "forced out of the guest" makes me > feel that those pages are no longer usable by the guest. So how come you > can add them back to the free list. I suspect understanding this part > will allow me to understand why we have to mark those pages and prevent > merging. Basically as the paragraph above mentions "forced out of the guest" really is just the hypervisor calling MADV_DONTNEED on the page in question. So the behavior is the same as any userspace application that calls MADV_DONTNEED where the contents are no longer accessible from userspace and attempting to access them will result in a fault and the page being populated with a zero fill on-demand page, or a copy of the file contents if the memory is file backed. 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=-1.0 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 73F45C4740A for ; Tue, 10 Sep 2019 14:43:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 44CF3208E4 for ; Tue, 10 Sep 2019 14:43:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b+KcMt3+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mdlhWpzQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44CF3208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JUe12Ocs0WGlqtvcZZLYcEq4sgmiDjKBXvXpEEorCik=; b=b+KcMt3+wvlvn3 fkRLTYWmAW/dMirCxT99uBZELY7oBEG6+L/sTIbRyZZcQTNbcd1Fr9zgIE17FOLY9O3fYVlOzVfnJ 6WCSKOXczoCdC/48e8wgcv72hPI/+O2Uwr9fGibnS3ay9dCmXg0qlynZMuxjsaaj87qa7mijyB1oG mVtgDFwRCBaP/9ZXvfP6DTgy/EGTqUHd5hWyB5YbpA7wA6gupsJmhfOINTPA8urYL+fHj++5YKk6Z qBa5WHPNeKMU+YQuSjPGXM+ne3zi7bVuooY3tZD9i1N5ql8HJ/nae4foF28Xs/U+N28OK5PbXeHjJ SYOCUyaXkz4PxykQU8kA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i7hMd-00043J-36; Tue, 10 Sep 2019 14:43:27 +0000 Received: from mail-io1-xd43.google.com ([2607:f8b0:4864:20::d43]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i7hMB-0003XI-0e for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2019 14:43:00 +0000 Received: by mail-io1-xd43.google.com with SMTP id f4so37353729ion.2 for ; Tue, 10 Sep 2019 07:42:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qwfqdrsthj6wGMKbVfq9KS+2D4+bl2wd+HAoXgrqGpM=; b=mdlhWpzQsILASMQ7+1ikwT0fUSiwI9Yno2A8k95yLHD6P9eV0S05kOW5Jv6prsMvSt iBXlVLmgNneBJJPewyY1Iz+eUwtz//m6IWYeMweTFXG1suDqKgsSJ2xCT/kZ1HcGuX4Y n5DFuajmtetj/LpA2LEgEC9oiE4MlkG9fH5vD+eWjaUxrS6bT4PmDA2aOayknXG3RXII 9e0AvcNoE4ZxbCtIxiI/lT91HGh0dhQFb9BVLzxS7z4Bakuzjqvda8OJvgMc4cNBYsKq JywENk314egMFnOMmeOVAlHQzPFr5FrWB11JMPxvnyAvp/9VaOr3lB+4BYVwvWI0USRT DKkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qwfqdrsthj6wGMKbVfq9KS+2D4+bl2wd+HAoXgrqGpM=; b=SvcqMWnSMMP0EwxPbd9EHPcxeSxXKit0wbLvTit7zcQ/EBvxWnOyDwAN6XHZOJzBD7 LV/S7GQLtB31rF9O+Q5waapVm6oz7sVtuYWzUB2CQuOCHMyrpBDBpbkxllKXwiv2rAKf iWTBSjUzX9Zy3wqt44gLQAC+3TYRNfQLIifZF2H65MaeIXe0kTHa/f9BK1QngsK2eI/B t6iRjcYq1Q/4AxpgnqanoUgq7OhpZYoeNHTADIWMdfFU/+aiTavPK40mlFNj7ZuT9aYC f5g3ZkWNY1TWl0c5284KA8Z6miLtjpxO9hAp+N6DbBU9eBIxKhC0YlHkFBVZGM/R+u/g 7YIA== X-Gm-Message-State: APjAAAWvJIyZD8Wt0N3IoIikuveUlob8eLdOt2nCaXxWbcTVnJTjfvgM +ve9u9umobN1W4PvVudzllSXevNMbeNhkuD+Bdc= X-Google-Smtp-Source: APXvYqw25PAt3681VzSp2aKtn4HION8cnSVVgIaDxDN4t5As0qF4aUf02XL+Yw/GC74k1NJX1qc/ljlh1hZcV/Ap7TM= X-Received: by 2002:a02:9f16:: with SMTP id z22mr31770205jal.83.1568126574433; Tue, 10 Sep 2019 07:42:54 -0700 (PDT) MIME-Version: 1.0 References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190910124209.GY2063@dhcp22.suse.cz> In-Reply-To: <20190910124209.GY2063@dhcp22.suse.cz> From: Alexander Duyck Date: Tue, 10 Sep 2019 07:42:43 -0700 Message-ID: Subject: Re: [PATCH v9 0/8] stg mail -e --version=v9 \ To: Michal Hocko X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190910_074259_146573_23BBFE3A X-CRM114-Status: GOOD ( 18.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Zhang , Pankaj Gupta , kvm list , David Hildenbrand , Catalin Marinas , lcapitulino@redhat.com, linux-mm , Alexander Duyck , will@kernel.org, Andrea Arcangeli , virtio-dev@lists.oasis-open.org, "Michael S. Tsirkin" , Matthew Wilcox , "Wang, Wei W" , ying.huang@intel.com, Rik van Riel , Konrad Rzeszutek Wilk , Dan Williams , linux-arm-kernel@lists.infradead.org, Oscar Salvador , Nitesh Narayan Lal , Dave Hansen , LKML , Paolo Bonzini , Andrew Morton , Fengguang Wu , "Kirill A. Shutemov" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 10, 2019 at 5:42 AM Michal Hocko wrote: > > I wanted to review "mm: Introduce Reported pages" just realize that I > have no clue on what is going on so returned to the cover and it didn't > really help much. I am completely unfamiliar with virtio so please bear > with me. > > On Sat 07-09-19 10:25:03, Alexander Duyck wrote: > [...] > > This series provides an asynchronous means of reporting to a hypervisor > > that a guest page is no longer in use and can have the data associated > > with it dropped. To do this I have implemented functionality that allows > > for what I am referring to as unused page reporting > > > > The functionality for this is fairly simple. When enabled it will allocate > > statistics to track the number of reported pages in a given free area. > > When the number of free pages exceeds this value plus a high water value, > > currently 32, it will begin performing page reporting which consists of > > pulling pages off of free list and placing them into a scatter list. The > > scatterlist is then given to the page reporting device and it will perform > > the required action to make the pages "reported", in the case of > > virtio-balloon this results in the pages being madvised as MADV_DONTNEED > > and as such they are forced out of the guest. After this they are placed > > back on the free list, > > And here I am reallly lost because "forced out of the guest" makes me > feel that those pages are no longer usable by the guest. So how come you > can add them back to the free list. I suspect understanding this part > will allow me to understand why we have to mark those pages and prevent > merging. Basically as the paragraph above mentions "forced out of the guest" really is just the hypervisor calling MADV_DONTNEED on the page in question. So the behavior is the same as any userspace application that calls MADV_DONTNEED where the contents are no longer accessible from userspace and attempting to access them will result in a fault and the page being populated with a zero fill on-demand page, or a copy of the file contents if the memory is file backed. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-6100-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id A3471985AA4 for ; Tue, 10 Sep 2019 14:42:55 +0000 (UTC) MIME-Version: 1.0 References: <20190907172225.10910.34302.stgit@localhost.localdomain> <20190910124209.GY2063@dhcp22.suse.cz> In-Reply-To: <20190910124209.GY2063@dhcp22.suse.cz> From: Alexander Duyck Date: Tue, 10 Sep 2019 07:42:43 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: [virtio-dev] Re: [PATCH v9 0/8] stg mail -e --version=v9 \ To: Michal Hocko Cc: virtio-dev@lists.oasis-open.org, kvm list , "Michael S. Tsirkin" , Catalin Marinas , David Hildenbrand , Dave Hansen , LKML , Matthew Wilcox , linux-mm , Andrew Morton , will@kernel.org, linux-arm-kernel@lists.infradead.org, Oscar Salvador , Yang Zhang , Pankaj Gupta , Konrad Rzeszutek Wilk , Nitesh Narayan Lal , Rik van Riel , lcapitulino@redhat.com, "Wang, Wei W" , Andrea Arcangeli , ying.huang@intel.com, Paolo Bonzini , Dan Williams , Fengguang Wu , Alexander Duyck , "Kirill A. Shutemov" List-ID: On Tue, Sep 10, 2019 at 5:42 AM Michal Hocko wrote: > > I wanted to review "mm: Introduce Reported pages" just realize that I > have no clue on what is going on so returned to the cover and it didn't > really help much. I am completely unfamiliar with virtio so please bear > with me. > > On Sat 07-09-19 10:25:03, Alexander Duyck wrote: > [...] > > This series provides an asynchronous means of reporting to a hypervisor > > that a guest page is no longer in use and can have the data associated > > with it dropped. To do this I have implemented functionality that allows > > for what I am referring to as unused page reporting > > > > The functionality for this is fairly simple. When enabled it will allocate > > statistics to track the number of reported pages in a given free area. > > When the number of free pages exceeds this value plus a high water value, > > currently 32, it will begin performing page reporting which consists of > > pulling pages off of free list and placing them into a scatter list. The > > scatterlist is then given to the page reporting device and it will perform > > the required action to make the pages "reported", in the case of > > virtio-balloon this results in the pages being madvised as MADV_DONTNEED > > and as such they are forced out of the guest. After this they are placed > > back on the free list, > > And here I am reallly lost because "forced out of the guest" makes me > feel that those pages are no longer usable by the guest. So how come you > can add them back to the free list. I suspect understanding this part > will allow me to understand why we have to mark those pages and prevent > merging. Basically as the paragraph above mentions "forced out of the guest" really is just the hypervisor calling MADV_DONTNEED on the page in question. So the behavior is the same as any userspace application that calls MADV_DONTNEED where the contents are no longer accessible from userspace and attempting to access them will result in a fault and the page being populated with a zero fill on-demand page, or a copy of the file contents if the memory is file backed. --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org