Re: [PATCH 07/13] mm: meminit: Initialise a subset of struct pages if CONFIG_DEFERRED_STRUCT_PAGE_INIT is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 28 Apr 2015 15:37:04 +0100 Mel Gorman <mgorman@xxxxxxx> wrote:

> +/*
> + * Deferred struct page initialisation requires some early init functions that
> + * are removed before kswapd is up and running. The feature depends on memory
> + * hotplug so put the data and code required by deferred initialisation into
> + * the __meminit section where they are preserved.
> + */
> +#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
> +#define __defermem_init __meminit
> +#define __defer_init    __meminit
> +#else
> +#define __defermem_init
> +#define __defer_init __init
> +#endif

I still don't get it :(

__defermem_init:

	if (CONFIG_DEFERRED_STRUCT_PAGE_INIT) {
		if (CONFIG_MEMORY_HOTPLUG)
			retain
	} else {
		retain
	}

    but CONFIG_DEFERRED_STRUCT_PAGE_INIT depends on
    CONFIG_MEMORY_HOTPLUG, so this becomes

	if (CONFIG_DEFERRED_STRUCT_PAGE_INIT) {
		retain
	} else {
		retain
	}

    which becomes

	retain

    so why does __defermem_init exist?



__defer_init:

	if (CONFIG_DEFERRED_STRUCT_PAGE_INIT) {
		if (CONFIG_MEMORY_HOTPLUG)
			retain
	} else {
		discard
	}

    becomes

	if (CONFIG_DEFERRED_STRUCT_PAGE_INIT) {
		retain
	} else {
		discard
	}

    this one makes sense, but could be documented much more clearly!


And why does the comment refer to "and data".  There is no
__defer_initdata, etc.  Just not needed yet?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]