Page MenuHomeFreeBSD
Feed Advanced Search

Nov 19 2019

jeff committed rS354869: Simplify anonymous memory handling with an OBJ_ANON flag. This eliminates.
Simplify anonymous memory handling with an OBJ_ANON flag. This eliminates
Nov 19 2019, 11:19 PM
jeff added a comment to D22423: Only insert objects into a shadow list if they can later be collapsed..

That would have the advantage of doing less work for transient conditions. Rapidly forking/exiting processes. It would be hard to do the scan efficiently. But if you did a sort of ranged mark/sweep you would be able to plug all holes from a central algorithm and simplify normal operation.

Nov 19 2019, 10:06 PM
jeff added a comment to D22423: Only insert objects into a shadow list if they can later be collapsed..
In D22423#490916, @kib wrote:

This should be fine IMO.

The only purpose of the shadow_list seems to be able to call vm_object_collapse() of refcount == 1 in vm_object_deallocate(). It might be that doing more collapses in other places, or to follow the whole shadow chain on collapse, makes this location not important. Might be we can remove shadow_list altogether then.

Nov 19 2019, 9:45 PM
jeff added inline comments to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..
Nov 19 2019, 9:33 PM

Nov 18 2019

jeff accepted D22393: Revise the page cache size policy..
Nov 18 2019, 9:49 PM

Nov 17 2019

jeff updated the summary of D22423: Only insert objects into a shadow list if they can later be collapsed..
Nov 17 2019, 1:27 AM
jeff created D22423: Only insert objects into a shadow list if they can later be collapsed..
Nov 17 2019, 1:22 AM
jeff updated the diff for D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..

Address both pieces of review feedback.

Nov 17 2019, 1:22 AM
jeff updated the diff for D22186: Remove unnecessary object locking from the vnode pager..

Readd a missing lock around the vnode size.

Nov 17 2019, 1:21 AM
jeff added a comment to D22394: Update the checks in vm_page_zone_import()..

We run all of our paging threads constantly now. I would prefer not to disable creating cache buckets from pageproc unless we're in low memory situation. Even then it may be preferable to simply flush the buckets at the end of paging in that case.

Nov 17 2019, 12:08 AM
jeff accepted D22397: Widen aflags to 16 bits..
Nov 17 2019, 12:04 AM
jeff added a comment to D22218: Add exiting threads to zombie list without thread lock..

Is this obviated by:
https://github.com/freebsd/freebsd/commit/bc3ba63a7ab694b68ac9707f82dc293e8e000503

Nov 17 2019, 12:02 AM

Nov 16 2019

jeff added a comment to D22392: Fix locking in vm_reserv_reclaim_contig()..

I don't see the lock leak? again or continue both expect the lock held.

Nov 16 2019, 11:58 PM
jeff added inline comments to D22393: Revise the page cache size policy..
Nov 16 2019, 11:52 PM
jeff added a comment to D22395: Reclaim memory from UMA if the page daemon is struggling..

I am ok with this but I would definitely like to see a UMA daemon thread that handles timeouts and wss trimming proactively and regularly. Reviewing the mechanism it seems that we might need to work a little bit to limit the cost of more frequent processing but doing it regularly should make it less impactful when it does run.

Nov 16 2019, 11:35 PM
jeff added inline comments to D22396: Simplify vm_pageout_init_domain() and add a "big picture" comment..
Nov 16 2019, 11:18 PM

Nov 11 2019

jeff updated the summary of D22322: Conduct/reporting split.
Nov 11 2019, 11:40 PM
jeff created D22322: Conduct/reporting split.
Nov 11 2019, 11:38 PM

Nov 9 2019

jeff added inline comments to D22298: Record part of the owner struct thread pointer into busy_lock..
Nov 9 2019, 10:49 PM
jeff added inline comments to D22298: Record part of the owner struct thread pointer into busy_lock..
Nov 9 2019, 9:33 PM
jeff added a comment to D22298: Record part of the owner struct thread pointer into busy_lock..

I used 'tid' for debugging in the past. You can get the whole tid in. We can do somewhat more meaningful asserts with that but we'd have to deal with I/O ala BUF_KERNPROC

Nov 9 2019, 8:36 PM

Nov 4 2019

jeff added inline comments to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..
Nov 4 2019, 7:55 PM
jeff commandeered D17885: ULE scheduler: Interrupt thread natural binding to the core receiving the interrupt event is easily ignored.

Taking this over to remind myself to commit it

Nov 4 2019, 7:38 PM
jeff added a comment to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..

Are there any further comments? This passed pho testing as well as some other ad-hoc workload testing. I would like to commit soon. I have a number of smaller object lock contention reduction patches I would like to move forward with.

