Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp735673pxm; Fri, 25 Feb 2022 18:43:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJx85eehnL0A/9XxE8oPtE+pXczLS7+UenArID0JD0kKK7DB5zC9NHx1DwCI8EV7dvJKLyxz X-Received: by 2002:a17:90a:2807:b0:1bc:842c:6c51 with SMTP id e7-20020a17090a280700b001bc842c6c51mr6113779pjd.242.1645843416839; Fri, 25 Feb 2022 18:43:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645843416; cv=none; d=google.com; s=arc-20160816; b=FvuhIA8P1Zyg4AGmkQUnYEpiGWodkN8yheJl0GUrXx07HhNJnHb15kaurengHHPAw6 H1/tw332w2b3gJMnTXQewT0s27UYmVwTawTUDqVt4sCxtvQOBwFF2ly615Hm4DrlZqZQ lptSUgeSDOjJIEzh7terxp2JGnCyu8gA5AGxd++X8ZIdsg4lcq+AlnHLqH3yEt0JvDsi ZLhrV5+vqzMwjIC/y+CdHLEKfam2SeZq8Xnc63hPlsVVsG840JPUyBqwJerslkqqgaFe XAbEIF8s/969WhVxHGmDHGGM0O0mcz8H+M6iehDXlMYqm8jXreef0ngqEViFREDD9EWY FURg== 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:dkim-signature; bh=/KigQdnFd5mFTT/93mRvjhtdUhjTO09/KSQEMEs3KFI=; b=wgJ5cW2on/NEDUV+qjUghkJKVHPsB9lQI75KYAvtnHQnHoG5/7GB3WpbLkwgO9+jDv OVZdzOjEDcBNChM7R4WEk5MMJjU8r6Joo3GtHXMpym9S5ab2nYvJpaAcu9GsIP5GWkrU fds24lRMAU7aB1JlMWy71ENpy8OnPBYg+bQplWUg5qwcMBt07eTSaFyvU7KkJ3aW9kS0 CcXlT0jPohuxURUkUrnABnUdNyF1cyErZcz7Ic6axQw3a/ke4ngvwBsksk89G/qqj4YB ku5QV6B9YIQzS4zCfzZExwoHPXCwEftP2cg+oNwpLR11M6MhmCtF9whlGYZKae03XrHu kWTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ePKrTyej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b11-20020a63930b000000b00374a33a5780si3432882pge.627.2022.02.25.18.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:43:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ePKrTyej; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B202C2ACCD9; Fri, 25 Feb 2022 18:07:16 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbiBZBcV (ORCPT + 99 others); Fri, 25 Feb 2022 20:32:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiBZBcT (ORCPT ); Fri, 25 Feb 2022 20:32:19 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91A8C21A991; Fri, 25 Feb 2022 17:31:44 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id t11so8550520ioi.7; Fri, 25 Feb 2022 17:31:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/KigQdnFd5mFTT/93mRvjhtdUhjTO09/KSQEMEs3KFI=; b=ePKrTyejrbbuJ4qUkTVosSdwluGgYxR2Of5TCKLu2sB9aAHTvnrXLN0+DC1+G3yKoi aPffeu+ERqhWMFl+NXg4qWoDX1YrGAICWJxS4gVdNX4bqQGtAvES1k4cjdqm7cm89nK2 ki/GgN83Ni+kVVoU/GYAZFcsECYmfVdkeHzQMgJ5sSamg++8uWfQVQP6h5+qimeTADnd lUSrdmNXN9S3k82uTfzJ+Iagp9lMlpt3Laoulu8RQoIbdMasPA6dTjZK9uYMWmUsyXfr ZuVhLJpTxA6p3N+7ig/jKfV4fQD93LZV3IdQiNGumnqkVbqCwvySaE6EPamaVx9tCyEJ 1A+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/KigQdnFd5mFTT/93mRvjhtdUhjTO09/KSQEMEs3KFI=; b=xnWH+gNYIVqaexYmDAoqC72Jqv5nECcY5B+g4tFokDFOtjaE5LG6+V0NYkoBoBXdcN Ol8v7cilZDO4eJHooxF2NaL8YhIGT9eqD1rnl4BdLtGrtMU2uYxTobZ9e3um5QQJp5YX VOpGS0M482YY1tEEYm/9y5CkS58IKBkoAQcyWrP8wk5V6k6xlaKhgoc8LAYEnqEnpsGQ c58hzNLbR5j5KSMHtaZ5Y7cEjIUERjabWdpQJv9pumKLBD1x9IsZ0fzU10dbBGHpRFzN laSSGmCgiYmRSzx3HU3dRrRq4bzdraVywTfBu2zSX1TlF29CS+HSjbRMCbPtNEWXL5RZ pV/Q== X-Gm-Message-State: AOAM531rfboZDnfkh8dQ3VwTigDVTYhm1dPUOWa8oh2S1F9h7BXY5UA0 rJyul9YWrdYMKCt5DTCfv7o6Ycw9nmo= X-Received: by 2002:a02:ccd7:0:b0:30d:21d0:51d6 with SMTP id k23-20020a02ccd7000000b0030d21d051d6mr8057635jaq.138.1645839103954; Fri, 25 Feb 2022 17:31:43 -0800 (PST) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id h9-20020a92c089000000b002b8b3ce939fsm2481444ile.9.2022.02.25.17.31.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 17:31:42 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 9201D27C0054; Fri, 25 Feb 2022 20:31:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 25 Feb 2022 20:31:41 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleehgdeffecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpedvleeigedugfegveejhfejveeuveeiteejieekvdfgjeefudehfefhgfegvdeg jeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 25 Feb 2022 20:31:40 -0500 (EST) Date: Sat, 26 Feb 2022 09:30:50 +0800 From: Boqun Feng To: "Michael Kelley (LINUX)" Cc: Wei Liu , vkuznets , "linux-hyperv@vger.kernel.org" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Dexuan Cui , David Hildenbrand , "linux-kernel@vger.kernel.org" Subject: Re: [RFC v1.1] Drivers: hv: balloon: Disable balloon and hot-add accordingly Message-ID: References: <20220223131548.2234326-3-boqun.feng@gmail.com> <20220225021714.3815691-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 25, 2022 at 05:06:45PM +0000, Michael Kelley (LINUX) wrote: > From: Boqun Feng Sent: Thursday, February 24, 2022 6:17 PM > > > > Currently there are known potential issues for balloon and hot-add on > > ARM64: > > > > * Unballoon requests from Hyper-V should only unballoon ranges > > that are guest page size aligned, otherwise guests cannot handle > > because it's impossible to partially free a page. > > The above problem occurs only when the guest page size is > 4 Kbytes. > Ok, I wil call it out in next version. > > > > * Memory hot-add requests from Hyper-V should provide the NUMA > > node id of the added ranges or ARM64 should have a functional > > memory_add_physaddr_to_nid(), otherwise the node id is missing > > for add_memory(). > > > > These issues require discussions on design and implementation. In the > > meanwhile, post_status() is working and essiential to guest monitoring. > > s/essiential/essential/ > > > Therefore instead of the entire hv_balloon driver, the balloon and > > hot-add are disabled accordingly for now. Once the issues are fixed, > > they can be re-enable in these cases. > > Missing the word "disabling" in the first line? Also the balloon The phrasing that I was trying to use here is "Instead of A, B and C are disabled" or "B and C are disabled instead of A". Looks like I'm inventing my own English? Any I will add the "disabling" in the next version ;-) Regards, Boqun > function is disabled only if the page size is > 4 Kbytes. > > > > > Signed-off-by: Boqun Feng > > --- > > v1 --> v1.1: > > > > * Use HV_HYP_PAGE_SIZE instead of hard coding 4096 as suggested by > > Michael. > > > > * Explicitly print out the disable message if a function is > > disabled as suggested by Michael. > > > > drivers/hv/hv_balloon.c | 36 ++++++++++++++++++++++++++++++++++-- > > 1 file changed, 34 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c > > index 062156b88a87..eee7402cfc02 100644 > > --- a/drivers/hv/hv_balloon.c > > +++ b/drivers/hv/hv_balloon.c > > @@ -1660,6 +1660,38 @@ static void disable_page_reporting(void) > > } > > } > > > > +static int ballooning_enabled(void) > > +{ > > + /* > > + * Disable ballooning if the page size is not 4k (HV_HYP_PAGE_SIZE), > > + * since currently it's unclear to us whether an unballoon request can > > + * make sure all page ranges are guest page size aligned. > > My interpretation of the conversations with Hyper-V is that that they clearly > don't guarantee page ranges are guest page aligned. > > > + */ > > + if (PAGE_SIZE != HV_HYP_PAGE_SIZE) { > > + pr_info("Ballooning disabled because page size is not 4096 bytes\n"); > > + return 0; > > + } > > + > > + return 1; > > +} > > + > > +static int hot_add_enabled(void) > > +{ > > + /* > > + * Disable hot add on ARM64, because we currently rely on > > + * memory_add_physaddr_to_nid() to get a node id of a hot add range, > > + * however ARM64's memory_add_physaddr_to_nid() always return 0 and > > + * DM_MEM_HOT_ADD_REQUEST doesn't have the NUMA node information for > > + * add_memory(). > > + */ > > + if (IS_ENABLED(CONFIG_ARM64)) { > > + pr_info("Memory hot add disabled on ARM64\n"); > > + return 0; > > + } > > + > > + return 1; > > +} > > + > > static int balloon_connect_vsp(struct hv_device *dev) > > { > > struct dm_version_request version_req; > > @@ -1731,8 +1763,8 @@ static int balloon_connect_vsp(struct hv_device *dev) > > * currently still requires the bits to be set, so we have to add code > > * to fail the host's hot-add and balloon up/down requests, if any. > > */ > > - cap_msg.caps.cap_bits.balloon = 1; > > - cap_msg.caps.cap_bits.hot_add = 1; > > + cap_msg.caps.cap_bits.balloon = ballooning_enabled(); > > + cap_msg.caps.cap_bits.hot_add = hot_add_enabled(); > > > > /* > > * Specify our alignment requirements as it relates > > -- > > 2.33.0 > > The code looks good to me. > > Michael