FreeBSD Bugzilla – Attachment 192075 Details for
Bug 227116
CURRENT doesn't boot with integer divide fault in uma_startup_count
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add a case for a situation when zsize fits into slab space, but not after an alignment correction #2
uma.diff (text/plain), 1.49 KB, created by
Gleb Smirnoff
on 2018-04-01 19:59:46 UTC
(
hide
)
Description:
Add a case for a situation when zsize fits into slab space, but not after an alignment correction #2
Filename:
MIME Type:
Creator:
Gleb Smirnoff
Created:
2018-04-01 19:59:46 UTC
Size:
1.49 KB
patch
obsolete
>Index: uma_core.c >=================================================================== >--- uma_core.c (revision 331844) >+++ uma_core.c (working copy) >@@ -1290,7 +1290,14 @@ keg_small_init(uma_keg_t keg) > else > shsize = sizeof(struct uma_slab); > >- keg->uk_ipers = (slabsize - shsize) / rsize; >+ if (rsize > slabsize - shsize) { >+ /* Handle special case when we have 1 item per slab, so >+ * alignment requirement can be relaxed. */ >+ KASSERT(keg->uk_size <= slabsize - shsize, >+ ("%s: size %u greater than slab", __func__, keg->uk_size)); >+ keg->uk_ipers = 1; >+ } else >+ keg->uk_ipers = (slabsize - shsize) / rsize; > KASSERT(keg->uk_ipers > 0 && keg->uk_ipers <= SLAB_SETSIZE, > ("%s: keg->uk_ipers %u", __func__, keg->uk_ipers)); > >@@ -1473,7 +1480,7 @@ keg_ctor(void *mem, int size, void *udata, int fla > if (keg->uk_flags & UMA_ZONE_CACHESPREAD) { > keg_cachespread_init(keg); > } else { >- if (keg->uk_size > (UMA_SLAB_SIZE - sizeof(struct uma_slab))) >+ if (keg->uk_size > UMA_SLAB_SPACE) > keg_large_init(keg); > else > keg_small_init(keg); >@@ -1820,9 +1827,11 @@ uma_startup_count(int vm_zones) > #endif > > /* Memory for the rest of startup zones, UMA and VM, ... */ >- if (zsize > UMA_SLAB_SIZE) >+ if (zsize > UMA_SLAB_SPACE) > pages += (zones + vm_zones) * > howmany(roundup2(zsize, UMA_BOOT_ALIGN), UMA_SLAB_SIZE); >+ else if (roundup2(zsize, UMA_BOOT_ALIGN) > UMA_SLAB_SPACE) >+ pages += zones; > else > pages += howmany(zones, > UMA_SLAB_SPACE / roundup2(zsize, UMA_BOOT_ALIGN));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 227116
:
191980
|
191983
|
192014
|
192015
|
192017
| 192075 |
192077