Nov 4 2019, 6:53 PM
jeff accepted D22234: Fix a race in release_page()..
Nov 4 2019, 6:53 PM

Oct 30 2019

jeff added inline comments to D22186: Remove unnecessary object locking from the vnode pager..
Oct 30 2019, 9:25 PM
jeff updated the summary of D22186: Remove unnecessary object locking from the vnode pager..
Oct 30 2019, 2:41 AM
jeff created D22186: Remove unnecessary object locking from the vnode pager..
Oct 30 2019, 2:39 AM

Oct 29 2019

jeff updated the diff for D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..

Handle more cases. Fix reservations limit. Other feedback.

Oct 29 2019, 9:44 PM
jeff committed rS354158: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove the TMPFS_DIRTY.
Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove the TMPFS_DIRTY
Oct 29 2019, 9:06 PM
jeff closed D22116: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove theTMPFS_DIRTY flag to simplify set_writeable_dirty()..
Oct 29 2019, 9:06 PM
jeff committed rS354157: Use atomics and a shared object lock to protect the object reference count..
Use atomics and a shared object lock to protect the object reference count.
Oct 29 2019, 8:58 PM
jeff closed D21598: Use atomics for object reference count so that we can use the shared lock to protect it..
Oct 29 2019, 8:58 PM
jeff committed rS354156: Drop the object lock earlier in fault and don't relock it after pmap_enter()..
Drop the object lock earlier in fault and don't relock it after pmap_enter().
Oct 29 2019, 8:46 PM
jeff closed D22036: Reduce the scope of the object lock in fault..
Oct 29 2019, 8:46 PM
jeff closed D21597: Drop the object lock in vfs_bio and cluster.
Oct 29 2019, 8:38 PM
jeff committed rS354155: Drop the object lock in vfs_bio and cluster where it is now safe to do so..
Drop the object lock in vfs_bio and cluster where it is now safe to do so.
Oct 29 2019, 8:38 PM

Oct 26 2019

jeff closed D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..
Oct 26 2019, 9:31 PM

Oct 24 2019

jeff added inline comments to D22116: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove theTMPFS_DIRTY flag to simplify set_writeable_dirty()..
Oct 24 2019, 7:51 PM

Oct 23 2019

jeff added a comment to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..

It is really your call Alan. I was trying to unify the flags among the various non-anonymous swap object users. We also saw with tmpfs that it performs much better with reservations enabled. I can defer this part of the patch or I can fix the above code.

Oct 23 2019, 6:22 PM
jeff added inline comments to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..
Oct 23 2019, 6:12 PM
jeff added inline comments to D22116: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove theTMPFS_DIRTY flag to simplify set_writeable_dirty()..
Oct 23 2019, 6:10 PM
jeff added inline comments to D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..
Oct 23 2019, 6:09 AM

Oct 22 2019

jeff updated the summary of D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..
Oct 22 2019, 11:16 PM
jeff created D22119: Add a constant OBJ_ANONYMOUS flag to optimize out some locking..
Oct 22 2019, 11:06 PM
jeff added a comment to D22112: Add a tunable to set the pgcache zone's maxcache.

We have run into issues with the auto-tuning here. It all needs to do better. We should be able to set max cache based on total memory. I'm not opposed to this patch as an intermediate step though.

Oct 22 2019, 10:21 PM
jeff added a comment to D22116: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove theTMPFS_DIRTY flag to simplify set_writeable_dirty()..

One last point; it would be trivial to turn generation into a timestamp so that it could be used for more precise mtime without needing periodic polling.

Oct 22 2019, 10:10 PM
jeff retitled D22116: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove theTMPFS_DIRTY flag to simplify set_writeable_dirty(). from Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove the TMPFS_DIRTY flag to simplify set_writeable_dirty(). to Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove theTMPFS_DIRTY flag to simplify set_writeable_dirty()..
Oct 22 2019, 10:08 PM
jeff created D22116: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove theTMPFS_DIRTY flag to simplify set_writeable_dirty()..
Oct 22 2019, 10:02 PM
jeff abandoned D22115: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove the TMPFS_DIRTY flag to simplify set_writeable_dirty()..
Oct 22 2019, 10:02 PM
jeff created D22115: Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove the TMPFS_DIRTY flag to simplify set_writeable_dirty()..
Oct 22 2019, 9:57 PM

Oct 21 2019

jeff added inline comments to D21597: Drop the object lock in vfs_bio and cluster.
Oct 21 2019, 11:58 PM

Oct 16 2019

