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=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 2F8DBC433DF for ; Fri, 16 Oct 2020 20:51:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6921A221FD for ; Fri, 16 Oct 2020 20:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602881481; bh=5SYfmWhH44854WrLFpD1duw/aC91J8jGO7Dagxat3Vs=; h=Date:From:To:Subject:Reply-To:List-ID:From; b=owVi+DTxpErCjOFwgDfUYRCx+RWiu94P1f52AI2V9Ex6ha81P1fejPHx4iw5c2wtj l2DXDer+EAr6zot2NyuLvXYQX0bY8qLjtwtLOc9iUVjjmRTc+O7M7BN9r3+P9olZPW 2goWF4IKBt3NJuzV32eUmwlN7tx/k5CH+xwU0yE4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390264AbgJPUvU (ORCPT ); Fri, 16 Oct 2020 16:51:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:40022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732579AbgJPUvU (ORCPT ); Fri, 16 Oct 2020 16:51:20 -0400 Received: from localhost.localdomain (c-71-198-47-131.hsd1.ca.comcast.net [71.198.47.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4790920878; Fri, 16 Oct 2020 20:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602881477; bh=5SYfmWhH44854WrLFpD1duw/aC91J8jGO7Dagxat3Vs=; h=Date:From:To:Subject:From; b=fKpZagHL5rCDDnzXusCvRP6YVo2Igc+cnoNz3rhC+f1/k4nGueazJNOMNCCvuuMor JPEjj8UTez5xov0EAigwXAeh/e/B/TUt0DBlUBfdnAwVeuS4JLG28Y5upGdJHKRaII bZodRluE9DP9doGGzkEdN69+NtS2zpDVtHbpP55Y= Date: Fri, 16 Oct 2020 13:51:12 -0700 From: akpm@linux-foundation.org To: anton@ozlabs.org, ardb@kernel.org, benh@kernel.crashing.org, bhe@redhat.com, boris.ostrovsky@oracle.com, borntraeger@de.ibm.com, dan.j.williams@intel.com, dave.jiang@intel.com, david@redhat.com, ebiederm@xmission.com, gor@linux.ibm.com, gregkh@linuxfoundation.org, haiyangz@microsoft.com, hca@linux.ibm.com, jasowang@redhat.com, jgg@ziepe.ca, jgross@suse.com, julien@xen.org, keescook@chromium.org, kernelfans@gmail.com, kys@microsoft.com, lenb@kernel.org, leobras.c@gmail.com, lpechacek@suse.cz, mhocko@suse.com, mm-commits@vger.kernel.org, mpe@ellerman.id.au, mst@redhat.com, nathanl@linux.ibm.com, oohall@gmail.com, pankaj.gupta.linux@gmail.com, paulus@samba.org, richardw.yang@linux.intel.com, rjw@rjwysocki.net, roger.pau@citrix.com, sstabellini@kernel.org, sthemmin@microsoft.com, tglx@linutronix.de, vishal.l.verma@intel.com, wei.liu@kernel.org Subject: [merged] virtio-mem-try-to-merge-system-ram-resources.patch removed from -mm tree Message-ID: <20201016205112.yBUlRjj6e%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: virtio-mem: try to merge system ram resources has been removed from the -mm tree. Its filename was virtio-mem-try-to-merge-system-ram-resources.patch This patch was dropped because it was merged into mainline or a subsystem t= ree ------------------------------------------------------ =46rom: David Hildenbrand Subject: virtio-mem: try to merge system ram resources virtio-mem adds memory in memory block granularity, to be able to remove it in the same granularity again later, and to grow slowly on demand.=20 This, however, results in quite a lot of resources when adding a lot of memory. Resources are effectively stored in a list-based tree. Having a lot of resources not only wastes memory, it also makes traversing that tree more expensive, and makes /proc/iomem explode in size (e.g., requiring kexec-tools to manually merge resources later when e.g., trying to create a kdump header). Before this patch, we get (/proc/iomem) when hotplugging 2G via virtio-mem on x86-64: [...] 100000000-13fffffff : System RAM 140000000-33fffffff : virtio0 140000000-147ffffff : System RAM (virtio_mem) 148000000-14fffffff : System RAM (virtio_mem) 150000000-157ffffff : System RAM (virtio_mem) 158000000-15fffffff : System RAM (virtio_mem) 160000000-167ffffff : System RAM (virtio_mem) 168000000-16fffffff : System RAM (virtio_mem) 170000000-177ffffff : System RAM (virtio_mem) 178000000-17fffffff : System RAM (virtio_mem) 180000000-187ffffff : System RAM (virtio_mem) 188000000-18fffffff : System RAM (virtio_mem) 190000000-197ffffff : System RAM (virtio_mem) 198000000-19fffffff : System RAM (virtio_mem) 1a0000000-1a7ffffff : System RAM (virtio_mem) 1a8000000-1afffffff : System RAM (virtio_mem) 1b0000000-1b7ffffff : System RAM (virtio_mem) 1b8000000-1bfffffff : System RAM (virtio_mem) 3280000000-32ffffffff : PCI Bus 0000:00 With this patch, we get (/proc/iomem): [...] fffc0000-ffffffff : Reserved 100000000-13fffffff : System RAM 140000000-33fffffff : virtio0 140000000-1bfffffff : System RAM (virtio_mem) 3280000000-32ffffffff : PCI Bus 0000:00 Of course, with more hotplugged memory, it gets worse. When unplugging memory blocks again, try_remove_memory() (via offline_and_remove_memory()) will properly split the resource up again. Link: https://lkml.kernel.org/r/20200911103459.10306-7-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Pankaj Gupta Cc: Michal Hocko Cc: Dan Williams Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Baoquan He Cc: Wei Yang Cc: Anton Blanchard Cc: Ard Biesheuvel Cc: Benjamin Herrenschmidt Cc: Boris Ostrovsky Cc: Christian Borntraeger Cc: Dave Jiang Cc: Eric Biederman Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Heiko Carstens Cc: Jason Gunthorpe Cc: Juergen Gross Cc: Julien Grall Cc: Kees Cook Cc: "K. Y. Srinivasan" Cc: Len Brown Cc: Leonardo Bras Cc: Libor Pechacek Cc: Michael Ellerman Cc: Nathan Lynch Cc: "Oliver O'Halloran" Cc: Paul Mackerras Cc: Pingfan Liu Cc: "Rafael J. Wysocki" Cc: Roger Pau Monn=C3=A9 Cc: Stefano Stabellini Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vishal Verma Cc: Wei Liu Signed-off-by: Andrew Morton --- drivers/virtio/virtio_mem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/virtio/virtio_mem.c~virtio-mem-try-to-merge-system-ram-resour= ces +++ a/drivers/virtio/virtio_mem.c @@ -424,7 +424,8 @@ static int virtio_mem_mb_add(struct virt =20 dev_dbg(&vm->vdev->dev, "adding memory block: %lu\n", mb_id); return add_memory_driver_managed(nid, addr, memory_block_size_bytes(), - vm->resource_name, MHP_NONE); + vm->resource_name, + MEMHP_MERGE_RESOURCE); } =20 /* _ Patches currently in -mm which might be from david@redhat.com are