svn commit: r238172 - head/sys/dev/agp

Marcel Moolenaar marcel at xcllnt.net
Sat Jul 7 14:44:21 UTC 2012


On Jul 7, 2012, at 1:35 AM, Konstantin Belousov wrote:

> On Fri, Jul 06, 2012 at 06:11:56PM -0700, Marcel Moolenaar wrote:
>> 
>> On Jul 6, 2012, at 11:12 AM, Konstantin Belousov wrote:
>> 
>>>> agp_i810.c:
>>>> While arguably the use of Maxmem can be considered correct, replace its use
>>>> with realmem anyway. agp_i810.c is specific to amd64, i386 & pc98, which
>>>> have a dense physical memory layout. Avoiding Maxmem here is done with an
>>>> eye on copy-n-paste behaviour in general and to avoid confusion caused by
>>>> using realmem in agp.c and Maxmem in agp_i810.c.
>>> The agp_i810.c use is to prevent attachment when largest physical address
>>> of populated memory exceeds GPU limits established by PTE format and
>>> chipset errata. Editing Maxmem to be spelled as realmem seems to change
>>> nothing right now, but I do argue that this is wrong, and commit message
>>> makes future archeology quite confusing.
>> 
>> The commit log states it all, including how one can arguably call the change
>> wrong. What exactly is confusing?
> 
> The realmem is supposed to report available memory on the system, and
> not the highest physical memory address.

Correct.

> Current calculation of maxmem
> as realmem is already wrong, often by 1GB on typical desktop machine,
> and I believe that it will become worse in the future.

Sure. This is also why a variable like Maxmem is confusing. If you try
to understand what it means or what it's for, you get mixed signals.
On the one hand it's made identical to realmem and on the other hand
there's comment that states that it's supposed to be the highest address.

> The platform does
> has all capacity to report non-dense layouts to OS, and OS is capable of
> supporting them already.

Yes, all platforms do.

> I remember there were already reports of some
> IBM machines which have sparce address space, making maxmem/(real realmem)
> be a factor of 2.

That's nothing. On ia64 this can be a lot worse.

> Confusing is the use of the amount of memory for decision that needs highest
> address. Commit log just restates the change made without any motivation,
> I think it is backward.


The commit log states the motivation: developers tend to copy-n-paste without
truly understanding the subtle differences and may use the Maxmem use in
agp_i810.c as the wrong precedence. Secondly, also mentioned in the commit
log, is the use of realmem in agp.c and then Maxmem in agp_i810.c which is
likely to be confusing. So the change from Maxmem to realmem in agp_i810.c
prioritizes the avoidance of confusion over pedantic correctness, which we
all know isn't achievable anyway. Since agp_i810.c is only for amd64, i386
and pc98, also stated in the commit log, and all of those have dense phys.
memory, the discrepancy is still within the margin of error.

In short: I'm not getting your comments. Do you want me to revert the change
to agp_i810.c so that we can put this to rest?

-- 
Marcel Moolenaar
marcel at xcllnt.net




More information about the svn-src-head mailing list