Repository navigation
Publish develop to main - #978
Open
github-actions[bot] wants to merge 347 commits into
Open
github-actions[bot] wants to merge 347 commits into
github-actions[bot] wants to merge 347 commits into
Conversation
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
GDI's grayscale text follows the font's smoothing table, which leaves the caption's small sizes at 100% to 150% unsmoothed, so the name looked pixelated on a secondary monitor while it was smooth at 200%. The name is now laid out by DirectWrite and drawn by Direct2D with grayscale antialiasing into the same window-DPI bitmap, with GDI as the fallback. The test checks the mask is laid out at each scale's pixels and has antialiased edges at 96, 120, 144 and 192 dpi.
Fix: Draw the title bar's app name smooth at every monitor scale (FR-22)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
Two causes left default apps with white icons on a light background and off DSA's blue scheme (FR-42): - The Files, PermissionController and share sheet overlays named no overlayable set. DocumentsUI, PermissionController and IntentResolver declare overlayable sets (DocumentsUICustomization, PermissionControllerStyles, IntentResolver), and idmap2 maps nothing of an overlay that does not name the set, so all three were listed but never enabled (STATE_NO_IDMAP). Files kept force_material3 false and drew its old look with its own fixed colours. Each overlay now names its set (android:targetName), and the image build reads the target's overlayable sets and stops when an overlay names none, names another, or replaces a resource outside it or outside the vendor partition's policy. - The Clock's icons are vector drawables filled white with no tint, from an upstream that is dark only, and the toolbar's settings action, the alarm's ringtone, vibrate and delete icons, the alarm volume setting, the alarm screen's alarm button and the analog clock show them untinted. Patch 0003 gives them a default tint from the theme. The alarm screen's dismiss circle takes colorOnSurface and the snooze icon colorOnSecondary, and the screensaver, on black in both themes, takes the dark theme's colours. Tests: test_make_image.py reads overlayable sets from a resource table, checks each overlay's manifest names its app's set, refuses an overlay idmap2 would map nothing of, and stops build_system_overlays on one. test_apps.py checks the Clock patch tints each of those icons and leaves the grey-disc ones white.
Fix: Apply the default apps' palette (FR-42)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
… (FR-26) The Camera app showed no picture: every preview buffer failed to allocate (createGraphicBuffer failed, usage 0x20930, RGBA_8888). The guest has no virtio-gpu, so minigbm runs on vkms through its dumb driver (vgem has no backend). That table (dumb_driver.c, dumb_driver_init) gives ABGR8888 only BO_USE_RENDER_MASK | BO_USE_SCANOUT and puts the camera bits on R8 and NV12 alone, so RGBA with HW_CAMERA_WRITE has no combination (drv_get_combination needs every asked flag). YUV was never the answer for the screen either: NV12 has no SCANOUT, which COMPOSER_OVERLAY needs. The HAL now writes an RGBA stream with CPU_WRITE_OFTEN only and keeps CAMERA_OUTPUT on YUV and JPEG, whose combinations have it. A stream the composer shows is RGBA even when a video encoder shares it, since the allocator drops the encoder bit for RGBA but never adds SCANOUT to YUV. Tests encode minigbm's rules (format and usage conversion, the dumb driver's table, format resolution, the encoder retry) and check that every stream Aperture and CameraX open gets a format and usage the allocator makes, and that the model refuses what the guest refused. The two cameras' facing is right: the OV02C10 sits on the front panel (LENS_FACING_FRONT) and the phone's virtual camera has no enclosure (LENS_FACING_EXTERNAL); "Facing: Front" in dumpsys is cameraserver's API1 view, which reports external cameras as front.
Fix: Leave CAMERA_OUTPUT off the RGBA preview so its buffers allocate (FR-26)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
Clock (com.android.deskclock) keeps its density (812x1320 at 262 dpi). Dragged by its title bar from a 120 dpi monitor to a 192 dpi one, the desktop gives its window 816x1323. From then on the window showed no other frame: every frame the app drew was 812x1320, which FrameFollow marks stale after the scale change (and the presenter drops), and nothing asked the guest for another size. dpi_changed asks nothing for a task that keeps its density, view_resized asks nothing while a drag has crossed scales, settle sends nothing for such a task, and the end of the drag asked only for a size beyond RESCALE_ROUNDING, while 816x1323 is within it of 812x1320. The picture stayed on the frame from the old monitor and the app looked hung until an edge drag sent a resize. Host log: app.frame_stale size=812x1320 view=816x1323. At the drop of a drag that ended on a monitor of another density than the one it began on, when no other request is due and the window's size in task pixels differs at all from the task's, the task is now asked for the window's size live, with the task reconfigured at that size once it has taken it, as a maximise does. The frame that answers is of the window's size and is shown, which ends the stale hold. Unchanged: no request during the drag; the window keeps the size the desktop gave it; the held frame is drawn as before; a size beyond the desktop's rounding is still asked not live; App-mode tasks take their new density and size through settle; a drag that ends on the scale it began on asks nothing, as before. Tests: fr4_a_task_that_keeps_its_density_dragged_across_scales_shows_its_next_frame, fr4_no_move_across_scales_leaves_every_frame_of_the_task_stale_with_nothing_asked (FR-4, moves between monitors).
…ere it began (FR-4) A drag from a 200% monitor onto a 100% one and back leaves the window at the desktop's size for it, a pixel or two off the task's (1188x1712 over 1186x1711). Since the scale changed, FrameFollow shows only frames of the window's size, and the drop asked nothing because the drag ended on the density it began on: every frame stayed out of sight, the same freeze as the move from 125% to 200%. The drop after any drag that crossed scales now asks the guest for the window's size live, with the task reconfigured at that size once it has taken it, whenever that size differs from the task's at all and no other request is due. The drag_density check is gone. The owner approved changing the expectation of fr4_a_drag_200_100_200_resizes_nothing_mid_drag_and_ends_at_the_size_it_started: still nothing mid-drag and the window ends at its size, and the drop now returns that live resize in both modes. fr4_a_system_mode_window_asks_for_no_density_through_a_move has failed since the drop's rounding check came in (PR #975): its drag never reported the size the desktop gives the window, so the drop read the old 400x300 view at 131:65 as a user's 199x149 and asked for it. The test now reports the desktop's 806x605 mid-drag, as a real move does; what it checks (no density through a move) is unchanged. fr4_no_move_across_scales_leaves_every_frame_of_the_task_stale_with_nothing_asked now covers round trips as well.
Fix: Show a task's next frame after a move between monitor scales (FR-4)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
After the Camera app closed, Windows kept showing the camera in use until dsa-wm was restarted. Cause: the camera port served each connection on one thread that read the guest's messages, took the next picture (a blocking ReadSample) and sent it (a blocking 3 MB send) in turn. When the guest's HAL closes a camera it sends CameraStop and then shuts its socket down and stops reading. A picture the host is sending at that moment can no longer drain, so the thread stays in send and never reads the stop or the end of the connection; the same happens while ReadSample waits on a camera that sends nothing. The MediaFoundationStream, and with it the IMFMediaSource, IMFSourceReader and IMFActivate, stayed alive in dsa-wm. Fix: - core camera port: a running camera takes and sends its pictures on a thread of its own, through the connection's second sender shared under one lock with the answers. The connection's thread only reads the guest, so a stop, a new open or the end of the connection lets the camera go at once. - CameraStream gains releaser(), which lets the camera go from another thread; letting a camera go calls it, then waits up to a second for the camera's thread to drop the stream. A stop flag checked under the sender lock keeps the old camera's pictures from following the next answer. - Windows: Opened keeps the source, reader and activation object behind a lock; release() (from the releaser or on drop) shuts the source down, which ends a waiting ReadSample, shuts the activation object down and drops every reference, once. ReadSample runs on its own reader reference. - The window manager's log gets "camera: <name> opened for an app, WxH at N frames a second" and "camera: <name> is let go". - Guest HAL: configureStreams no longer starts the host camera for a session that was closed meanwhile, which would have held it with nobody left to close it. The buffer import failure behind "buffer N of stream M is not a graphics buffer" now logs the allocator's error and the description. Tests (fake cameras counting opens, holds and releases): a stop and a closed connection let a camera that sends nothing go within a second; a connection closed while its camera opens leaves nothing held; quick open and stop rounds never hold a camera twice and close every one they open.
Fix: Let the host camera go as soon as the guest closes it (FR-26)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
ListWidgetProviders takes lazy_previews: the widgets come without their previews and each app's icon comes once, in app_icons. GetWidgetPreviews asks for the previews of up to 64 widgets, and WidgetPreviews answers with each one's best preview and where it came from: the layout the app gives for a preview, its preview image, or its icon. The same shape is in the control channel and the local API. The generated code is not part of this commit: the Protocol sync workflow regenerates it from these definitions. FR-12: every widget of every installed app is listed with its preview.
…out a relaunch (FR-4) Framework patch 0009 for Android 16 and 17 (services.jar): a task gets a mark, Task.mDsaForcedDensity, set through the window manager's shell command dsa-forced-density <task> true|false, which needs MANAGE_ACTIVITY_TASKS. Without arguments the command prints supported, so the agent can tell an image with the patch from one without it. When a marked task's activity changes density, shouldRelaunchLocked treats density, screen size, smallest screen size and screen layout as handled, so the activity is not relaunched. Nothing changes for an unmarked task. test_forced_density_patches.py checks the decision for marked and unmarked tasks and the shell command; check-patches.sh in the framework build checks the patch applies to the pinned source.
The host core groups the widgets on offer by the app that offers them (widgets::group_by_app), apps in name order and each app's widgets in label order, so every settings app shares one rule. The session and the local API carry the gallery without previews, with each app's icon once, and the previews of the widgets a gallery shows, checked and in the order asked. dsa widgets list --by-app prints the grouped gallery and dsa widgets previews <provider>... the drawn previews. FR-12: every widget of every installed app is reachable, with its app name, widget name, preview (else the app's icon) and default size. Tests: fr12_the_gallery_groups_the_widgets_by_app_in_name_order, fr12_a_preview_request_asks_each_widget_once_and_answers_in_its_order, fr12_a_drawn_preview_is_checked_and_says_where_it_came_from, fr12_a_gallery_grouped_by_app_asks_for_the_previews_it_shows, fr12_a_gallery_by_app_gets_each_apps_icon_and_then_the_previews_it_shows, fr12_dsa_widgets_lists_by_app_and_draws_the_previews_asked_for.
Material You Widgets declares a previewLayout and no previewImage for every one of its 452 widgets, and the agent read only previewImage, so each widget showed its app's icon. The agent now draws the preview the way Android's launcher does: the previewLayout applied as RemoteViews to a widget view of its own, laid out at the widget's default size at 160 dpi and drawn shrunk to at most 256 pixels. A widget's preview is the best it has, a layout before a picture and the app's icon last; one that does not draw gives way to the next, and one too large is drawn again smaller. Previews are drawn only when a gallery asks for them (GetWidgetPreviews, at most 64 at once), on a thread of their own that ends when idle, and sent part by part, so no image of every widget is held at once. A gallery by app (lazy_previews) is listed without drawing any preview, with each app's icon once. Placing a widget no longer draws every widget's preview to find it. FR-12: each widget on offer shows its preview, else its app's icon. Tests: fr12_a_widget_that_gives_only_a_preview_layout_shows_the_layout_drawn, fr12_a_preview_layout_comes_before_a_preview_image_and_the_app_icon_last, fr12_a_preview_that_does_not_draw_gives_way_to_the_next_and_one_too_large_is_drawn_smaller, fr12_a_gallery_by_app_carries_no_previews_and_each_apps_icon_once, fr12_previews_are_drawn_off_the_agents_thread_and_sent_from_it, fr12_many_previews_come_in_parts_that_fit_a_frame.
control.proto: SetTaskDensity.forced asks the agent to mark the task before it gives it the density, and TaskUpdated.forced_density_available says the image's framework can do so. New vectors set_task_density_forced and task_updated_forced_density, in the Rust, Java and C++ vector tests. The generated code is left to Protocol sync. The agent asks the window manager once whether it has the dsa-forced-density command (framework patch 0009) and reports it with every task. A forced density marks the task first and is not given at all when the task cannot be marked, so the app is never restarted for it; a density without forced takes the agent's mark away. The binder shell command runner moves out of AndroidDevicePower into ServiceShell.kt so both use it. Tests: ForcedDensityTest, HostRequestsTest, TaskCaptionMessageTest and AgentTest cover the marking, the refusal on an image without the patch, and the report.
…ty without a relaunch (FR-4) DpiScaling::FORCED_AVAILABLE is now true. SystemForced follows the monitor as App does (mode), and DpiScaling::mode_on falls back to System on a guest whose image cannot give a density without a relaunch (TaskUpdated.forced_density_available, carried on Task and the host API's Task). Its density requests go out forced (TaskRequest::SetDensity.forced, host API and control SetTaskDensity.forced), set by the window's sizing record from DpiScaling::forced_on. Auto, App and System decide as before and never go out forced; maximize, restore, the size limit, edge drags and moves of other modes are unchanged. dsa app-window reports system_forced_available true and says a forced app is given another monitor's scale without a restart. Tests: app_windows (forced follows the monitor, falls back to system, changes nothing for the other choices), task_windows (a forced window dragged 100% to 200% behaves as an app mode one with a forced density; on an image without the change it is scaled as system), session (a forced density reaches the guest forced), host API conformance and the CLI.
The Widgets page listed every widget as a row of its own, so an app with hundreds of widgets (Material You Widgets offers 452) made the list far too long. It now lists one entry per app that offers widgets, with the app's icon, name and how many widgets it has, each opened and closed on its own and closed at first. An open app shows its widgets as a grid of cards with the preview, the widget's name and its default size, a page of 24 at a time with a button for the next page. Choosing a card places the widget as before, its setup first when it has one; the placed widgets and removing them are unchanged. The gallery comes from dsa widgets list --by-app, grouped in the host core. A card shows its app's icon until Android has drawn its preview, which the page asks for (dsa widgets previews) only for the cards an open app shows, at most 32 at a time; previews are kept in a cache bounded to 160 images and 4 MiB, a closed app lets go of its cards' images, and a page that is left lets go of all of them. The expander is read by the app's name and count and opens with Space or Enter; each card is a button named by its widget and described by its size, and the arrow keys move within the grid. FR-12: every widget of every installed app is reachable, each with its app name, widget name, preview (else the app's icon) and default size. Tests: Fr12_widgets_page_lists_one_entry_per_app_closed_with_its_icon_name_and_count, Fr12_an_opened_app_shows_its_widgets_as_cards_with_name_size_and_drawn_preview, Fr12_a_card_shows_the_apps_icon_until_and_unless_android_draws_a_preview, Fr12_an_app_with_hundreds_of_widgets_shows_and_draws_them_a_page_at_a_time, Fr12_the_preview_cache_drops_the_least_recently_used_beyond_its_bounds, Fr12_each_app_opens_on_its_own_and_its_widget_cards_are_named_buttons.
Regenerates the protocol code, with develop merged in, from the definitions the checked-in code no longer matched.
Regenerates the protocol code, with develop merged in, from the definitions the checked-in code no longer matched.
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
Renderer memory: drop unused window-image staging, list guest allocations, trim after an app closes, load one Vulkan driver
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
Feat: Free idle windows', closed apps' and idle WebView memory (NFR-1)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
Regenerates the protocol code, with develop merged in, from the definitions the checked-in code no longer matched.
Feat: Memory report, snapshot contents, 1.5 GiB boot and GPU counters (NFR-1, NFR-2)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
…(PR-3) The Graphics test stopped at "corrupt patch at ...0048...:7". The Windows runners check the patches out with CRLF line endings. git apply reads an empty line in a hunk as an empty context line only while it is truly empty, so with a carriage return on it 0048 (and 0049 next) could not be parsed, and the renderer was never built. 0003, guest/gfxstream 0002 and guest/mesa 0011 had the same lines; they are applied on Linux today but get the same fix. test_build.py now fails on any line in a hunk that does not start with its marker. test_allocation_reasons_patch.py looked up a context line among the added lines only; it now looks in the whole patch.
Fix: Give every empty context line in the graphics patches its space (PR-3)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
…ct.wait (NFR-1) The development build stopped in the guest agent: Kotlin reports an accidental override, since a private fun wait(Long) has the JVM signature of Object.wait(J)V. The function only posts the next idle check, so it is now checkAfter.
Fix: Rename IdleRelease's private wait so it no longer overrides Object.wait (NFR-1)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
…took On the owner's PC (1.0.1-dev.39, no app open) Google Play services was paged out after six of its wakes in ten minutes, each time "resident anonymous 9 -> 6 MiB, swapped out 98 -> 101 MiB": the same 3 MiB, read back from zram at its next wake. Those are the pages it touches on every wake, so paging them out again only makes it read them once more. A process whose wake brings back nine tenths or more of what the last pageout took now waits twice as long for the next one, from the policy's 30 s (5 min for a resident service) up to 16 min; a pageout of which less comes back sets the wait back to the start. The pageout log line says how long the next pageout of that process waits. NFR-1, NFR-2: the idle guest's memory and what it hands back. Test: nfr2_a_process_that_reads_back_all_a_pageout_took_is_paged_out_less_often
dev.39 on the owner's PC grew from 1536 to 3072 MiB in the first 45 s of a boot with no app open, on reports of 435 MiB available with 0.0% stalled, 257 MiB with 3.4% and 385 MiB with 2.5%. Ten minutes later Android used 487 MiB, and the 1536 MiB added kept 24 MiB of page structures for the rest of the run: Hyper-V has no hot-remove, and hv_balloon takes single pages, not whole blocks the guest could take offline. The first growth came right after the framework's extra_free_kbytes.sh (196608 KiB for the 4096x4096 guest display) raised watermark_scale_factor to about 1313: the high watermark, which MemAvailable leaves out, rose by about 390 MiB with nothing allocated, and the host read that as a guest short of memory. The host now grows the VM when the guest's tasks stall on memory 10% of the time, when it is nearly out (under a sixteenth of its total, at least 128 MiB available), or when it stays short with its tasks stalled 5% or more on every report for 30 s. Short without stalls keeps the VM at its size, and the log says so once a stretch (at most once a minute, again every five minutes while it lasts). A growth line ends with its reason. Tests: nfr2_a_boot_burst_that_reclaim_and_zram_absorb_does_not_grow_the_vm, nfr2_a_vm_held_at_its_size_says_so_once_a_stretch_and_every_five_minutes_while_it_lasts, nfr2_the_vm_grows_at_once_when_the_guests_tasks_stall_on_memory, nfr2_the_vm_grows_at_once_when_the_guest_is_nearly_out_of_memory, nfr2_the_vm_grows_when_the_guest_stays_short_and_stalled_for_30_seconds, nfr2_a_guest_short_without_stalls_keeps_the_vm_at_its_size; the earlier growth tests now send a stalled report where they meant a guest in need.
On the owner's PC (1.0.1-dev.39, no app open) the idle reclaim ran ten times in the first ten minutes after the boot, the later ones 10 to 90 s apart (cur.log: 32, 46, 68, 96, 133, 174, 184, 275, 336 and 621 s). Each left some 80 MiB reclaimable and found it back near 200 MiB about 40 s later: the processes still running read their pages back from zram and their files from the disk, so each reclaim returned memory for seconds and cost a read of all of it. #1058 accepted at most one every 3 minutes on average. A repeat of the idle reclaim in one idle stretch now waits 3 minutes after the last reclaim. When memory was already back before that wait ended, the next repeat waits twice as long, up to 24 minutes; a repeat whose saving outlasted the wait sets it back to 3 minutes, and so does a task in use. The first reclaim of an idle stretch still runs on the first look, and the trim still takes the page cache that grows back between repeats. The repeat's log line now says how long after the last reclaim memory was first found grown back, and how long the next repeat waits. NFR-1, NFR-2: idle memory goes back to the host and stays back. Tests: nfr2_the_idle_reclaim_repeats_at_most_every_three_minutes_and_waits_longer_while_memory_comes_straight_back, nfr2_an_idle_guest_reclaims_again_once_memory_has_grown_back_and_three_minutes_have_passed (was ..._on_the_next_look_that_finds_memory_grown_back, whose immediate repeat this changes).
…trim
On the owner's PC (1.0.1-dev.39, no app open) a working set trim ran on
every look from 38 s to 123 s after the boot ("wait between trims 0 s",
working set target 64 MiB), and 56 to 594 MiB of what each took was read
back before the next: about 2.2 GB of the 2.7 GB of evicted page cache
read back in the first ten minutes (workingset_refault_file 699873
pages), while the page cache stayed near 100 MiB. The reads were
Android's own start: 42 processes started for the boot broadcasts and
Google Play services loading its modules, whose files each trim took
again. With no task in use the trim ignored its wait, only trims with a
task in use were judged for it, and the boot's settling dropped any wait.
Now every trim is judged for the wait, with tasks in use or none, during
the boot's settling too, and the wait outlives the end of the settling.
With no task in use, what a trim finds read back raises the working set
target as it does for an app, but no higher than 160 MiB
(idle_keep_cache_max_kb, the floor with an app open); it falls back to
64 MiB after quiet stretches as before. A log line says when a trim is
being read back and how long the next one waits. The trim with windows
shown is unchanged.
NFR-1, NFR-2: the idle guest keeps only what it uses.
Tests: nfr2_with_no_app_open_a_trim_whose_cache_comes_back_backs_off_from_the_first_trim
(the dev.39 pattern: a trim every 5 s, 70 MiB read back after each),
nfr2_an_idle_guest_keeps_at_most_160_mib_of_page_cache_for_what_it_reads_back;
nfr2_with_no_task_in_use_the_page_cache_trims_to_the_floor now expects
the wait after a trim that came back.
…ry report (NFR-1) The dev.39 snapshot with no app open had 81 MiB of SUnreclaim in 199 slab caches, and its kernel memory report named only the 40 largest (89 of 96 MiB) and could not say which of them made up SUnreclaim: /proc/slabinfo has no reclaim flag. The report now lists every cache, each with its objects per slab and pages per slab (the slab order, which decides how much a cache keeps in partly used slabs), and whether the kernel counts it as reclaimable, read from /sys/kernel/slab/<cache>/reclaim_account. A new line, slab-unreclaimable, sums the unreclaimable caches and the room their slabs hold beyond the objects in use. When the flags cannot be read, the report says so once and marks each cache unknown. A merged cache's entry in /sys/kernel/slab is a link to its group's directory, so the report's domain may now read sysfs links (it could already read sysfs files). Tests: nfr1_the_report_splits_the_slab_into_reclaimable_and_unreclaimable_caches reproduces task_struct, kmalloc-4k and radix_tree_node from the dev.39 numbers; nfr1_the_report_lists_every_slab_cache_not_only_the_largest; the image test now knows /sys/kernel/slab and checks its rules.
The dev.39 snapshot with no app open held 2961 debugfs inodes (1904 KiB of debugfs_inode_cache in kernel-memory-report.txt) and a dentry for each (about 0.5 MiB more, computed at 192 bytes each), pinned for the VM's life: blk-mq's files for each of the 64 loop devices, binder's file for each process that opens it, and the rest of /sys/kernel/debug. A user build mounts debugfs only while it boots (init-debug.rc) and reads nothing from it. CONFIG_DEBUG_FS_ALLOW_NONE makes debugfs_create_*() return an error without making anything, and leaves the file system unregistered. "Disallow mount" would still make every file. binder, hv_balloon, zram, drm and blk-mq pass the error on as the API expects, and Android's tracing uses tracefs at /sys/kernel/tracing, which stays. The debug kernel turns debugfs back on, because page_owner reports there. Test: test_nfr1_debugfs_creates_no_files_in_the_shipped_kernel.
…NFR-1) SLUB sizes a cache's slabs to hold at least 16 objects on 4 processors, up to 32 KiB. A slab goes back to the page allocator only when every object in it is freed, so a cache of large objects keeps many partly used slabs after the boot's peak. In the dev.39 snapshot with no app open (kernel-memory-report.txt), task_struct (4032 bytes) held 867 tasks, 3414 KiB, in 5440 KiB of 8-object slabs, and kmalloc-4k held 2740 KiB of objects in 5280 KiB. With slab_min_objects=1 the kernel picks the smallest slab that wastes at most a sixteenth of itself, the rule it already applies. task_struct, kmalloc-4k, kmalloc-cg-4k and biovec-max then get one page and one object per slab and keep no partly used slab: 4.6 MiB less than in the snapshot (computed from its lines for those four caches). Caches of 2, 1 and 0.5 KiB objects get smaller slabs too; what that saves depends on the order objects are freed in and is not computed. An object that fits a page badly (sighand_cache, 2112 bytes) keeps the slab it has now, because the largest order stays the kernel's own. The words reach every host's guest through guest_boot_memory_cmdline, and the user's own parameters still come after them. Test: nfr1_slab_caches_of_large_objects_use_one_page_slabs, and the shared-word test.
A loop device allocates its whole request pool when it is made, whether anything is attached or not (blk_mq_alloc_rqs), 128 requests by default. apexd keeps 64 loop devices (loop0 to loop63 in dev.39's console log). With a request and its loop command at 384 to 512 bytes, 128 take one 64 KiB block and 32 take 16 KiB, so the guest holds about 3 MiB less (computed, not measured). This memory is in the snapshot's "unaccounted" line, not in slab. 32 requests in flight still cover an APEX's reads. apexd raises a loop device's nr_requests to the backing disk's queue depth where it can; above the pool size the kernel refuses the write, and apexd reports a failed write only when it lowers the depth, so a larger backing depth leaves the device at 32 with no error. In the direct-mapped mode apexd cannot read the pmem disk's depth at all and already logs that as a warning. Test: nfr1_loop_devices_keep_a_desktop_sized_request_pool.
…NFR-1) dev.39's console log shows the GPT size patch mapping 370 of 2420 MiB for the add-on disk (32 MiB of page structs it no longer keeps) and all of the system disk, which fills its region. The kernel README now says why the system disk's 38 MiB of page structs cannot go with this kernel: fsdax builds compound pages in them as it maps, so they can be neither left out nor shared, and keeping them on the device (map=dev) would write them into the read-only image every VM shares.
…R-1) What the dev.39 snapshot with no app open says about the persistent memory page structs and the 81 MiB of unreclaimable slab, which ways to remove the page structs were checked against linux-msft-wsl-6.18.54.1 and why none works for the system disk, how the slab breaks down, and what changed: debugfs with no access, slab_min_objects=1, loop.hw_queue_depth=32 and a report that lists every cache with its reclaim flag.
Fix: Grow the VM only for a need reclaim and zram do not absorb (NFR-2)
Fix: Stop the idle page cache trim and idle reclaim from undoing themselves (NFR-1, NFR-2)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
Feat: Guest kernel memory: debugfs off, smaller slabs and loop pools, slab report by reclaim class (NFR-1)
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
Generated by .github/scripts/release/sync-release.sh. The internal planning documents listed below are kept on develop only: PROJECT.md AGENTS.md docs/ARCHITECTURE.md docs/INTENT.md docs/RESEARCH.md docs/SPEC.md
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebuilt from
developby.github/scripts/release/sync-release.sh.The internal planning documents (
PROJECT.md,AGENTS.md, and the files directly underdocs/) are excluded; the source,README.mdanddocs/locales/are not.Merging this leaves
mainwith exactly the tree the script produced.