Page MenuHomeFreeBSD

Widen aflags to 16 bits.
ClosedPublic

Authored by markj on Nov 15 2019, 11:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 14, 4:19 AM
Unknown Object (File)
Sun, Apr 14, 4:01 AM
Unknown Object (File)
Sat, Mar 23, 6:55 AM
Unknown Object (File)
Mar 18 2024, 7:50 PM
Unknown Object (File)
Dec 22 2023, 10:00 PM
Unknown Object (File)
Nov 7 2023, 3:26 PM
Unknown Object (File)
Nov 6 2023, 4:06 PM
Unknown Object (File)
Nov 6 2023, 5:30 AM
Subscribers

Details

Summary

We are now out of aflags bits, whereas the "flags" field only makes use
of five of its sixteen bits. I have no intention of adding a new aflag
in the near future, but would like to combine the aflags, queue and
act_count fields into a single atomically updated word. This will allow
vm_page_pqstate_cmpset() to become much simpler and is a step towards
eliminating the use of the page lock array in updating per-page queue
state.

Diff Detail

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

Event Timeline

sys/vm/vm_page.h
438 ↗(On Diff #64413)

Perhaps this is an opportunity to renumber a bit and use 0x02 for something.

719 ↗(On Diff #64413)

Would a typedef for these uses of uint16_t be appropriate?

kib added inline comments.
sys/vm/vm_page.h
239 ↗(On Diff #64413)

Change the type to uint8_t since you are moving the line ?

This revision is now accepted and ready to land.Nov 16 2019, 10:29 AM
markj added inline comments.
sys/vm/vm_page.h
438 ↗(On Diff #64413)

I think that would be fine since I am changing the layout of struct vm_page anyway.

719 ↗(On Diff #64413)

I think so, but in the next patch I will actually add a

typedef struct vm_page_astate {
    uint16_t flags;
    uint8_t queue;
    uint8_t act_count;
} vm_page_astate_t;

and pass that around instead, so I do not think there is much value in adding a typedef specifically for the flags.

markj marked an inline comment as done.

Address feedback.

This revision now requires review to proceed.Nov 16 2019, 5:42 PM
This revision is now accepted and ready to land.Nov 16 2019, 6:17 PM
This revision was automatically updated to reflect the committed changes.