Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp465733rdg; Tue, 10 Oct 2023 16:17:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBqH8sLnqiDdlhX88tV2ULFoCx+ELzwQ16gFEY9fxgQ/B8Vw1mAsUnXfoT4pjkbJog9mpZ X-Received: by 2002:a05:6870:d909:b0:1e9:8b78:899c with SMTP id gq9-20020a056870d90900b001e98b78899cmr659189oab.55.1696979822577; Tue, 10 Oct 2023 16:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696979822; cv=none; d=google.com; s=arc-20160816; b=jYxQGQ4CA6dL4nTvjOBqqtJj9Pnhh7rczscJ9Wxlc64eTunB84tFkUxFLdPt0uv5aI fTdHJvvFpP1Ce0fotCdLRJt4bvKgCXu51HaKHQU5OApScDf9+mqiUJw7OjLD/B/A0B/x JXR3Hj6FmU3yVKlfqdjNSjS8R9NoBZ3THJbWvNTqTPbaoGDbOcKBgj+LG4FFYATMfVec 5h8FiXgRl63CZPO6y7bIod4Fu5lr6PnnXZ2cLo2QuLPc0ZM/5Wfsc5BLUBALW+p3L/gw xAy/0lInNUxuPJg685wj0fZYypifsZKTdNisRBH88l6a8QwUL9VjceCdIYd3QiEP2i/7 2bxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=aKx4zNE5WFIDI3mPQVAL8l752XPWDKdWcVAjVY3hphA=; fh=/lfbTFMUgySc4o8k+l3LxIoUgF4EA8TB9hP4ipQGZTo=; b=EHj6eJov9OkQSj6JkAqkc9lRWRY4agklSM4kpu+/+15fP2RmXbzCMPDKUGsTmAPkva M8Wu0DduZiDbJMvcGQ8y4eeWKMgqj4afKveHWTI+TsZkpB8UlyfDuod0rUvDvLlRSaPc ddYqCum60vZCfqlMSKEoSeETa3MrpORj9as8y7dEe01ZP86JZqzmdgca1IPf4oLsQqhf EbiAtl8WjyGKifIhQwT8VZ+R9grrOiJSFTi5avVPQcq05czh0lemxqxR/6yV+VXUV63T X2cP33oynu5WPzPOVeYK7PclMh4SMtZs3g0o3oXrmQApxebWsG8AfTuyLxfhi1ZjKuK3 fgvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id a4-20020a634d04000000b00573efae0ee1si12768354pgb.515.2023.10.10.16.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 16:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 69B9582ED27B; Tue, 10 Oct 2023 16:17:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbjJJXQv (ORCPT + 99 others); Tue, 10 Oct 2023 19:16:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjJJXQv (ORCPT ); Tue, 10 Oct 2023 19:16:51 -0400 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00BC89E; Tue, 10 Oct 2023 16:16:47 -0700 (PDT) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1c434c33ec0so39351375ad.3; Tue, 10 Oct 2023 16:16:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696979807; x=1697584607; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=aKx4zNE5WFIDI3mPQVAL8l752XPWDKdWcVAjVY3hphA=; b=OYY6pPOXQBtkhYDyogrew8cb2VU2D2hAXtok8JThPCO3pfUVRtQGeh+ojHrliVSymr ixUbcCVRYcvPylmWhsE7e1VwrVCz1gjaywciQq9Q7aJy+31D+DHcARTVsLUh9Jahr7oc Iz24LTxP4GZ1c/+KcGTabR/ZvV4ORIdqFJ0Sy4PHJpsmlKcxZguqY+nSS3sJ9XZw/WOP aiaUO+9mMApK4jPNlFUy5ybKaawsUXlgi7jKDO+MXH7cUF+c0wo54Dz3w6/rK+ZN64G/ 94EcQioXYM9SDuBzAzqGOuNanxQFthaVei6Lsn+4YByifbTwmorkwQBQ93NflE0Cwcjg wAmg== X-Gm-Message-State: AOJu0Yypt6hQsNEOkUKWA3XtSul1CdR/r2iNYW42JfVseCM+0/qUna9G MoGZ2L3mxC/nayqG9winZS0= X-Received: by 2002:a17:903:2310:b0:1c7:755d:ccc8 with SMTP id d16-20020a170903231000b001c7755dccc8mr20504201plh.29.1696979807312; Tue, 10 Oct 2023 16:16:47 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([20.69.120.36]) by smtp.gmail.com with ESMTPSA id f7-20020a17090274c700b001c59f23a3fesm12339823plt.251.2023.10.10.16.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 16:16:46 -0700 (PDT) Date: Tue, 10 Oct 2023 23:16:45 +0000 From: Wei Liu To: Angelina Vu Cc: linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com Subject: Re: [PATCH] hv_balloon: Add module parameter to configure balloon floor value Message-ID: References: <1696978087-4421-1-git-send-email-angelinavu@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1696978087-4421-1-git-send-email-angelinavu@linux.microsoft.com> X-Spam-Status: No, score=2.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 16:17:00 -0700 (PDT) X-Spam-Level: ** Hi Angelina, On Tue, Oct 10, 2023 at 03:48:07PM -0700, Angelina Vu wrote: > Currently, the balloon floor value is automatically computed, but may be > too small depending on app usage of memory. This patch adds a balloon_floor > value as a module parameter that can be used to manually configure the > balloon floor value. > > Signed-off-by: Angelina Vu Out of interest, will there be a case that the balloon floor value is misconfigured, hence too small? Why isn't the larger of the two values (computed and manually set) returned instead? Thanks, Wei. > --- > drivers/hv/hv_balloon.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c > index 64ac5bdee3a6..87b312f99b2e 100644 > --- a/drivers/hv/hv_balloon.c > +++ b/drivers/hv/hv_balloon.c > @@ -1101,6 +1101,10 @@ static void process_info(struct hv_dynmem_device *dm, struct dm_info_msg *msg) > } > } > > +unsigned long balloon_floor; > +module_param(balloon_floor, ulong, 0644); > +MODULE_PARM_DESC(balloon_floor, "Memory level (in megabytes) that ballooning will not remove"); > + > static unsigned long compute_balloon_floor(void) > { > unsigned long min_pages; > @@ -1117,6 +1121,9 @@ static unsigned long compute_balloon_floor(void) > * 8192 744 (1/16) > * 32768 1512 (1/32) > */ > + if (balloon_floor) > + return MB2PAGES(balloon_floor); > + > if (nr_pages < MB2PAGES(128)) > min_pages = MB2PAGES(8) + (nr_pages >> 1); > else if (nr_pages < MB2PAGES(512)) > -- > 2.34.1 > >