Re: [PATCH v2 1/2] mm/memblock: Add "reserve_mem" to reserved named memory at boot up

From: Guilherme G. Piccoli
Date: Fri Jun 07 2024 - 15:36:38 EST


Hi Steve, thanks for the patch! Some suggestions/fixes below, inline.


On 06/06/2024 12:01, Steven Rostedt wrote:
> [...]
> +
> + The format is size:align:label for example, to request
> + 12 megabytes of 4096 alignment for ramoops:
> +
> + reserver_mem=12M:4096:oops ramoops.mem_name=oops

s/reserver/reserve


> [...]
> + * reserve_mem_find_by_name - Find reserved memory region with a given name
> + * @name: The name that is attached to a reserved memory region
> + * @start: If found, holds the start address
> + * @size: If found, holds the size of the address.
> + *
> + * Returns: 1 if found or 0 if not found.
> + */
> +int reserve_mem_find_by_name(const char *name, unsigned long *start, unsigned long *size)
> +{
> + struct reserve_mem_table *map;
> + int i;
> +
> + for (i = 0; i < reserved_mem_count; i++) {
> + map = &reserved_mem_table[i];
> + if (!map->size)
> + continue;
> + if (strcmp(name, map->name) == 0) {
> + *start = map->start;
> + *size = map->size;
> + return 1;
> + }
> + }
> + return 0;
> +}
> +
An EXPORT_SYMBOL_GPL(reserve_mem_find_by_name) is needed here, or else
ramoops fails to build as module - at least it worked with this
exporting in my build of 6.10.0-rc2 =)

Cheers,


Guilherme