- Change the type of hw.pagesizes to OPAQUE, since it returns an array.
- Modify the handler to only truncate the returned length if the caller
supplied an output buffer. This allows use of the trick of passing a
NULL output buffer to fetch the output size, while preserving
compatibility if MAXPAGESIZES is increased.
- Add a "S,pagesize" formatter to sysctl(8).
Details
- Reviewers
alc kib - Commits
- rS365268: Add sysctl(8) formatting for hw.pagesizes.
Example output:
hw.pagesizes: { 4096, 2097152, 1073741824 }
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/kern/kern_mib.c | ||
---|---|---|
246 ↗ | (On Diff #76374) | I think we should truncate len by removing all indexes for which pagesizes32[i] are zero (not a problem right now). |
sys/kern/kern_mib.c | ||
---|---|---|
246 ↗ | (On Diff #76374) | You mean, zero due to integer truncation? Does LA57 permit 512G superpages? |
sys/kern/kern_mib.c | ||
---|---|---|
246 ↗ | (On Diff #76374) | I mean the comment above, about (uint32_t)pagesizes[i] calculation. Right now LA57 only defines PG_PS at PD and PDP level still, i.e. no 512G superpages still. But would it allowed (and I do not think it is too far in the future), we get into this situation for i386 on amd64. |
sys/kern/kern_mib.c | ||
---|---|---|
246 ↗ | (On Diff #76374) | Shouldn't we do that for the native case as well? For instance, with 1G pages some amd64 systems will still have only 4K and 2M in the page sizes array. |
sys/kern/kern_mib.c | ||
---|---|---|
246 ↗ | (On Diff #76374) | It could be reasonable but not critical. amd64 native binaries should be prepared for 3 page sizes. While i386 expect only two. |