On Thursday 15 February 2007 18:09, Jeff Dike wrote:
> On Thu, Feb 15, 2007 at 11:00:01AM -0500, Jason Lunz wrote:
> > Permit lvm to create logical volumes without crashing UML.
>
> Thanks, this is in my tree.

Hmm, this seems not a _correct_ fix - at least it will be buggy with high 
memory (which we could drop anyway - actually we _should_ drop it probably). 
And at a closer review other potential bugs (or at least misconceptions) 
surface.

The difference between low_pfn and pfn should be just high memory accounting - 
however also uml_reserved enters the picture, and that is bad.

>From a closer look, it seems that uml_reserved is ignored for max_low_pfn and 
considered for max_pfn - with your code, you are going to ignore it 
everywhere, while probably you should consider it everywhere (i.e. use 
totalram_pages everywhere) - if it is correct to consider it (and I believe 
the code was written to do all that for an important reason).

The following could be a suggestion, if max_low_pfn is not used between the 
old and the new moment of assignment (and it seems it is not). This is just 
an idea however:

mem_init:

-        max_low_pfn = ...
        /* this will put all low memory onto the freelists */
        totalram_pages = free_all_bootmem();
+        max_low_pfn = totalram_pages;
#ifdef CONFIG_HIGHMEM
        totalhigh_pages = highmem >> PAGE_SHIFT;
        totalram_pages += totalhigh_pages;
#endif
        num_physpages = totalram_pages;
        max_pfn = totalram_pages;

Please note that I did not spend a lot of time on this, so everything could be 
wrong. However, testing cannot help with uml_reserved handling, and this is a 
dark corner.  So things should be better understood before merging the patch.

The code is too convoluted for a brief look - drawing a picture which explains 
all those variables would help. Both for UML and for every arch...

BTW: init_bootmem is not called by us and we probably should - min_low_pfn is 
not initialized.
-- 
Inform me of my mistakes, so I can add them to my list!
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade

Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to