lmkd: Disable memory.stat usage when per-application memcgs are not used Per-application memory.stat files are not available when per-application memcgs are not used (per_app_memcg=false). Disable its usage based on ro.config.per_app_memcg property. minchan: * correct indentation of memory_stat_parse * move per_app_memcg check into memory_stat_parse inside * change low_ram_device to per_app_memcg Bug: 110384555 Test: manual test to see lkmd log message with memory hogger Merged-In: Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a Change-Id: Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a Signed-off-by: Minchan Kim <minchan@google.com> Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Minor fixes to fastboot_driver - Make RCString() static - Add clearer error message for 0 length upload error - Fix regex hex matching for partition-size - Move ZLP packet checking to SparseWriteCallback() Test: build fastboot on glinux Change-Id: I51a040e07b9698a41f64b35a9e2baa8d575527a9
adb: delete hellish hodgepodge. This code was unreachable, since all of the callers were calling register_socket_transport with foo.c_str() as the serial. Lift this assumption into the type system by switching from char* to std::string for the argument type. Bug: http://b/112147760 Bug: https://www.viva64.com/en/b/0579/ Test: mma Change-Id: I5a6ee265feee6b83bc933a64d895eed39fce68e7
adbd: when rebooting, don't close socket before pausing. An accidental side-effect of the change to unique_fd was that we started closing the reboot service socket before pausing and waiting for our death. This results in the client immediately returning, which means they might get a chance to run other commands before we actually manage to reboot. Bug: http://b/112104037 Test: adb reboot; adb devices Change-Id: Id61321da0c08ebd1ab57f1ce926bafd9109dd9c2
Merge "ueventd: require opt-in for modalias handling"
Merge changes from topic "liblp-blocksize" * changes: liblp: Require block-aligned partition sizes. liblp: Simplify GrowPartition().
liblp: Require block-aligned partition sizes. DM_TABLE_LOAD will reject dm-linear entries if their size is not a multiple of the backing device's logical block size. For example, a partition of 10GiB+512 bytes will fail to map in device-mapper if the logical block size is 4096 bytes. To address this, this patch adds a few changes to liblp: The block size given to lpmake is now recorded in LpGeometryMetadata. The block size must be a multiple of the sector size. In addition, partiton sizes are now aligned to the block size, and the super partition must have enough free space to allocate at least one block (in addition to storing metadata). GrowPartition now has multiple checks that the block-size invariant is not violated, to ensure that no invalid partition tables will be created. Bug: 79173901 Test: liblp_test gtest Change-Id: I484aac1f9b90ebd92dc1c89ce1e09cd89bbb441e
liblp: Simplify GrowPartition(). The partition resize algorithm duplicates a lot of logic because it handles the final free interval separately from other free intervals. This is unnecessary and makes it harder to change the actual algorithm. This change makes GrowPartition() treat the final free space region the same as free gaps in between partitions. It does this by converting the extent list into a gap list, and then adds a final gap for the remainder of the free space. The resize function no longer has to treat the end of the disk separately. This patch does not change the way partitions are allocated, it is purely a refactoring. Bug: 79173901 Test: liblp_test gtest Change-Id: I4780f20b23fe021eac62de874b061857712c04fe
liblog: Add functions to reset log context Add android_log_parser_reset and android_log_reset to reset reader/writer log context. This allows to generate multiple log messages of the same format without context reallocation. Change-Id: Icb0f15855378aa4e66fc671ffefd15d9df6fee1e
liblp: Add a ResizePartition helper to MetadataBuilder. This change is to assist with implementing the fastbootd "resize-partition" command. The GrowPartition and ShrinkPartition functions are now private. Bug: 78793464 Test: N/A Change-Id: Ic66a3052359e2558663272ff6e014704206b197e