[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/15] mm: Drop unused unloading of modules on OOM
From: |
Daniel Axtens |
Subject: |
[PATCH v3 05/15] mm: Drop unused unloading of modules on OOM |
Date: |
Thu, 21 Apr 2022 15:24:17 +1000 |
From: Patrick Steinhardt <ps@pks.im>
In `grub_memalign ()`, there's a commented section which would allow for
unloading of unneeded modules in case where there is not enough free
memory available to satisfy a request. Given that this code is never
compiled in, let's remove it together with `grub_dl_unload_unneeded()`
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/kern/dl.c | 20 --------------------
grub-core/kern/mm.c | 8 --------
include/grub/dl.h | 1 -
3 files changed, 29 deletions(-)
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
index b1d3a103ec98..e447fd0fab4e 100644
--- a/grub-core/kern/dl.c
+++ b/grub-core/kern/dl.c
@@ -811,23 +811,3 @@ grub_dl_unload (grub_dl_t mod)
grub_free (mod);
return 1;
}
-
-/* Unload unneeded modules. */
-void
-grub_dl_unload_unneeded (void)
-{
- /* Because grub_dl_remove modifies the list of modules, this
- implementation is tricky. */
- grub_dl_t p = grub_dl_head;
-
- while (p)
- {
- if (grub_dl_unload (p))
- {
- p = grub_dl_head;
- continue;
- }
-
- p = p->next;
- }
-}
diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c
index a1f47c0616a2..41e5ea07dc5a 100644
--- a/grub-core/kern/mm.c
+++ b/grub-core/kern/mm.c
@@ -437,14 +437,6 @@ grub_memalign (grub_size_t align, grub_size_t size)
count++;
goto again;
-#if 0
- case 1:
- /* Unload unneeded modules. */
- grub_dl_unload_unneeded ();
- count++;
- goto again;
-#endif
-
default:
break;
}
diff --git a/include/grub/dl.h b/include/grub/dl.h
index d0f4115fe736..acb4d42327d7 100644
--- a/include/grub/dl.h
+++ b/include/grub/dl.h
@@ -203,7 +203,6 @@ grub_dl_t EXPORT_FUNC(grub_dl_load) (const char *name);
grub_dl_t grub_dl_load_core (void *addr, grub_size_t size);
grub_dl_t EXPORT_FUNC(grub_dl_load_core_noinit) (void *addr, grub_size_t size);
int EXPORT_FUNC(grub_dl_unload) (grub_dl_t mod);
-extern void grub_dl_unload_unneeded (void);
extern int EXPORT_FUNC(grub_dl_ref) (grub_dl_t mod);
extern int EXPORT_FUNC(grub_dl_unref) (grub_dl_t mod);
extern int EXPORT_FUNC(grub_dl_ref_count) (grub_dl_t mod);
--
2.32.0
- [PATCH v3 00/15] Dynamic allocation of memory regions and IBM vTPM v2, Daniel Axtens, 2022/04/21
- [PATCH v3 01/15] grub-shell: only pass SeaBIOS fw_opt in for x86 BIOS platforms, Daniel Axtens, 2022/04/21
- [PATCH v3 02/15] mm: assert that we preserve header vs region alignment, Daniel Axtens, 2022/04/21
- [PATCH v3 03/15] mm: when adding a region, merge with region after as well as before, Daniel Axtens, 2022/04/21
- [PATCH v3 04/15] mm: debug support for region operations, Daniel Axtens, 2022/04/21
- [PATCH v3 05/15] mm: Drop unused unloading of modules on OOM,
Daniel Axtens <=
- [PATCH v3 06/15] mm: Allow dynamically requesting additional memory regions, Daniel Axtens, 2022/04/21
- [PATCH v3 07/15] efi: mm: Always request a fixed number of pages on init, Daniel Axtens, 2022/04/21
- [PATCH v3 08/15] efi: mm: Extract function to add memory regions, Daniel Axtens, 2022/04/21
- [PATCH v3 09/15] efi: mm: Pass up errors from `add_memory_regions ()`, Daniel Axtens, 2022/04/21
- [PATCH v3 10/15] efi: mm: Implement runtime addition of pages, Daniel Axtens, 2022/04/21
- [PATCH v3 11/15] ieee1275: request memory with ibm, client-architecture-support, Daniel Axtens, 2022/04/21
- [PATCH v3 12/15] ieee1275: drop len -= 1 quirk in heap_init, Daniel Axtens, 2022/04/21
- [PATCH v3 13/15] ieee1275: support runtime memory claiming, Daniel Axtens, 2022/04/21