[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/11] s390/sclp_mem: Allocate struct sclp_mem dynamically and add kobject release
- To: Ian Rogers <irogers@xxxxxxxxxx>
- From: Sumanth Korikkar <sumanthk@xxxxxxxxxxxxx>
- Date: Wed, 14 Oct 2026 14:04:44 +0200
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=pp1 header.d=ibm.com header.i="@ibm.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
- Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, "Rafael J . Wysocki" <rafael@xxxxxxxxxx>, Danilo Krummrich <dakr@xxxxxxxxxx>, Miguel Ojeda <ojeda@xxxxxxxxxx>, Kees Cook <kees@xxxxxxxxxx>, Nathan Chancellor <nathan@xxxxxxxxxx>, Nick Desaulniers <ndesaulniers@xxxxxxxxxx>, Bill Wendling <morbo@xxxxxxxxxx>, Justin Stitt <justinstitt@xxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Madhavan Srinivasan <maddy@xxxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Christophe Leroy <chleroy@xxxxxxxxxx>, Nayna Jain <nayna@xxxxxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Rich Felker <dalias@xxxxxxxx>, John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx>, Viresh Kumar <viresh.kumar@xxxxxxxxxx>, David Teigland <teigland@xxxxxxxxxx>, Alexander Aring <aahringo@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Heiko Carstens <hca@xxxxxxxxxxxxx>, Vasily Gorbik <gor@xxxxxxxxxxxxx>, Alexander Gordeev <agordeev@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Sven Schnelle <svens@xxxxxxxxxxxxx>, Richard Weinberger <richard@xxxxxx>, Zhihao Cheng <chengzhihao1@xxxxxxxxxx>, Felix Kuehling <Felix.Kuehling@xxxxxxx>, Alex Deucher <alexander.deucher@xxxxxxx>, Christian König <christian.koenig@xxxxxxx>, driver-core@xxxxxxxxxxxxxxx, llvm@xxxxxxxxxxxxxxx, linux-hardening@xxxxxxxxxxxxxxx, linux-doc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx, gfs2@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, amd-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- Delivery-date: Thu, 15 Oct 2026 12:07:12 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Oct 13, 2026 at 03:39:43PM -0700, Ian Rogers wrote:
> sclp_init_mem() allocated a single array of struct sclp_mem with
> kzalloc_objs() and registered each embedded kobject using a kobj_type
> without a .release callback. Allocate each struct sclp_mem individually
> with kzalloc_obj() instead and add sclp_mem_release() to free it.
>
> Fixes: ff18dcb19aab ("s390/sclp: Add support for dynamic (de)configuration of
> memory")
> Assisted-by: Antigravity:gemini-3.1-pro
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
Hi Ian,
The entries under /sys/firmware/memory/memoryX in sclp_mem.c are
permanent. They are backed by a single array allocated at boot and
remain for the lifetime of the system.
Memory hotplug can add or remove memory blocks under
/sys/devices/system/memory/, but it does not remove these firmware
entries. The /sys/firmware/memory/memoryX kobjects are never
unregistered or freed, so I think there is no need for
kobject_put() and no execution of a .release callback.
Instead, could this follow the approach used in Patch 11 of this series?
static const struct kobj_type ktype = {
.release = NULL, /* Permanent firmware kobjects, never freed */
.sysfs_ops = &kobj_sysfs_ops,
};
Thank you
|