jeff added inline comments to D21597: Drop the object lock in vfs_bio and cluster.
Oct 16 2019, 7:02 PM
jeff added a comment to D22056: Port D22041/r353622 to sparc64 and arm v4..

I can do arm this afternoon.

Oct 16 2019, 6:59 PM
jeff added a comment to D21597: Drop the object lock in vfs_bio and cluster.

Any comment on the MIGHTBEDIRTY check?

Oct 16 2019, 6:41 PM
jeff accepted D22056: Port D22041/r353622 to sparc64 and arm v4..

Thank you.

Oct 16 2019, 6:39 PM
jeff added a comment to D22040: Further constrain the use of per-CPU page caches..

On the other hand this means you'd need 1TB of ram to run with 256 processor cores threads which is a possible amount for a two socket system but still a somewhat unlikely amount of ram. Netflix ran into this on some of their test systems and had to disable the check.

Oct 16 2019, 6:36 PM

Oct 15 2019

jeff closed D20928: Handle stacked CPU binding..
Oct 15 2019, 6:14 PM
jeff closed D21596: (vm object 6) Convert pmap_is_modified, pmap_remove_write, and pmap_clear_modify to expecting busy to be held by the caller now that all callers hold it..
Oct 15 2019, 4:19 AM
jeff updated the summary of D22036: Reduce the scope of the object lock in fault..
Oct 15 2019, 4:07 AM
jeff created D22036: Reduce the scope of the object lock in fault..
Oct 15 2019, 4:02 AM
jeff closed D21594: (vm object 4) Wrap valid accesses in inlines. Add missing busy acquires to protect valid..
Oct 15 2019, 3:59 AM
jeff added inline comments to D21597: Drop the object lock in vfs_bio and cluster.
Oct 15 2019, 3:56 AM
jeff retitled D21597: Drop the object lock in vfs_bio and cluster from Drop the object lock where it is no longer needed. to Drop the object lock in vfs_bio and cluster.
Oct 15 2019, 3:54 AM
jeff committed rS353541: (6/6) Convert pmap to expect busy in write related operations now that all.
(6/6) Convert pmap to expect busy in write related operations now that all
Oct 15 2019, 3:52 AM
jeff closed D21595: (vm object 5) Move PGA_NOSYNC to VPA_NOSYNC so that the object lock is not required..
Oct 15 2019, 3:48 AM
jeff committed rS353540: (5/6) Move the VPO_NOSYNC to PGA_NOSYNC to eliminate the dependency on the.
(5/6) Move the VPO_NOSYNC to PGA_NOSYNC to eliminate the dependency on the
Oct 15 2019, 3:48 AM
jeff committed rS353539: (4/6) Protect page valid with the busy lock..
(4/6) Protect page valid with the busy lock.
Oct 15 2019, 3:46 AM
jeff committed rS353538: (3/6) Add a shared object busy synchronization mechanism that blocks new page.
(3/6) Add a shared object busy synchronization mechanism that blocks new page
Oct 15 2019, 3:42 AM
jeff committed rS353537: (2/6) Don't release xbusy in vm_page_remove(), defer to vm_page_free_prep()..
(2/6) Don't release xbusy in vm_page_remove(), defer to vm_page_free_prep().
Oct 15 2019, 3:38 AM
jeff closed D21549: (vm object 2) Don't release xbusy in vm_page_remove(), defer to vm_page_free_prep()..
Oct 15 2019, 3:38 AM
jeff committed rS353535: (1/6) Replace busy checks with acquires where it is trival to do so..
(1/6) Replace busy checks with acquires where it is trival to do so.
Oct 15 2019, 3:35 AM
jeff closed D21548: (vm object 1) Replace busy checks and sleeps with acquires where it is trivial to do so..
Oct 15 2019, 3:35 AM

Oct 10 2019

jeff added inline comments to D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..
Oct 10 2019, 3:32 AM

Oct 8 2019

jeff added inline comments to D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..
Oct 8 2019, 10:55 PM

Oct 6 2019

jeff added inline comments to D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..
Oct 6 2019, 9:42 PM
jeff added inline comments to D21833: amd64 pmap: retire the global lock array in favor of per-superpage locks.
Oct 6 2019, 2:46 AM

Oct 5 2019

jeff updated the diff for D21594: (vm object 4) Wrap valid accesses in inlines. Add missing busy acquires to protect valid..

Rewrote the vm_page.h locking description.

Oct 5 2019, 7:49 PM

Oct 4 2019

jeff updated the diff for D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..

Add missing barrier.

Oct 4 2019, 10:29 PM
jeff updated the diff for D21548: (vm object 1) Replace busy checks and sleeps with acquires where it is trivial to do so..

Fixed wired/busy check order.

Oct 4 2019, 10:28 PM

