aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/resource.c41
1 files changed, 8 insertions, 33 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index 9c08d6e9eef2..34eaee179689 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -56,14 +56,6 @@ struct resource_constraint {
static DEFINE_RWLOCK(resource_lock);
-/*
- * For memory hotplug, there is no way to free resource entries allocated
- * by boot mem after the system is up. So for reusing the resource entry
- * we need to remember the resource.
- */
-static struct resource *bootmem_resource_free;
-static DEFINE_SPINLOCK(bootmem_resource_lock);
-
static struct resource *next_resource(struct resource *p)
{
if (p->child)
@@ -160,36 +152,19 @@ __initcall(ioresources_init);
static void free_resource(struct resource *res)
{
- if (!res)
- return;
-
- if (!PageSlab(virt_to_head_page(res))) {
- spin_lock(&bootmem_resource_lock);
- res->sibling = bootmem_resource_free;
- bootmem_resource_free = res;
- spin_unlock(&bootmem_resource_lock);
- } else {
+ /**
+ * If the resource was allocated using memblock early during boot
+ * we'll leak it here: we can only return full pages back to the
+ * buddy and trying to be smart and reusing them eventually in
+ * alloc_resource() overcomplicates resource handling.
+ */
+ if (res && PageSlab(virt_to_head_page(res)))
kfree(res);
- }
}
static struct resource *alloc_resource(gfp_t flags)
{
- struct resource *res = NULL;
-
- spin_lock(&bootmem_resource_lock);
- if (bootmem_resource_free) {
- res = bootmem_resource_free;
- bootmem_resource_free = res->sibling;
- }
- spin_unlock(&bootmem_resource_lock);
-
- if (res)
- memset(res, 0, sizeof(struct resource));
- else
- res = kzalloc(sizeof(struct resource), flags);
-
- return res;
+ return kzalloc(sizeof(struct resource), flags);
}
/* Return the conflict entry if you can't request it */
a>Saleemkhan Jamadar3-1/+658 2023-08-31drm/amdgpu: add VCN4 ip block supportSaleemkhan Jamadar3-0/+1815 2023-08-31drm/amdgpu: add vcn 4_0_5 header filesSaleemkhan Jamadar2-0/+10411 2023-08-31drm/amdgpu: fix VPE front door loading issueLang Yu6-0/+63 2023-08-31drm/amdgpu: add VPE FW version query supportLang Yu2-0/+14 2023-08-31drm/amdgpu: enable VPE for VPE 6.1.0Lang Yu1-0/+19 2023-08-31drm/amdgpu: add user space CS support for VPELang Yu3-0/+9 2023-08-31drm/amdgpu: add PSP loading support for VPELang Yu2-0/+28 2023-08-31drm/amdgpu: add VPE 6.1.0 supportLang Yu6-0/+1019 2023-08-31drm/amdgpu: add nbio 7.11 callback for VPELang Yu1-0/+24 2023-08-31drm/amdgpu: add nbio callback for VPELang Yu1-0/+2 2023-08-31drm/amdgpu: add PSP FW TYPE for VPELang Yu2-0/+8 2023-08-31drm/amdgpu: add UCODE ID for VPELang Yu1-0/+2 2023-08-31drm/amdgpu: add support for VPE firmware name decodingLang Yu1-0/+3 2023-08-31drm/amdgpu: add doorbell index for VPELang Yu2-2/+6