Thread (24 messages) 24 messages, 9 authors, 1d ago

Re: [PATCH 08/11] s390/sclp_mem: Allocate struct sclp_mem dynamically and add kobject release

flat view

From: Sumanth Korikkar <hidden>
Date: 2026-10-14 12:05:27
Also in: amd-gfx, dri-devel, driver-core, gfs2, linux-acpi, linux-doc, linux-hardening, linux-pm, linux-s390, linux-sh, lkml, llvm, xen-devel

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@google.com>
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help