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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5159C433F5 for ; Fri, 30 Sep 2022 06:01:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3BA9D6B0072; Fri, 30 Sep 2022 02:01:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3694D8D0002; Fri, 30 Sep 2022 02:01:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 231598D0001; Fri, 30 Sep 2022 02:01:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1459D6B0072 for ; Fri, 30 Sep 2022 02:01:53 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CD6A7160349 for ; Fri, 30 Sep 2022 06:01:52 +0000 (UTC) X-FDA: 79967705664.14.8503B00 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf21.hostedemail.com (Postfix) with ESMTP id 57B1D1C0011 for ; Fri, 30 Sep 2022 06:01:52 +0000 (UTC) Received: by linux.microsoft.com (Postfix, from userid 1134) id 5AA1020E0A4E; Thu, 29 Sep 2022 23:01:51 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5AA1020E0A4E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1664517711; bh=qRoWZWlP4PyLwwF+NTY7O5tHe3fxjaFBPD6xLZ+mKKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=colrSgEc59NLFwQiwI2jCC5sN1D3He9ulH/DmgqQDdnA4f+alTCq0XYDNqrIDUVIA rKSYF9L6GI9w/1CxE0NRPiYV0D3i9nXbQW2bhlVyX+bcK7kTFQpJNOLXmT/M9Nxelj Xvu8C9bNQKzv+33IMROMgwG7io03DJgTLtG70DTk= From: Shradha Gupta To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org Cc: Shradha Gupta , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Michael Kelley Subject: [PATCH v2 0/2] Configurable order free page reporting in hyper-v Date: Thu, 29 Sep 2022 23:01:37 -0700 Message-Id: <1664517699-1085-1-git-send-email-shradhagupta@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1664447081-14744-1-git-send-email-shradhagupta@linux.microsoft.com> References: <1664447081-14744-1-git-send-email-shradhagupta@linux.microsoft.com> ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=colrSgEc; spf=pass (imf21.hostedemail.com: domain of shradhagupta@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=shradhagupta@linux.microsoft.com; dmarc=pass (policy=none) header.from=linux.microsoft.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664517712; a=rsa-sha256; cv=none; b=2/A5O8EPT1jtFHD9iyNpTtHJEHUaBWsAzPth4aB9TqUOKj+QTlTH1KudKoxDd74RkFqEZR hw8ZlTYluN8ebU6lwwScxZUfBDW+d+zwnMvg1bba6ntz+mZpa37UD3gIPm2iITjAyVIxh+ egI1iR7jzZ7m9j5tFgik95tXPkZS9Hw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664517712; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=qRoWZWlP4PyLwwF+NTY7O5tHe3fxjaFBPD6xLZ+mKKs=; b=tSSyhJ3ty/lEJyOnfyX7d2X6a12bSfMBq+ORML85gUgmuLqyxHQum24Bt7GqwTD3mFwWeI 19XDma0kbn1GEmNIsqZJegf0GyiT1i04/4k8+XNNGZra9Ta9sVAESgzWs0RSQpcroz5saD Zjq78FlTWp1eQuPn3FwyCyDILQ+iKlk= X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=colrSgEc; spf=pass (imf21.hostedemail.com: domain of shradhagupta@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=shradhagupta@linux.microsoft.com; dmarc=pass (policy=none) header.from=linux.microsoft.com X-Rspamd-Server: rspam10 X-Stat-Signature: 3skmmbsyyntkm5zxpxo54pkqe4qj6rtm X-Rspamd-Queue-Id: 57B1D1C0011 X-HE-Tag: 1664517712-257708 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: In some scenarios Hyper-V needs to manage memory more tightly, so it needs as much information as possible about unused guest pages. To that end Hyper-V now allows free page reporting in chunks smaller than 2 Mbytes. Because of the performance tradeoffs, we want to make the chunk size configurable. Since there's already a free page reporting module parameter, let's use that rather than creating yet another parameter. Configurable order free page reporting is enabled in page_reporting driver in mm tree. However, changes need to be made in drivers like hyper-v's hv_balloon to make it aware of the page order. These patches add support for the same. In the page_reporting driver(patch 1) we export the page_reporting_order module parameter. Besides this, in the page_reporting module a check is added to ensure that whenever the page_reporting_order value is changed, it is within the prescribed limits. The hv_balloon side changes(patch 2) include consuming the exported page_reporting_order. Making changes in reporting these variable order free pages as cold discard hints to hyper-v and dropping and refining checks that restrict the order to a minimum of 9(default). --- Changes in v2 * Add more details in the cover letter about the motivation * Fix the threading between dependent patches Shradha Gupta (2): mm/page_reporting: Add checks for page_reporting_order param hv_balloon: Add support for configurable order free page reporting drivers/hv/hv_balloon.c | 94 ++++++++++++++++++++++++++++++++--------- mm/page_reporting.c | 50 +++++++++++++++++++--- 2 files changed, 118 insertions(+), 26 deletions(-) -- 2.37.2