Page MenuHomeFreeBSD

Sync up i386's pmap_enter() with amd64's
ClosedPublic

Authored by alc on Jul 8 2018, 11:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 29, 2:54 AM
Unknown Object (File)
Dec 30 2023, 2:11 PM
Unknown Object (File)
Dec 20 2023, 1:21 AM
Unknown Object (File)
Sep 29 2023, 9:44 PM
Unknown Object (File)
Sep 2 2023, 2:34 PM
Unknown Object (File)
Aug 2 2023, 6:07 PM
Unknown Object (File)
Jul 27 2023, 11:33 AM
Unknown Object (File)
Jul 15 2023, 10:06 PM
Subscribers

Details

Summary

Eliminate inconsequential differences between i386's pmap_enter() and amd64's. For example, fully construct the new PTE before entering the critical section. This change is a stepping stone to psind == 1 support.

Test Plan

Ask Peter for help. :-)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

You can easily see the differences with diff -u amd64/amd64/pmap.c i386/i386/pmap.c.

Peter, could you please test this patch?

If nothing else. the new version is 96 bytes smaller.

Before:

# size /local/obj/freebsd/base/head/i386.i386/sys/GENERIC-NODEBUG/pmap.o
   text   data   bss     dec      hex   filename
  40523   1020   408   41951   0xa3df   /local/obj/freebsd/base/head/i386.i386/sys/GENERIC-NODEBUG/pmap.o

After:

# size /local/obj/freebsd/base/head/i386.i386/sys/GENERIC-NODEBUG/pmap.o 
   text   data   bss     dec      hex   filename
  40427   1020   408   41855   0xa37f   /local/obj/freebsd/base/head/i386.i386/sys/GENERIC-NODEBUG/pmap.o
In D16188#343237, @alc wrote:

Peter, could you please test this patch?

Sure.

This revision is now accepted and ready to land.Jul 9 2018, 3:10 PM

FWIW, I started working on pmap_enter(psind = 1) for arm64 in the background. Had you already started working on that?

FWIW, I started working on pmap_enter(psind = 1) for arm64 in the background. Had you already started working on that?

No, I have not. Go for it.

I ran all of the stress2 tests on i386. No problems seen.

FWIW, I started working on pmap_enter(psind = 1) for arm64 in the background. Had you already started working on that?

FYI, on amd64, over the course of a buildworld, a few 2MB regions within the code segment of clang will be promoted to superpages. Essentially, I/O clustering on page faults, fills out theses superpages even if we don't execute instructions from each of the pages. And, then, pmap_enter_object() premaps these 2MB regions as superpages on subsequent executions of clang. However, on arm64, I believe that the default layout used by the new linker is going to sabotage this, because the code segment no longer starts at a 2MB-aligned address.

This revision was automatically updated to reflect the committed changes.