On Tue, Oct 03, 2023 at 10:38:09PM +0800, Yajun Deng wrote:
On 2023/10/2 19:25, David Hildenbrand wrote:Does it address all the feedback from this thread?
On 02.10.23 13:10, Mike Rapoport wrote:I already sent v5 a few days ago. Comments, please...
Absolutely agreed.Looks like the patch rather special cases MEMINIT_EARLY, although IThat 'if' breaks the invariant that __free_pages_core isAs long as we have to special-case memory hotplug, we know that we are
always called for
pages with initialized page count. Adding it may lead to
subtle bugs and
random memory corruption so we don't want to add it at the
first place.
always coming via generic_online_page() in that case. We could
either move
some logic over there, or let __free_pages_core() know what it
should do.
didn't
check throughfully other code paths.
Anyway, relying on page_count() to be correct in different ways for
different callers of __free_pages_core() does not sound right to me.