[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/19] mm: Drop unused unloading of modules on OOM
From: |
Daniel Axtens |
Subject: |
[PATCH 08/19] mm: Drop unused unloading of modules on OOM |
Date: |
Tue, 12 Oct 2021 18:29:57 +1100 |
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>
---
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 48f8a79073dd..a62dbeebbfe9 100644
--- a/grub-core/kern/dl.c
+++ b/grub-core/kern/dl.c
@@ -803,23 +803,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 032c8f71aed2..6038c0d0cbb2 100644
--- a/grub-core/kern/mm.c
+++ b/grub-core/kern/mm.c
@@ -377,14 +377,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 b3753c9ca262..536717776367 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.30.2
- Re: [PATCH 01/19] grub-shell: Boot PowerPC using PMU instead of CUDA for power management, (continued)
- [PATCH 04/19] mm: assert that we preserve header vs region alignment, Daniel Axtens, 2021/10/12
- [PATCH 02/19] grub-shell: pseries: don't pass fw_opt to qemu, Daniel Axtens, 2021/10/12
- [PATCH 05/19] mm: when adding a region, merge with region after as well as before, Daniel Axtens, 2021/10/12
- [PATCH 06/19] configure: properly pass through MM_DEBUG, Daniel Axtens, 2021/10/12
- [PATCH 07/19] Add memtool module with memory allocation stress-test, Daniel Axtens, 2021/10/12
- [PATCH 08/19] mm: Drop unused unloading of modules on OOM,
Daniel Axtens <=
- [PATCH 10/19] efi: mm: Always request a fixed number of pages on init, Daniel Axtens, 2021/10/12
- [PATCH 12/19] efi: mm: Pass up errors from `add_memory_regions ()`, Daniel Axtens, 2021/10/12
- [PATCH 09/19] mm: Allow dynamically requesting additional memory regions, Daniel Axtens, 2021/10/12
- [PATCH 11/19] efi: mm: Extract function to add memory regions, Daniel Axtens, 2021/10/12
- [PATCH 13/19] efi: mm: Implement runtime addition of pages, Daniel Axtens, 2021/10/12
- [PATCH 15/19] ieee1275: drop len -= 1 quirk in heap_init, Daniel Axtens, 2021/10/12
- [PATCH 14/19] ieee1275: request memory with ibm, client-architecture-support, Daniel Axtens, 2021/10/12