FreeBSD Bugzilla – Attachment 208237 Details for
Bug 241048
After r349840, OOM reported when swap space is available.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
vm_page.c.diff (text/plain), 2.03 KB, created by
Mark Johnston
on 2019-10-11 03:01:32 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Mark Johnston
Created:
2019-10-11 03:01:32 UTC
Size:
2.03 KB
patch
obsolete
>commit e27ff405d661e94b79289203f09f53c54d7c1892 >Author: Mark Johnston <markjdb@gmail.com> >Date: Thu Oct 10 13:43:24 2019 -0400 > > Further constrain the use of per-CPU page caches. > > The calculation which determines whether or not to use UMA cache zones > is wrong in that it does not account for the fact that UMA maintains two > buckets per CPU, not one. In the worst case, both the alloc and free > buckets on a CPU may be full of unused pages. > > Also increase the amount of required RAM per CPU to enable the per-CPU > caches. With this change, on amd64 we require ~2.5GB or more RAM > per CPU to enable the caches. > > I have seen a couple of reports of unexpected OOM kills and memory > allocation failures which I believe are caused by a large number of > cached pages in systems with relatively small amounts of RAM. In > particular, uma_reclaim() does not do anything to reclaim items from > cache zones, so cached pages are effectively unreclaimable right now. > This is a bug. > > We could also use uma_zone_set_max() to set an upper limit on the number > of items cached in the zone, i.e., use a smaller maximum bucket size > instead of 256. > > However, let's first adjust the threshold since that helps alleviate the > problem and is not too risky for 12.1. > >diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c >index c361a731db9e..cbbdabd816a3 100644 >--- a/sys/vm/vm_page.c >+++ b/sys/vm/vm_page.c >@@ -220,10 +220,12 @@ vm_page_init_cache_zones(void *dummy __unused) > vmd = VM_DOMAIN(domain); > > /* >- * Don't allow the page caches to take up more than .25% of >- * memory. >+ * Don't allow the page caches to take up more than .1875% of >+ * memory. A UMA bucket contains at most 256 free pages, and we >+ * have two buckets per CPU per free pool. > */ >- if (vmd->vmd_page_count / 400 < 256 * mp_ncpus * VM_NFREEPOOL) >+ if (vmd->vmd_page_count / 600 < 2 * 256 * mp_ncpus * >+ VM_NFREEPOOL) > continue; > for (pool = 0; pool < VM_NFREEPOOL; pool++) { > pgcache = &vmd->vmd_pgcache[pool];
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 241048
:
208104
|
208105
|
208118
| 208237 |
208276
|
208284