Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp142277pxa; Fri, 21 Aug 2020 03:37:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRuNn5ntXijzVb4/kG1CIlhzYfCUA3Alqr3+ROSSN2xtuMrCqiU6HKdU/yS6DaR+U1GUpv X-Received: by 2002:aa7:c88f:: with SMTP id p15mr2168176eds.33.1598006237632; Fri, 21 Aug 2020 03:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598006237; cv=none; d=google.com; s=arc-20160816; b=E+jT63zTQsCT7o4bqyZ8cQBA7nmEs+BooVFV3G38BVN2G187bOt1PZECEQt4rwfDDj KYOILQuboqAgljkj0jJLa3XUeWMbOAMlyVSlQUDIoQXjOkw4XERIuT4BR7kbO53V3Ukb ItebnbRUNPtvnQKl6ZlAX0avelCP28H0O2Uyz6Gq+H0vIXjd7euDBexWSEE6lENiUpj2 mvt+VYoIw7Ocn0biDwUp5qCWd3sBRVMwWpQ94n9xYC4oScZ+y0uGA07QNBfbZvKR3P1B s6kzI4/rnxNPWKRNAe7M0dwcmJ6lMr+WGEyHOugE66AnNC4AFsFBjRIRQf/8/DH7sHkQ CXAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AeL7eQMcuzDtJ58y3twR8woldx1f2g3cujVSMwGjGgg=; b=rD9GM9ICDvq8OOsOfNe0HytEwyzVca+gre9VjaOI0UsDrC5iOHmBjqNBg7uWunG/aH Fg+5C3gLGn84BuXegyX9rGVYESaFU1lDTVAEqVWIWnKm90J3ndGtH/GrN5hvy024tPyL NjOnudp2ihALpepWrUKSy1Hq6awHGabtKus59eQkuX945LP+0jACbZE+i0L2J0NR/e0w jmdvgoWX2A2IPX92JopMcho5/14QKtWlM5dZVlf2CWBMYB3l3ADL+yT/ZkndioNRClbN jtvnS/htsr7s6CZEpzsgstv6H2k2ZPwnpc39/C9aB2WNyte1cw9k1jjX8PWedIXCHTk1 xepw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f4atkxJj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo22si844063ejb.698.2020.08.21.03.36.54; Fri, 21 Aug 2020 03:37:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f4atkxJj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728348AbgHUKfl (ORCPT + 99 others); Fri, 21 Aug 2020 06:35:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31500 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727870AbgHUKfW (ORCPT ); Fri, 21 Aug 2020 06:35:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598006121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AeL7eQMcuzDtJ58y3twR8woldx1f2g3cujVSMwGjGgg=; b=f4atkxJjlh77DKACdy22VoaPcQ4vopSeQEfqAo5J39GRHCWAzLROVSfcT8RWbIR7mWwxSV XgVcYhG9gGdInbUWja9cYVT545jqAjeR2C7lUpEbK40+SZUdrvt/aV8hMoMTDPbxhsK+n5 49BUXBFodelVyqVOsqjgwmGd/7TEq/Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-Fg8UITSqMl-wo432KovFmA-1; Fri, 21 Aug 2020 06:35:17 -0400 X-MC-Unique: Fg8UITSqMl-wo432KovFmA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DF0281F02D; Fri, 21 Aug 2020 10:35:15 +0000 (UTC) Received: from t480s.redhat.com (ovpn-114-87.ams2.redhat.com [10.36.114.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5684C60BF1; Fri, 21 Aug 2020 10:35:10 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, linux-mm@kvack.org, linux-hyperv@vger.kernel.org, xen-devel@lists.xenproject.org, David Hildenbrand , Andrew Morton , Michal Hocko , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Pankaj Gupta , Baoquan He , Wei Yang Subject: [PATCH v1 5/5] hv_balloon: try to merge system ram resources Date: Fri, 21 Aug 2020 12:34:31 +0200 Message-Id: <20200821103431.13481-6-david@redhat.com> In-Reply-To: <20200821103431.13481-1-david@redhat.com> References: <20200821103431.13481-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's use the new mechanism to merge system ram resources below the root. We are the only one hotplugging system ram, e.g., DIMMs don't apply, so this is safe to be used. Cc: Andrew Morton Cc: Michal Hocko Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Wei Liu Cc: Pankaj Gupta Cc: Baoquan He Cc: Wei Yang Signed-off-by: David Hildenbrand --- drivers/hv/hv_balloon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 32e3bc0aa665a..49a6305f0fb73 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -745,6 +745,9 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, has->covered_end_pfn -= processed_pfn; spin_unlock_irqrestore(&dm_device.ha_lock, flags); break; + } else { + /* Try to reduce the number of system ram resources. */ + merge_system_ram_resources(&iomem_resource); } /* -- 2.26.2