Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jul 2012 07:44:14 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar <marcel@freebsd.org>, src-committers@freebsd.org
Subject:   Re: svn commit: r238172 - head/sys/dev/agp
Message-ID:  <2B1DDEF4-A048-45BD-9A7A-8CB148282475@xcllnt.net>
In-Reply-To: <20120707083535.GR2338@deviant.kiev.zoral.com.ua>
References:  <201207061557.q66Fv45N069464@svn.freebsd.org> <20120706181213.GI2338@deviant.kiev.zoral.com.ua> <CCAB16B3-975C-4E0A-A7D5-26309D155C59@xcllnt.net> <20120707083535.GR2338@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

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

> On Fri, Jul 06, 2012 at 06:11:56PM -0700, Marcel Moolenaar wrote:
>>=20
>> On Jul 6, 2012, at 11:12 AM, Konstantin Belousov wrote:
>>=20
>>>> 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.
>>=20
>> The commit log states it all, including how one can arguably call the =
change
>> wrong. What exactly is confusing?
>=20
> 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?

--=20
Marcel Moolenaar
marcel@xcllnt.net





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2B1DDEF4-A048-45BD-9A7A-8CB148282475>