Re: Extended paging bug in Athlon affect FreeBSD?

2002-01-21 Thread Terry Lambert

Raman Ng wrote:
 I don't know what mailing list this mail should be
 posted to, sorry if it is posted to the wrong mailing
 list.
 
 Recently I found Linux 2.4 kernel is affected by the
 bug of extended paging in AMD Athlon through the
 following link.  I don't know if FreeBSD is also
 affected.
 
 http://linuxtoday.com/news_story.php3?ltsn=2002-01-21-001-20-NW-KN

I am well aware of this bug.

It does not affect FreeBSD, which only uses 4M pages for
the first 4M of the kernel itself.

I've worked on code that enables 4M pages on other memory
used in FreeBSD, that had this problem, but only if you
were really stupid in your allocation mechanism.

There's a workaround for this problem which is fairly
trivial to implement in software, and should probably be
done when 4M pages are enabled, if you are using an Athlon,
and are adding 4M pages.  The problem didn't bite my own
application, since I knew about it and used the TLBs in a
very specific way to get around the problem, but I'm told
that after I left the company, someone went in and used
them a different way, not knowing about the problem or the
workaround, and broke things.  This resulted in about a
14% performance loss.

If you are doing heavy networking on a machine with a lot
of memory, it's reasonable to move your mbufs into 4M pages,
which nets you a 4-14% improvement (depending on whether or
not you also change your allocator: 14% if you do).  If you
do that, knowing how to work around the problem nets you a
pretty big win in overall performance, for about 6-10 more
machine instructions at startup time.  8-).

In any case, this will not be a problem for FreeBSD, and is
only a problem for Linux because of the strange way they
initialize things.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Extended paging bug in Athlon affect FreeBSD?

2002-01-21 Thread Raman Ng

 I am well aware of this bug.
 
 It does not affect FreeBSD, which only uses 4M pages
 for
 the first 4M of the kernel itself.
 
 I've worked on code that enables 4M pages on other
 memory
 used in FreeBSD, that had this problem, but only if
 you
 were really stupid in your allocation mechanism.
 
 There's a workaround for this problem which is
 fairly
 trivial to implement in software, and should
 probably be
 done when 4M pages are enabled, if you are using an
 Athlon,
 and are adding 4M pages.  The problem didn't bite my
 own
 application, since I knew about it and used the TLBs
 in a
 very specific way to get around the problem, but I'm
 told
 that after I left the company, someone went in and
 used
 them a different way, not knowing about the problem
 or the
 workaround, and broke things.  This resulted in
 about a
 14% performance loss.
 
 If you are doing heavy networking on a machine with
 a lot
 of memory, it's reasonable to move your mbufs into
 4M pages,
 which nets you a 4-14% improvement (depending on
 whether or
 not you also change your allocator: 14% if you do). 
 If you
 do that, knowing how to work around the problem nets
 you a
 pretty big win in overall performance, for about
 6-10 more
 machine instructions at startup time.  8-).
 
 In any case, this will not be a problem for FreeBSD,
 and is
 only a problem for Linux because of the strange way
 they
 initialize things.
 
 -- Terry

Glad to know FreeBSD is not affected.  Thanks a lot.

Cheers,
Raman

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message