RE: Re: [PATCH v4 6/6] RISC-V: Free-up initrd in free_initrd_mem()

From: CHANDAN VN
Date: Thu Feb 14 2019 - 00:00:41 EST


Hi,

> OnÂWed,ÂFebÂ13,Â2019ÂatÂ09:54:15AMÂ-0800,ÂChristophÂHellwigÂwrote:
> >ÂOnÂWed,ÂFebÂ13,Â2019ÂatÂ09:38:36AMÂ+0200,ÂMikeÂRapoportÂwrote:
> >Â>Âmemblock_free()ÂisÂhasÂnoÂrealÂeffectÂatÂthisÂpoint,ÂnoÂideaÂwhyÂarm64
> >Â>ÂcallsÂit.
>
> >ÂLooksÂlikeÂtheÂcallÂwasÂaddedÂfairlyÂrecentlyÂby:
>
> >ÂcommitÂ05c58752f9dce11e396676eb731a620541590ed0
> >ÂAuthor:ÂCHANDANÂVNÂ<chandan.vn@xxxxxxxxxxx>
> >ÂDate:ÂÂÂMonÂAprÂ30Â09:50:18Â2018Â+0530
>
> >ÂÂÂÂÂarm64:ÂToÂremoveÂinitrdÂreservedÂareaÂentryÂfromÂmemblock
>
> >ÂwhichÂclaimsÂitÂisÂtoÂworkÂaroundÂtheÂinitrdÂbeingÂdisplayedÂin
> >Â/sys/kernel/debug/memblock/reserved.
>
> >ÂIÂreallyÂthinkÂweÂneedÂtoÂhaveÂcommonÂbehaviorÂthereÂ-ÂeitherÂdoÂthis
> >ÂforÂallÂarchitecturesÂorÂnone.ÂÂI'veÂjustÂsentÂaÂseriesÂthat
> >ÂconsolidatesÂallÂbutÂaÂhandfulÂofÂtheÂfree_initrd_mem,ÂsoÂimplementing
> >ÂanyÂcommonÂbehaviorÂonÂtopÂofÂthatÂwouldÂbeÂgood.
>Â
> I'veÂjustÂstartedÂtoÂlookÂintoÂitÂtodayÂ:)
> I'llÂreplyÂonÂthatÂthread.

INITRD reserved area entry is not removed from memblock
even though initrd reserved area is freed. The same can be
checked from /sys/kernel/debug/memblock/reserved.
We did not face this issue on arm32 architecture.
Though the changes which i had submitted does not fix any memory leak,
it does make sure that the entries freed from memblock are actually removed
from the sys entry as well.
Also the implementation of arm64 is quite different from arm32. I feel a generic
implementation can be taken up only if its a real necessity.