Sep 29 2019

jeff added inline comments to D21833: amd64 pmap: retire the global lock array in favor of per-superpage locks.
Sep 29 2019, 9:39 PM

Sep 28 2019

jeff added inline comments to D21833: amd64 pmap: retire the global lock array in favor of per-superpage locks.
Sep 28 2019, 9:50 PM

Sep 25 2019

jeff added inline comments to D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..
Sep 25 2019, 11:32 PM
jeff added a comment to D21596: (vm object 6) Convert pmap_is_modified, pmap_remove_write, and pmap_clear_modify to expecting busy to be held by the caller now that all callers hold it..
In D21596#474569, @kib wrote:

Is there any use of PGA_WRITEABLE flag left after the patch ? pmap_page_is_write_mapped() takes the pv lock, while PGA_WRITEABLE check is essentially free.

Sep 25 2019, 11:29 PM
jeff added a comment to D21594: (vm object 4) Wrap valid accesses in inlines. Add missing busy acquires to protect valid..
In D21594#474564, @kib wrote:

What do you mean by a note that pageout clears valid state of the page ? I thought that pageout laundries the page, and a clean page might be freed for reuse. In other words, valid bits can be only trimmed by truncation either of the vnode or swap backing OBJ_NOSPLIT object.

Sep 25 2019, 11:27 PM
jeff accepted D21740: lockprof: fix hangs under load when changing the state or dumping stats.
Sep 25 2019, 11:22 PM
jeff accepted D21646: vfs: add root vnode caching for mount points.
Sep 25 2019, 11:22 PM
jeff added inline comments to D21740: lockprof: fix hangs under load when changing the state or dumping stats.
Sep 25 2019, 11:21 PM

Sep 23 2019

jeff added inline comments to D21740: lockprof: fix hangs under load when changing the state or dumping stats.
Sep 23 2019, 8:21 PM

Sep 19 2019

jeff added inline comments to D21594: (vm object 4) Wrap valid accesses in inlines. Add missing busy acquires to protect valid..
Sep 19 2019, 9:35 PM
jeff added a comment to D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..
In D21592#473738, @kib wrote:
In D21592#473571, @jeff wrote:

I think I've brought this up before, but I would like it if the VM had a generic per-2MB page structure. We already have several in vm_reserv and the pmap, and IMO it would be a good place to maintain a "compound" busy state, rather than in the object. I worry that a mechanism to block the busying of all pages in an object will inhibit concurrency and lead to transient latency spikes. I don't object to the current approach though.

Right now the object lock is the mechanism that blocks busying of all pages and creates transient latency spikes. This at least narrows it a level and allows other object operations to proceed. If you had a per-superpage object you would have to be able to very quickly look it up and acquire in tryxbusy/sbusy.

Ultimately I would like to see a generic mechanism that can treat pages as groups with a single set of state. A variable page size.

But isn't vm_reserv adequate object ? psind is set to 1 iff the reserv is fully populated. Why cannot we lock vm_reserv around pmap_enter() in psind==1 case for fast_soft ?

Update: when I wrote that, I thought about locking reserv and e.g. busy the first page in the range. Incompatible manipulation of any page in the superpage would need to break the reservation. But this is not enough, indeed.

Sep 19 2019, 7:38 PM

Sep 18 2019

jeff added a comment to D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..

I think I've brought this up before, but I would like it if the VM had a generic per-2MB page structure. We already have several in vm_reserv and the pmap, and IMO it would be a good place to maintain a "compound" busy state, rather than in the object. I worry that a mechanism to block the busying of all pages in an object will inhibit concurrency and lead to transient latency spikes. I don't object to the current approach though.

Sep 18 2019, 10:59 PM
jeff added inline comments to D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..
Sep 18 2019, 10:25 PM
jeff added inline comments to D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..
Sep 18 2019, 8:43 PM

Sep 17 2019

jeff updated the summary of D21592: (vm object 3) Add a shared object busy synchronization mechanism that blocks new page busy acquires while held..
Sep 17 2019, 9:55 PM

Sep 16 2019

jeff added inline comments to D21646: vfs: add root vnode caching for mount points.
Sep 16 2019, 9:05 PM
jeff accepted D21637: vfs: convert struct mount counters to per-cpu.
Sep 16 2019, 8:58 PM
jeff accepted D21575: vfs: manage mnt_writeopcount with atomics.
Sep 16 2019, 8:53 PM
jeff accepted D21574: vfs: manage mnt_lockref with atomics.
Sep 16 2019, 8:50 PM
jeff accepted D21425: vfs: manage mnt_ref with atomics.

My only real feedback is on the naming.

Sep 16 2019, 8:49 PM