From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Tue, 3 Jun 2014 11:47:07 -0400 To: 9fans@9fans.net Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] kernel bug Topicbox-Message-UUID: f4d62dd0-ead8-11e9-9d60-3106f5b1d025 > I think it should be > if(mapsize > (SEGMAPSIZE)) > mapsize = SEGMAPSIZE; hmm. i think this code is correct. ssegmap is a static map to handle small segments. small segments fit in ssegmap. the point must have been to avoid malloc. this test is a little more questionable > if(mapsize > (SEGMAPSIZE*PTEPERTAB)) > mapsize = (SEGMAPSIZE*PTEPERTAB); cf. the check in ibrk if(newsize > (SEGMAPSIZE*PTEPERTAB)) { qunlock(&s->lk); error(Enovmem); } i think this check is either not wrong, or more extensive rework is necessary. @anthony, do you know if this code or similar occurred in even older kernels? if there was a cap also in ibrk() then i would suspect this code was originally correct. i don't know where a history of stuff older than sources (2002) is. > Also why in the kernel they use 'struct Pte' instead of the better name Pagetable. > In many places this is very confusing because when I see Pte I think of a Pagetable Entry > where really they are speaking about a Pagetable. i would naturally think a Pte* would be an array of Pte's, i.e. a Pte table, just like an array of uchar* could be used as a table. - erik