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=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 4DB7AC433E7 for ; Wed, 2 Sep 2020 10:34:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0EFE02071B for ; Wed, 2 Sep 2020 10:34:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="F2B1P7FW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EFE02071B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5E4F56B0002; Wed, 2 Sep 2020 06:34:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 595A16B0003; Wed, 2 Sep 2020 06:34:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4848B6B0037; Wed, 2 Sep 2020 06:34:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id 30B456B0002 for ; Wed, 2 Sep 2020 06:34:18 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DF7768249980 for ; Wed, 2 Sep 2020 10:34:17 +0000 (UTC) X-FDA: 77217761754.03.paper03_510084d270a0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 9CA5D28A4E9 for ; Wed, 2 Sep 2020 10:34:17 +0000 (UTC) X-HE-Tag: paper03_510084d270a0 X-Filterd-Recvd-Size: 5891 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Sep 2020 10:34:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599042856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PXBhtaRI8GbK37HD3MQj1XXzIUWZBG4uV41KUm49E4E=; b=F2B1P7FW9d6ZPl6fO64DmVce41HtfH8+Lgbtt60PqftsG1RyO94j58cDZpNCcOD8jksW7e BYl4VwHf9DBf9muq3YNqZ0hIDP2PeB1k0L4lFjTFc/xZSROd6kSLm+Twa1FHIvhISzfPBG 3xF4hFfSSAXNPFL+TBHkUNwl0wCu8sI= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-106-j5MDeQaJNMGZWBmHAjn00Q-1; Wed, 02 Sep 2020 06:34:15 -0400 X-MC-Unique: j5MDeQaJNMGZWBmHAjn00Q-1 Received: by mail-ej1-f69.google.com with SMTP id ce9so1281608ejb.7 for ; Wed, 02 Sep 2020 03:34:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=6YbE9ocgSEbs212dC/3NaXleeyro7z5HehKfcKWSbBA=; b=U2x7+bKXLBTxVvnKx1IjfThL9qw+Cx7zJPpztnWXdjv2PUSsrz81eOlyeZJ1YqSlI5 oWWsUiEyXthItShEqpofeew/txzl+kRx7k7vg3jm0u6j8GNWcIqQiuSGBRgmLVl9zcQX djGqNFpBQeEPh9TGhmIt9NvAfXLxp1BgwxAq3dXbMnpfY/HpnE4+IO+rmu6Wy7vPS/Yx 9PPg8RTRs7LIoVB8oAtCN8Fw7pN8mIkfMZmWgYGaP3ahqkpnpG5w3+kKBp/aI/Hn2hfE O8Qbh/1W4qGnTA5X6+BvguOrnxsuKnuzADbBhqDpiTmIIuR6bi5BhTDamyRYRXpZZqez HvpQ== X-Gm-Message-State: AOAM532v3lcsxaCDj5d2UGnJiYoVhb4ENYYiNa2Lv4hXF/ykcBL452fq pN8ZrvY+8yY7c6GP4zdAzSYRx/9UXKjHbiBySJDS1iPgq809IN2fWoeoojGF/E/LVwXEWEG7hFa U1TOD6wIxahg= X-Received: by 2002:a50:8e52:: with SMTP id 18mr5951904edx.28.1599042853990; Wed, 02 Sep 2020 03:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyfvB2OEfbLYHiQ0iuRWX5RnGHRm0NO4ryqac7O6KtUoD1XTteJLc6sk4G2sRZytr3cwXHFA== X-Received: by 2002:a50:8e52:: with SMTP id 18mr5951872edx.28.1599042853725; Wed, 02 Sep 2020 03:34:13 -0700 (PDT) Received: from ?IPv6:2003:c2:2f12:bb04:81d3:a22d:db7e:2eac? (p200300c22f12bb0481d3a22ddb7e2eac.dip0.t-ipconnect.de. [2003:c2:2f12:bb04:81d3:a22d:db7e:2eac]) by smtp.gmail.com with ESMTPSA id x1sm3831470ejc.119.2020.09.02.03.34.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Sep 2020 03:34:13 -0700 (PDT) From: David Hildenbrand Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v1 4/5] xen/balloon: try to merge system ram resources Date: Wed, 2 Sep 2020 12:34:12 +0200 Message-Id: <24371321-8A12-4EBD-864C-A2B50E886BF7@redhat.com> References: <226413fc-ef25-59bd-772f-79012fda0ee3@suse.com> Cc: David Hildenbrand , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, linux-hyperv@vger.kernel.org, xen-devel@lists.xenproject.org, Andrew Morton , Michal Hocko , Boris Ostrovsky , Stefano Stabellini , =?utf-8?Q?Roger_Pau_Monn=C3=A9?= , Julien Grall , Pankaj Gupta , Baoquan He , Wei Yang In-Reply-To: <226413fc-ef25-59bd-772f-79012fda0ee3@suse.com> To: =?utf-8?Q?J=C3=BCrgen_Gro=C3=9F?= X-Mailer: iPhone Mail (17G68) Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0.503 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 9CA5D28A4E9 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: > Am 02.09.2020 um 12:15 schrieb J=C3=BCrgen Gro=C3=9F : >=20 > =EF=BB=BFOn 21.08.20 12:34, David Hildenbrand wrote: >> Let's reuse the new mechanism to merge system ram resources below the >> root. We are the only one hotplugging system ram (e.g., DIMMs don't appl= y), >> so this is safe to be used. >> Cc: Andrew Morton >> Cc: Michal Hocko >> Cc: Boris Ostrovsky >> Cc: Juergen Gross >> Cc: Stefano Stabellini >> Cc: Roger Pau Monn=C3=A9 >> Cc: Julien Grall >> Cc: Pankaj Gupta >> Cc: Baoquan He >> Cc: Wei Yang >> Signed-off-by: David Hildenbrand >> --- >> drivers/xen/balloon.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c >> index 37ffccda8bb87..5ec73f752b8a7 100644 >> --- a/drivers/xen/balloon.c >> +++ b/drivers/xen/balloon.c >> @@ -338,6 +338,10 @@ static enum bp_state reserve_additional_memory(void= ) >> if (rc) { >> pr_warn("Cannot add additional memory (%i)\n", rc); >> goto err; >> + } else { >> + resource =3D NULL; >> + /* Try to reduce the number of system ram resources. */ >> + merge_system_ram_resources(&iomem_resource); >> } >=20 > I don't see the need for setting resource to NULL and to use an "else" > clause here. >=20 I set it to NULL because the pointer may be stale after that call - to avoi= d future bugs. But I can drop it. Ack to the =E2=80=9Eelse=E2=80=9C case. Thanks for having a look! >=20 > Juergen >=20