From patchwork Fri Oct 25 14:14:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13850768 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0B48D0C614 for ; Fri, 25 Oct 2024 14:16:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5A4036B00A1; Fri, 25 Oct 2024 10:16:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 554BA6B00A2; Fri, 25 Oct 2024 10:16:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41C976B00A3; Fri, 25 Oct 2024 10:16:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 237C46B00A1 for ; Fri, 25 Oct 2024 10:16:00 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D95ECC0B20 for ; Fri, 25 Oct 2024 14:15:38 +0000 (UTC) X-FDA: 82712322840.27.1C6B5D3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf04.hostedemail.com (Postfix) with ESMTP id F28DC40013 for ; Fri, 25 Oct 2024 14:15:32 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Cpy55fY5; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729865588; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=minQPvjcAw7BmTU59AI15v5UYV4aItz4WqTTQMtatbA=; b=XSJdBegygZq3dTMTL6ugrGRt3fSiBzOHtsbDeSh9g69a15deRicE6VKzKAOm85I9We5MKB 67s3O4nXw2pzRWNC904k0YxMhxegiprQMjGhKI+L4CDawbi1L3FqqfDxaEyHC3bXh+XXp+ Ch0jLYuETczxxN95v/AJBLAMJNX+sG0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729865588; a=rsa-sha256; cv=none; b=n8AFzC0bo6AAGraiS5xgk5w+K0M6gp/qC6cPu4P9qtVwZTIKY827xRCHuImseXpAc0Blxb 8ww+Cxpx/+BAIixf+UcaNK+uwH+hXj86VVX4iwgyhi4Dojsox/7sK3DeSAjVSDwT23b3tI 2vfvgzTieMoBB35q5Jet5L/NGT5riLY= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Cpy55fY5; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729865757; 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=minQPvjcAw7BmTU59AI15v5UYV4aItz4WqTTQMtatbA=; b=Cpy55fY5LI2w/vkgUGLC2Yg9qDCeAoy6mlb6SiIYbrtEy6pIIAeEsniwQPQnhqmozs2zlB ih4L2iSoMpHR07vKdGw60oxI52JI2yyeRYIiUX6zplGKR/jub0v5ERXm66/jHbQ0L53YHX y16COZyQ1BuMHzA2dfL5Bw/o6uWqoU8= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-604-cIntWAoSP6e3AMrL0U5dWA-1; Fri, 25 Oct 2024 10:15:54 -0400 X-MC-Unique: cIntWAoSP6e3AMrL0U5dWA-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8804419560B5; Fri, 25 Oct 2024 14:15:50 +0000 (UTC) Received: from t14s.redhat.com (unknown [10.22.65.27]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2754819560A2; Fri, 25 Oct 2024 14:15:42 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-s390@vger.kernel.org, virtualization@lists.linux.dev, linux-doc@vger.kernel.org, kvm@vger.kernel.org, David Hildenbrand , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Huth , Cornelia Huck , Janosch Frank , Claudio Imbrenda , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?utf-8?q?Eugenio_P=C3=A9rez?= , Eric Farman , Andrew Morton , Jonathan Corbet , Mario Casquero Subject: [PATCH v3 6/7] s390/sparsemem: reduce section size to 128 MiB Date: Fri, 25 Oct 2024 16:14:51 +0200 Message-ID: <20241025141453.1210600-7-david@redhat.com> In-Reply-To: <20241025141453.1210600-1-david@redhat.com> References: <20241025141453.1210600-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: F28DC40013 X-Stat-Signature: khmfoanq8drbwk7r4qtxqmwuaxjq4fg7 X-Rspam-User: X-HE-Tag: 1729865732-34010 X-HE-Meta: U2FsdGVkX1+v34OJkdgMxxI0hJXKuiQSt6DtV5D0KZK3tuyfdc1TMR9FZ1kv66qWrGIk1kjhmAZJY529IEeZ8Hiszxpk0LFrrqBWRSf187H0O3EXtpd1FaIGTiykuEE+ZFx3AA2bprxLOAb+L2truVt4rbd8QPp7X+Lx3ZTDC+bxlE2BVyokRc2LPZHMee1f93R63HsB/oXvGmUQm+5GhzOCrj41H4Uhvi8+y2LHLzXHQfIa3shEm86w5QMC6e+WebDKpgeCYmE7WS8xYSo3Rvf3afBRJJ0uOhhiURFMtNEQbrblRyrSYuGbyk4/3QvrPVrfY799zwqzsFMLtSD+4TOuiJzFS4QW8YqDa3uFxdLy+MCNHYyTdkHbkEOb8WdZzyb2ulhlPM1sa5FamEr/yV1ofJXlQ6fg1kpAti0fY9awIAy2iffCvT0ugLgo0G/APH9reVfUB2qoOv1nYyZx98ZEQm34mbVzdKzPPBpiAoUeNK1vCPl7/EdxjadNA0rBVrdAbv+wNZmtHbbItJD0VZ+FxGWZwqvkFA3tOkm07W9YPk4Kef0jtmBv9oiH8jl84rPLZRofu29reZN7Q4wQId+eOUkAQEm/kmZRW0YjOpECdL5/89XP829KhZY5MJRtE3nFSDEfIx1pqq3d61g5XRettX4Lu0tAYSl1fymn5nkv9K9PsJ6xE82kyjMEpnrW6Ktu6pwPyD+mGbvn1ZWAGHoE+wkWWqGa18ykqfxyz7ZelDlPKJowuEhFsJtIsci3VQkv7dqKdptQOHnf/EyUmweKS+V4R/lHKmvfDkUNcvjza7h/HwbVFPTNz0288May4e5BEwRZc7QyJKY0fgLhsCtiRCIptVQwjdQX9Q9OtF3t6JC8U181nchoMtdOOD0t3h1gixeKYtO0SPBvTD2AoGh58Pj54eo0Xn0EyDkPfsWq5ak+RJ+MDCYEuB9ooRulJa2WgCVn76QfKgfOMQ5 +/9R/12G LkjiJP/gW/Tpe655iTDNLkVrsnzCZBKOtlYGm6mmuTLXLXUS0DaCz6N5dAwj3VdvQJxyukPJZyTf/4i9/jh1LOxziALCdQej6vI6qs1+o/lv+k7MkhKDHF4GOw9NUKraamL+4D0AjCVOc/Nv7QFsj3Gc7IciUxI4jH7W0FKA15BqqCZX1BV6uNgFecO8bxAbZIpP5JiRklcZJfo4UvjWcfmbqRhLNE11BVaXXrjdKhJQVBAWa1kn5KXMupmz0DKdxVvm/jiPL28MdDk+vbHqVIxVLvfpWW1pmFIfWqmjM7OarVMGbcQkuuag58GV51ODmKlV6omyw7F+3SvoXqfncfbmQefUnPPPceP5v 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: List-Subscribe: List-Unsubscribe: Ever since commit 421c175c4d609 ("[S390] Add support for memory hot-add.") we've been using a section size of 256 MiB on s390 and 32 MiB on s390. Before that, we were using a section size of 32 MiB on both architectures. Now that we have a new mechanism to expose additional memory to a VM -- virtio-mem -- reduce the section size to 128 MiB to allow for more flexibility and reduce the metadata overhead when dealing with hot(un)plug granularity smaller than 256 MiB. 128 MiB has been used by x86-64 since the very beginning. arm64 with 4k base pages switched to 128 MiB as well: it's just big enough on these architectures to allows for using a huge page (2 MiB) in the vmemmap in sane setups with sizeof(struct page) == 64 bytes and a huge page mapping in the direct mapping, while still allowing for small hot(un)plug granularity. For s390, we could even switch to a 64 MiB section size, as our huge page size is 1 MiB: but the smaller the section size, the more sections we'll have to manage especially on bigger machines. Making it consistent with x86-64 and arm64 feels like the right thing for now. Note that the smallest memory hot(un)plug granularity is also limited by the memory block size, determined by extracting the memory increment size from SCLP. Under QEMU/KVM, implementing virtio-mem, we expose 0; therefore, we'll end up with a memory block size of 128 MiB with a 128 MiB section size. Tested-by: Mario Casquero Acked-by: Heiko Carstens Signed-off-by: David Hildenbrand --- arch/s390/include/asm/sparsemem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/include/asm/sparsemem.h b/arch/s390/include/asm/sparsemem.h index c549893602ea..ff628c50afac 100644 --- a/arch/s390/include/asm/sparsemem.h +++ b/arch/s390/include/asm/sparsemem.h @@ -2,7 +2,7 @@ #ifndef _ASM_S390_SPARSEMEM_H #define _ASM_S390_SPARSEMEM_H -#define SECTION_SIZE_BITS 28 +#define SECTION_SIZE_BITS 27 #define MAX_PHYSMEM_BITS CONFIG_MAX_PHYSMEM_BITS #endif /* _ASM_S390_SPARSEMEM_H */