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=-9.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 259ABC433DB for ; Tue, 22 Dec 2020 08:07:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A9A522312D for ; Tue, 22 Dec 2020 08:07:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9A522312D 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 C5A8C6B0095; Tue, 22 Dec 2020 03:07:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BE0B76B0096; Tue, 22 Dec 2020 03:07:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA8396B0098; Tue, 22 Dec 2020 03:07:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 914256B0095 for ; Tue, 22 Dec 2020 03:07:33 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 565288249980 for ; Tue, 22 Dec 2020 08:07:33 +0000 (UTC) X-FDA: 77620188786.20.stick72_0e07e942745e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 37088180C07AB for ; Tue, 22 Dec 2020 08:07:33 +0000 (UTC) X-HE-Tag: stick72_0e07e942745e X-Filterd-Recvd-Size: 6838 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Dec 2020 08:07:32 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id s15so2609848plr.9 for ; Tue, 22 Dec 2020 00:07:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=vZw5nI+kCEEx1ompDMl4HBZSoNTPvUzGrnmedcFZpg8=; b=JaROmKllcxZJVSF/7f9ajF4vZ/3yI3Ppuoc9yGHEnIiI0Bm+YkKpjmdV9Cl4vLEfrk GxXkm9MIxo35fXB1bSqq0QILocaPg8WSo56E345ryIV0sAtyi9mG3BKjKi5hcFdwehPX bFrwLCmhAgRsMVx4Y64dbMDB+dvj69VpdrMyYkz02CkoPFz23ssTuqCiLfZr21ZXjA7G oxZ7hur2XCUhVBwP9QcyLLxgpRY/A0aoR8TBCaB8Y40JdxwjLjEj0WVLo7b1d4IHib2h hEIr7+oTGM5fnPYVtiF/+bn7XSSqLZ1QRRsW2QC89QuWBkolBXs9JquUFPyJPfNDu3p/ etOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id :mail-followup-to:mime-version:content-disposition:user-agent; bh=vZw5nI+kCEEx1ompDMl4HBZSoNTPvUzGrnmedcFZpg8=; b=CxrTLBOpIQaSYNAe72p/ebF1g8uLzcOqvntykBy49EgT92Htx1i5NlSqUM4JMwL1Tp Lv5Qjew4d28oLEiFYseEiFXksgwkPYX9fAPZldgFVipu7lcv19iUxuVxUMOyNqf4fyhm wCzcwAONgXqL7AEEHQX4OZ/noyP/xfpU15w6L4bZjTK0Xowr4cr9wH4kbcIzU8toxDtI KIEhlp6c8TNn9oa8ex9vJgksm5pDfdDo+YTAGhoD4ssQe//+IobEr7tWasUQN497Vwte PXo8hGAAnDSgE6tUsBBwChpIRvN/ooXmgww9XnDgblUNzhd/Ieycpey3EDW1tyh0BybF +wyA== X-Gm-Message-State: AOAM533SjpIcC8wx93LvYatAGgolGX6JcrW1Q5EG2pjymo6GkXqDpMwN U7FdnxhNgOcZLbkL35wmmVg= X-Google-Smtp-Source: ABdhPJw8bdnstDutKrG4AgPCG0dKtYaUoLX0FqgRoWULLnzBH3nde0MHSy5P0vurfiRkRGXT96XM3w== X-Received: by 2002:a17:902:b706:b029:dc:3817:4da5 with SMTP id d6-20020a170902b706b02900dc38174da5mr12068668pls.23.1608624450476; Tue, 22 Dec 2020 00:07:30 -0800 (PST) Received: from open-light-1.localdomain (66.98.113.28.16clouds.com. [66.98.113.28]) by smtp.gmail.com with ESMTPSA id b7sm7126753pff.96.2020.12.22.00.07.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Dec 2020 00:07:29 -0800 (PST) From: Liang Li X-Google-Original-From: Liang Li Date: Tue, 22 Dec 2020 03:07:27 -0500 To: Alexander Duyck , Mel Gorman , Andrew Morton , Andrea Arcangeli , Dan Williams , "Michael S. Tsirkin" , David Hildenbrand , Jason Wang , Dave Hansen , Michal Hocko , Liang Li , Mike Kravetz , Liang Li Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org Subject: [RFC PATCH 0/3 updated] add support for free hugepage reporting Message-ID: <20201222080724.GA30239@open-light-1.localdomain> Mail-Followup-To: Alexander Duyck , Mel Gorman , Andrew Morton , Andrea Arcangeli , Dan Williams , "Michael S. Tsirkin" , David Hildenbrand , Jason Wang , Dave Hansen , Michal Hocko , Liang Li , Mike Kravetz , Liang Li , linux-mm@kvack.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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: A typical usage of hugetlbfs it's to reserve amount of memory during kernel booting, and the reserved pages are unlikely to return to the buddy system. When application need hugepages, kernel will allocate them from the reserved pool. when application terminates, huge pages will return to the reserved pool and are kept in the free list for hugetlb, these free pages will not return to buddy freelist unless the size fo reserved pool is changed. Free page reporting only supports buddy pages, it can't report the free pages reserved for hugetlbfs. On the other hand, hugetlbfs is a good choice for system with a huge amount of RAM, because it can help to reduce the memory management overhead and improve system performance. This patch add the support for reporting hugepages in the free list of hugetlb, it can be used by virtio_balloon driver for memory overcommit and pre zero out free pages for speeding up memory population and page fault handling. Most of the code are 'copied' from free page reporting because they are working in the same way. So the code can be refined to remove the duplicated code. Since this is an RFC, I didn't do that. For the virtio_balloon driver, changes for the virtio spec are needed. Before that, I need the feedback of the comunity about this new feature. This RFC is baed on my previous series: '[RFC v2 PATCH 0/4] speed up page allocation for __GFP_ZERO' Liang Li (3): mm: support hugetlb free page reporting virtio-balloon: add support for providing free huge page reports to host mm: support free hugepage pre zero out drivers/virtio/virtio_balloon.c | 61 ++++++ include/linux/hugetlb.h | 3 + include/linux/page_reporting.h | 5 + include/uapi/linux/virtio_balloon.h | 1 + mm/hugetlb.c | 29 +++ mm/page_prezero.c | 17 ++ mm/page_reporting.c | 287 ++++++++++++++++++++++++++++ mm/page_reporting.h | 34 ++++ 8 files changed, 437 insertions(+) Cc: Alexander Duyck Cc: Mel Gorman Cc: Andrea Arcangeli Cc: Dan Williams Cc: Dave Hansen Cc: David Hildenbrand Cc: Michal Hocko Cc: Andrew Morton Cc: Alex Williamson Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Mike Kravetz Cc: Liang Li -- 2.18.2