Bug 167468 - Web Inspector: iOS: Memory timeline shows impossible values for Page size (underflowed)
Summary: Web Inspector: iOS: Memory timeline shows impossible values for Page size (un...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-01-26 15:09 PST by Joseph Pecoraro
Modified: 2017-01-26 16:58 PST (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (1.85 KB, patch)
2017-01-26 15:16 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-01-26 15:09:36 PST
Summary:
iOS: Memory timeline shows impossible values for Page size (underflowed)

Steps to Reproduce:
1. Inspect iOS 10 device
2. Enable Memory Timeline
3. Start and stop timeline recording
  => Page memory values are impossible

Notes:
- vmPageSize() is returning 0 on iOS (sandbox violation prevents accessing sysctlbyname)
Comment 1 Joseph Pecoraro 2017-01-26 15:10:38 PST
<rdar://problem/30099051>
Comment 2 Joseph Pecoraro 2017-01-26 15:14:07 PST
This developer forum post seems to offer the most accurate information:
https://forums.developer.apple.com/thread/47532

Namely:

These should all match:

  - getpagesize
  - sysconf(_SC_PAGESIZE)
  - vm_page_size

As:

  • 16 KiB on 64-bit ARM platforms
  • 4 KiB on everything else

However, "various low-level Mach APIs (which we are using here) continue to work in terms of 4 KiB pages."  You can get that value using vm_kernel_page_size.

---

So this ends up matching bmalloc's vmPageSizePhysical():

> inline size_t vmPageSizePhysical()
> {
> #if (BPLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000)
>     return vm_kernel_page_size;
> #else
>     static size_t cached;
>     if (!cached)
>         cached = sysconf(_SC_PAGESIZE);
>     return cached;
> #endif
> }
Comment 3 Joseph Pecoraro 2017-01-26 15:16:24 PST
Created attachment 299862 [details]
[PATCH] Proposed Fix
Comment 4 Andreas Kling 2017-01-26 15:19:44 PST
Comment on attachment 299862 [details]
[PATCH] Proposed Fix

r=me!
Comment 5 WebKit Commit Bot 2017-01-26 16:58:04 PST
Comment on attachment 299862 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 299862

Committed r211241: <http://trac.webkit.org/changeset/211241>
Comment 6 WebKit Commit Bot 2017-01-26 16:58:08 PST
All reviewed patches have been landed.  Closing bug.