|
From: | Stefan Berger |
Subject: | Re: [PATCH v4 3/6] ieee1275: support runtime memory claiming |
Date: | Mon, 6 Feb 2023 15:59:25 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 2/6/23 15:09, Robbie Harwood wrote:
Stefan Berger <stefanb@linux.ibm.com> writes:-/* The maximum heap size we're going to claim */ +/* The maximum heap size we're going to claim at boot. Not used by sparc. */ #ifdef __i386__ #define HEAP_MAX_SIZE (unsigned long) (64 * 1024 * 1024) -#else +#else /* __powerpc__ */ #define HEAP_MAX_SIZE (unsigned long) (32 * 1024 * 1024) #endifIn the version of this patch I've been carrying, the max heap is increased a good bit:#define HEAP_MAX_SIZE (unsigned long) (1 * 1024 * 1024 * 1024)Should it be made larger here as well?
HEAP_MAX_SIZE is only used here and this function is called on initialization from grub_machine_init() static void grub_claim_heap (void) { grub_err_t err; grub_uint32_t total = HEAP_MAX_SIZE; err = grub_ieee1275_total_mem (&rmo_top); /* * If we cannot size the available memory, we can't be sure we're leaving * space for the kernel, initrd and things Linux loads early in boot. So only * allow further allocations from firmware on success */ if (err == GRUB_ERR_NONE) grub_mm_add_region_fn = grub_ieee1275_mm_add_region; #if defined(__powerpc__) if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY)) { /* if we have an error, don't call CAS, just hope for the best */ if (err == GRUB_ERR_NONE && rmo_top < (512 * 1024 * 1024)) grub_ieee1275_ibm_cas (); } #endif grub_machine_mmap_iterate (heap_init, &total); } #endif This seems to only be for the *initial* heap size and doesn't matter anymore later on for ppc. This is shared code also with ieee1275 i386 ... Stefan
Full commit: https://github.com/rhboot/grub2/commit/e572ccc0edb3423976e8301978617382994ed52a Be well, --Robbie
[Prev in Thread] | Current Thread | [Next in Thread] |