VirtualBox

Ignore:
Timestamp:
Jun 13, 2012 12:52:01 PM (13 years ago)
Author:
vboxsync
Message:

Runtime/r0drv/solaris: Query PG_NORELOC support for large pages.

Location:
trunk/src/VBox/Runtime/r0drv/solaris
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/initterm-r0drv-solaris.c

    r41656 r41682  
    154154            else if (max_cpuid + 1 != IPRT_SOL_NCPUS)
    155155            {
    156                 cmn_err(CE_NOTE, "rtR0InitNative: cpuset_t size mismatch! max_cpuid=%d IPRT_SOL_NCPUS=%d\n", max_cpuid, IPRT_SOL_NCPUS);
     156                cmn_err(CE_NOTE, "rtR0InitNative: cpuset_t size mismatch! max_cpuid=%d IPRT_SOL_NCPUS=%d\n", max_cpuid,
     157                        IPRT_SOL_NCPUS);
    157158                rc = VERR_NOT_SUPPORTED;
    158159                goto errorbail;
     
    163164         * Optional: Timeout hooks.
    164165         */
    165         RTR0DbgKrnlInfoQuerySymbol(g_hKrnlDbgInfo, NULL /* pszModule */, "timeout_generic", (void **)&g_pfnrtR0Sol_timeout_generic);
    166         RTR0DbgKrnlInfoQuerySymbol(g_hKrnlDbgInfo, NULL /* pszModule */, "untimeout_generic", (void **)&g_pfnrtR0Sol_untimeout_generic);
     166        RTR0DbgKrnlInfoQuerySymbol(g_hKrnlDbgInfo, NULL /* pszModule */, "timeout_generic",
     167                                   (void **)&g_pfnrtR0Sol_timeout_generic);
     168        RTR0DbgKrnlInfoQuerySymbol(g_hKrnlDbgInfo, NULL /* pszModule */, "untimeout_generic",
     169                                   (void **)&g_pfnrtR0Sol_untimeout_generic);
    167170        if ((g_pfnrtR0Sol_timeout_generic == NULL) != (g_pfnrtR0Sol_untimeout_generic == NULL))
    168171        {
     
    173176            g_pfnrtR0Sol_untimeout_generic = NULL;
    174177        }
    175         RTR0DbgKrnlInfoQuerySymbol(g_hKrnlDbgInfo, NULL /* pszModule */, "cyclic_reprogram", (void **)&g_pfnrtR0Sol_cyclic_reprogram);
     178        RTR0DbgKrnlInfoQuerySymbol(g_hKrnlDbgInfo, NULL /* pszModule */, "cyclic_reprogram",
     179                                   (void **)&g_pfnrtR0Sol_cyclic_reprogram);
     180
     181        /*
     182         * Optional: Querying page no-relocation support.
     183         */
     184        RTR0DbgKrnlInfoQuerySymbol(g_hKrnlDbgInfo, NULL /*pszModule */, "page_noreloc_supported",
     185                                   (void **)&g_pfnrtR0Sol_page_noreloc_supported);
    176186
    177187        /*
  • trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c

    r41680 r41682  
    8484static kmutex_t                 g_LargePageOffsetMtx;
    8585static u_offset_t               g_offLargePage;
     86static bool                     g_fLargePageNoReloc;
    8687
    8788
     
    291292{
    292293    /*
     294     * Check PG_NORELOC support for large pages. Using this helps prevent _1G page
     295     * fragementation on systems that support it.
     296     */
     297    static bool fPageNoRelocChecked = false;
     298    if (fPageNoRelocChecked == false)
     299    {
     300        fPageNoRelocChecked = true;
     301        g_fLargePageNoReloc = false;
     302        if (   g_pfnrtR0Sol_page_noreloc_supported
     303            && g_pfnrtR0Sol_page_noreloc_supported(cbLargePage))
     304        {
     305            g_fLargePageNoReloc = true;
     306        }
     307    }
     308
     309    /*
    293310     * Non-pageable memory reservation request for _4K pages, don't sleep.
    294311     */
     
    311328            KernelSeg.s_as = &kas;
    312329            page_t *pRootPage = page_create_va_large(&g_LargePageVnode, offPage, cbLargePage,
    313                                                      PG_EXCL, &KernelSeg, 0 /* vaddr */, NULL /* locality group */);
     330                                                     PG_EXCL | (g_fLargePageNoReloc ? PG_NORELOC : 0), &KernelSeg,
     331                                                     0 /* vaddr */,NULL /* locality group */);
    314332            if (pRootPage)
    315333            {
     
    399417            AssertRelease(pFoundPage);
    400418
    401 #if 0
    402             /*
    403              * This can only be guaranteed if PG_NORELOC is used while allocating the pages.
    404              */
    405             AssertReleaseMsg(pFoundPage == pPage,
     419            if (g_fLargePageNoReloc)
     420            {
     421                /*
     422                 * This can only be guaranteed if PG_NORELOC is used while allocating the pages.
     423                 */
     424                AssertReleaseMsg(pFoundPage == pPage,
    406425                             ("lookup failed %p:%llu returned %p, expected %p\n", &g_LargePageVnode, offPage,
    407426                              pFoundPage, pPage));
    408 #endif
     427            }
    409428
    410429            /*
  • trunk/src/VBox/Runtime/r0drv/solaris/the-solaris-kernel.h

    r40978 r41682  
    8282typedef int          (*PFNSOL_cyclic_reprogram)(cyclic_id_t id, hrtime_t expiration);
    8383typedef void         (*PFNSOL_contig_free)(void *addr, size_t size);
     84typedef int          (*PFNSOL_page_noreloc_supported)(size_t cbPageSize);
    8485
    8586/* IPRT globals. */
    86 extern bool                     g_frtSolSplSetsEIF;
    87 extern RTCPUSET                 g_rtMpSolCpuSet;
    88 extern PFNSOL_timeout_generic   g_pfnrtR0Sol_timeout_generic;
    89 extern PFNSOL_untimeout_generic g_pfnrtR0Sol_untimeout_generic;
    90 extern PFNSOL_cyclic_reprogram  g_pfnrtR0Sol_cyclic_reprogram;
    91 extern PFNSOL_contig_free       g_pfnrtR0Sol_contig_free;
    92 extern bool                     g_frtSolUseKflt;
    93 extern size_t                   g_offrtSolThreadPreempt;
    94 extern size_t                   g_offrtSolCpuPreempt;
    95 extern size_t                   g_offrtSolCpuForceKernelPreempt;
    96 extern bool                     g_frtSolInitDone;
    97 extern RTDBGKRNLINFO            g_hKrnlDbgInfo;
     87extern bool                            g_frtSolSplSetsEIF;
     88extern RTCPUSET                        g_rtMpSolCpuSet;
     89extern PFNSOL_timeout_generic          g_pfnrtR0Sol_timeout_generic;
     90extern PFNSOL_untimeout_generic        g_pfnrtR0Sol_untimeout_generic;
     91extern PFNSOL_cyclic_reprogram         g_pfnrtR0Sol_cyclic_reprogram;
     92extern PFNSOL_contig_free              g_pfnrtR0Sol_contig_free;
     93extern PFNSOL_page_noreloc_supported   g_pfnrtR0Sol_page_noreloc_supported;
     94extern size_t                          g_offrtSolThreadPreempt;
     95extern size_t                          g_offrtSolCpuPreempt;
     96extern size_t                          g_offrtSolCpuForceKernelPreempt;
     97extern bool                            g_frtSolInitDone;
     98extern RTDBGKRNLINFO                   g_hKrnlDbgInfo;
    9899
    99100/*
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette