summaryrefslogtreecommitdiffstats
path: root/lmkd
Commit message (Collapse)AuthorAgeFilesLines
* Enable lmkd kill tracing everywhereDaniel Colascione2018-08-032-12/+3
| | | | | | | Test: asdf Exempt-From-Owner-Approval: vacation Merged-In: If6af7df74d303466aac4a69cdfe558e9748f72b9 Change-Id: If6af7df74d303466aac4a69cdfe558e9748f72b9
* lmkd: Disable memory.stat usage when per-application memcgs are not usedSuren Baghdasaryan2018-08-031-1/+4
| | | | | | | | | | | | | | | | | | 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>
* Declare __fake_use_va_args as a variadic function.Chih-Hung Hsieh2018-07-251-1/+1
| | | | | | | | | | | * New clang compiler requires variadic function to have at least one named parameter type. * Use ##__VA_ARGS__ to work with empty __VA_ARGS__. * Fix one ALOG_ASSERT parameter bug in lmkd/lmkd.c. Bug: 111614304 Test: make with WITH_TIDY=1 Change-Id: I90f35aa88527a6897954f69a35b256a157a725c5
* lmkd: Do not set soft_limit_in_bytes on high-end devicesSuren Baghdasaryan2018-05-221-39/+49
| | | | | | | | | | | | | | | Setting memory.soft_limit_in_bytes on high-end devices with large memory reserves affects performance of memory-hungry applications that have large workingsets and keep thrashing because of the memory limits imposed. Limit the usage of memory.soft_limit_in_bytes to low-memory devices only. Add debug messages for future troubleshooting to capture cases when vmpressure events are being ignored. Bug: 78916015 Test: collect vmstat while running a heavy app Change-Id: Ib4434b96d2be802ef89960b573486eae8d12f198 Merged-In: Ib4434b96d2be802ef89960b573486eae8d12f198 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: limit capability set to minimumMark Salyzyn2018-04-162-4/+17
| | | | | | | | | | | | | | | | | Set F() capability set and 'drop' lmkd from AID_ROOT to AID_LMKD uid and from AID_ROOT to AID_LMKD and AID_SYSTEM gid. /dev/memcg/memory.pressure defaults to root.root mode 0000, set it up as root.system mode 0040 to allow lmkd read access. Instrument failure to set SCHED_FIFO. Annotate access points that require elevated capabilities. Test: check /proc/`pidof lmkd`/status for capability set Test: lmkd_unit_test Bug: 77650566 Change-Id: I986081a0434cf6e842b63a55726380205b30a3ea
* lmkd: Introduce support for legacy kill algorithm that uses minfree levelsSuren Baghdasaryan2018-04-152-25/+85
| | | | | | | | | | | | | | | | Add ability to switch to the algorithm used by lowmemorykiller driver for determining when to kill. It uses minfree levels to decide at which levels of free memory and file cache to kill a process. oom_adj_score is also determined by comparing current memory resources against minfree levels. ro.lmk.use_minfree_levels property is introduces for switching into this mode. By default it is disabled. Bug: 77299493 Bug: 75322373 Merged-In: I6b51972951026854a079fcda33d6786b7ed035e4 Change-Id: I6b51972951026854a079fcda33d6786b7ed035e4 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Switch to using /proc/meminfo to have access to file cache sizeSuren Baghdasaryan2018-04-151-49/+30
| | | | | | | | | | | | | | | Current mechanism of getting system memory state by using sysinfo() is not enough because it does not provide information about file cache size which is needed to correctly assess memory state. Switch to using data from /proc/meminfo that includes information provided by sysinfo() and file cache size in addition to that. Bug: 77299493 Bug: 75322373 Merged-In: I16106fc4f9254f17f776803e60502b7b6474e1b7 Change-Id: I16106fc4f9254f17f776803e60502b7b6474e1b7 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Add zoneinfo and meminfo parsing routinesSuren Baghdasaryan2018-04-151-39/+205
| | | | | | | | | | | | /proc/zoneinfo and /proc/meminfo contain information necessary for lmkd to assess system memory state. Add routines to parse these files. Bug: 77299493 Bug: 75322373 Merged-In: Ie7d80bbb81fd0d2fc0629f6f678e6afc97fed1f6 Change-Id: Ie7d80bbb81fd0d2fc0629f6f678e6afc97fed1f6 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Optimize frequent file reads by keeping file descriptors openSuren Baghdasaryan2018-04-151-15/+73
| | | | | | | | | | | | | | To check system memory state lmkd is using same files every time vmpressure event is received. Instead of opening and closing these files every time we store the file descriptor and use pread() to reread the file from the beginning. Bug: 77299493 Bug: 75322373 Merged-In: I8e27f8b9526e82e3cc313a02fce215c2e4dd3d29 Change-Id: I8e27f8b9526e82e3cc313a02fce215c2e4dd3d29 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Fix usage of ro.lmk.kill_heaviest_task propertySuren Baghdasaryan2018-04-131-5/+3
| | | | | | | | | | lmkd should use ro.lmk.kill_heaviest_task property to select between algorithms for victim selection. Set ro.lmk.kill_heaviest_task default value to false in order to keep it compatible with previous versions of lmkd (killing the heaviest task is a new mechanism). Change-Id: I78d2dc79d9c54e636c26665605518d9c87b535b3 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Rename is_go_device variable to better reflect its functionSuren Baghdasaryan2018-04-131-4/+4
| | | | | | | | Rename is_go_device variable to low_ram_device to better reflect its meaning and relation to ro.config.low_ram variable. Change-Id: I6e2eaebe79cf2e6edf861f7c602e52a5b573ad0a Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Add lmkd README fileSuren Baghdasaryan2018-04-131-0/+60
| | | | | | | | Add README file providing lmkd overview and description for its properties. Change-Id: I30236dd4ccaa2b48c31dfb80b63f0b82b49b5744 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: only mlockall() if enabledMark Salyzyn2018-04-032-19/+28
| | | | | | | | | | | | | | Move process initialization, mlockall() and sched_setscheduler() to only occur if initialization succeeds and is enabled. This conserves mlock'd memory and a FIFO processing slot if (deprecated) kernel lowmemorykiller is active. Cleanup: Android coding standard compliance. Test: lmkd_unit_test Bug: 33808187 Bug: 72838192 Change-Id: I51af0235c8eca4ef958ef2d83a8071ff58b49d78
* lmkd: test: access /sys/module/lowmemorykiller/ as u:r:shell:s0Mark Salyzyn2018-04-031-6/+7
| | | | | | | | | | | | | | | lmkd_unit_test gets an selinux violation when run unprivileged: lmkd_unit_test: type=1400 audit(0.0:???): avc: denied { search } for name="lowmemorykiller" dev="sysfs" ino=??? scontext=u:r:shell:s0 tcontext=u:object_r:sysfs_lowmemorykiller:s0 tclass=dir permissive=0 resulting in log noise. Check for INKERNEL_MINFREE_PATH existence after known to be escalated as root user to suppress noise. Test: lmkd_unit_test as unprivileged user, there should be no audits. Change-Id: Ia5c7824e7070c98ee6eea20ca53097e4e56d61b6
* lmkd: Fix the message printed during a kill to avoid confusionSuren Baghdasaryan2018-03-211-1/+1
| | | | | | | Current kills message prints min_score_adj marked as "oom_adj" which is confusing. This change marks it as "min_oom_adj" to be more clear. Change-Id: If52f0fb25fe3208c928c5d6adce77c04b9f15a0e
* lmkd: Suppress error when accessing soft_limit_in_bytes for system_serverSuren Baghdasaryan2018-03-211-1/+15
| | | | | | | | | | | | system_server needs to register with lmkd, however it has no memory cgroup under /dev/memcg/apps. This change detects if the process being registered is system_server and suppresses the error message when /dev/memcg/apps/uid_%d/pid_%d/memory.soft_limit_in_bytes file can't be accessed. Bug: 73483785 Test: verified logcat output Change-Id: I03df7831f41f512ac8d3ebc46330546d08a3cbc6
* lmkd: Change error to warning when accessing oom_score_adj fileSuren Baghdasaryan2018-03-201-11/+25
| | | | | | | | | | | Occasionally processes are killed or crash while lmkd is trying to access their oom_score_adj file. This is not necessarily an erroneous condition and therefore should not be reported as an error. Demoting error to a warning with a detailed message. Bug: 72039129 Test: verified logcat output Change-Id: I97444ba5198c02cb7f7ba03c3af12e4aad9d233e
* lmkd: Fix lmkd-test to work with relative pathsSuren Baghdasaryan2018-03-131-10/+5
| | | | | | | This change allows lmkd-test to work correctly when it's started using absolute as well as relative path. Change-Id: Ida58d13d66a224119a363f59cc59289f0167d3c9
* lmkd: Implement lmkd-testSuren Baghdasaryan2018-03-092-0/+413
| | | | | | | | | | | | | (cherry pick from commit 5f5b30e58ba8964f78231ebf96e4ec80e7a31ecd) lmkd-test executes alloc-stress native application and monitors kernel logs for OOM kills. Bug: 63631020 Change-Id: Ia9441cc5f8e283131f0bc839cb808a911bcdb168 Merged-In: Ia9441cc5f8e283131f0bc839cb808a911bcdb168 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Introduce liblmkd_utils for communicating with lmkd processSuren Baghdasaryan2018-03-095-49/+343
| | | | | | | | | | | | | | | (cherry pick from commit 0f1005180513e880bf7c90a3f2c2bf1a36aa1406) A number of tools and tests require communication with lmkd. In order to avoid code duplication liblmkd_utils implements functions commonly used when interacting with lmkd process. Isolate communication protocol details into lmkd.h Bug: 63631020 Change-Id: Id840983d55b7db60013d52dee0c3187943811822 Merged-In: Id840983d55b7db60013d52dee0c3187943811822 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Add support for multiple lmkd client connectionsSuren Baghdasaryan2018-03-091-65/+128
| | | | | | | | | | | | | | | (cherry pick from commit 3cfb2c8b1018babf0007d8eb6263e25360409a33) lmkd testing requires communication with lmkd daemon to register new native processes. New implementation allows more than one communication channel to lmkd. Current max number of communication channels is set to two - one for ActivityManager and another one for a test process. Bug: 63631020 Change-Id: I736115938a3c5ad9253bce29a17cd5349af190eb Merged-In: I736115938a3c5ad9253bce29a17cd5349af190eb Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Select in-kernel vs userspace lmk based on kernel driver presenceSuren Baghdasaryan2018-03-011-1/+1
| | | | | | | | | | | | | | | (cherry pick from commit 979591b627601f457955bcf1f6b5f6de6493777b) Currently selection criteria for in-kernel vs userspace lmk is kernel driver presence and device not being a Go device. This change removes Go device check leaving kernel driver presence to be the only selection criteria. Bug: 71502948 Change-Id: I394a7920433a8d090e207ea86296356413a63fe7 Merged-In: I394a7920433a8d090e207ea86296356413a63fe7 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Implement kill timeoutSuren Baghdasaryan2018-03-011-0/+30
| | | | | | | | | | | | | | | | | | (cherry pick from commit caa2dc56fd52d8d773aa8b902fc605b453111976) New ro.lmk.kill_timeout_ms property defines timeout in ms after a successful kill cycle for more kills to be considered. This is necessary because memory pressure after a kill does not go down instantly and system needs time to reflect new memory state. This timeout prevents extra kills in the period immediately after a kill cycle. By default it is set to 0 which disables this feature. Bug: 63631020 Test: alloc-stress Change-Id: Ia847118c8c4a659a7fc38cd5cd0042acb514ae28 Merged-In: Ia847118c8c4a659a7fc38cd5cd0042acb514ae28 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Allow killing multiple processes to downgrade memory pressureSuren Baghdasaryan2018-03-011-23/+114
| | | | | | | | | | | | | | | | | | (cherry pick from commit 65f54a2665c5d8ebddcb18108ea54ed36df13609) Record free memory at low vmpressure levels and whenever pressure increases beyond low free up enough memory to downgrade memory pressure to low. This is done by freeing enough memory to get to the max free memory levels seen during low vmpressure. The kill logic for Go devices is not changed as these devices are designed to operate under high memory pressure. Bug: 63631020 Test: alloc-stress Change-Id: Ic8396eee08013b1c709072a13525601d5c8bf1f1 Merged-In: Ic8396eee08013b1c709072a13525601d5c8bf1f1 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Detect the highest level of vmpressure when event is detectedSuren Baghdasaryan2018-03-011-6/+15
| | | | | | | | | | | | | | | | | | | (cherry pick from commit e82e15c242d32272fe3493b0d358329e6e3d9fa7) lmkd checks for vmpressure events using epoll_wait() with eventfds of all registered events. It's possible that multiple events of different priorities happen before epoll_wait() returns. For these cases we use conservative approach by assuming that the system is under the highest registered vmpressure levels. This speeds up lmkd response time to high memory pressure by not responding to possibly stale low pressure levels when vmpressure rises quickly. Bug: 63631020 Test: alloc-stress Change-Id: I79a85c3342e7e1b3a3be82945266b2cc60b437cf Merged-In: I79a85c3342e7e1b3a3be82945266b2cc60b437cf Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Close cgroup.event_control file when done writingSuren Baghdasaryan2018-03-011-0/+1
| | | | | | | | | | | (cherry pick from commit 1bd2fc4fb6310da4303c3a76a259ab7e67bf39b8) After events are specified by writing into cgroup.event_control file the file should be closed. Change-Id: Id015e6a7bac2b74bbc8d8793c85f529ee00bdf55 Merged-In: Id015e6a7bac2b74bbc8d8793c85f529ee00bdf55 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Remove stale dependency on libprocessgroupSuren Baghdasaryan2018-03-012-3/+0
| | | | | | | | | | (cherry pick from commit b333f83481d3de7a29a7aa8d27456af89581c12b) Remove stale dependencies and header file inclusions Change-Id: Ic0e7adb5bd2a0832937a831b6918e52ace4ad46a Merged-In: Ic0e7adb5bd2a0832937a831b6918e52ace4ad46a Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: Add ability to trace lmkd killsSuren Baghdasaryan2018-03-012-0/+31
| | | | | | | | | | | | | | | (cherry pick from commit c71355991d4bafb4694f6252ac10e288a5fb9f75) For tracing lmkd kills inside kernel it is useful to have traces indicating when and which process lmkd is killing. By default the tracing is disabled. Bug: 63631020 Test: alloc-stress Change-Id: I3ceb2bde0c292eec55855cb4535927f3b4c5d08b Merged-In: I3ceb2bde0c292eec55855cb4535927f3b4c5d08b Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: add logic to kill the heaviest of the eligible processesSuren Baghdasaryan2018-03-011-1/+30
| | | | | | | | | | | | | | | | (cherry pick from commit 662492ab1d21f138483a8f3943483924e8779d29) Killing the most memory-demanding process from the set of eligible processes yields better results on high-performance devices than killing the first one we could find. This is in line with how in-kernel lowmemorykiller driver chooses its victims. Bug: 63631020 Test: alloc-stress Change-Id: Ie1ef7f33f3e79698a9b4120c14490386d6129f9b Merged-In: Ie1ef7f33f3e79698a9b4120c14490386d6129f9b Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: change defaults to disable event upgrade/downgrade logicSuren Baghdasaryan2018-03-011-3/+8
| | | | | | | | | | | | | | | | | | (cherry pick from commit ad2fd9150bdbb9abdbc26c6a395f007b4cca7567) vmpressure upgrade/downgrade logic based on swap utilization works well for low memory devices because of a small swap size, however for high performance devices this measure is not a good indication of the memory pressure because of large swap resources. This change sets the default levels to disable upgrade/downgrade logic by default and each device can set these properties appropriately. Bug: 63631020 Test: alloc-stress Change-Id: Ifd4fbd4d6bb3e82f0f87b029df94934f1e7b1c9c Merged-In: Ifd4fbd4d6bb3e82f0f87b029df94934f1e7b1c9c Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: add ability to monitor all vmpressure eventsSuren Baghdasaryan2018-03-011-55/+81
| | | | | | | | | | | | | | | | | | | (cherry pick from commit 96bf3a600c5f2678665a7c028dacbbf3fcc8f7c7) Ability to monitor all available vmpressure event levels is needed to accommodate systems with different memory resources. Low memory systems can rely on medium and critical level events because working under memory pressure is usual mode of operation. High performance systems with more memory need to react earlier using also low vmpressure level events to free memory early and prevent low memory condition affecting its performance. Bug: 63631020 Test: alloc-stress Change-Id: I0cef1bd4c97d32c005045ae47f0ce3464ed98899 Merged-In: I0cef1bd4c97d32c005045ae47f0ce3464ed98899 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* lmkd: use after freeMark Salyzyn2018-02-051-3/+3
| | | | | | | | | Remove a use-after free reference of procp->pid, using the already captured pid variable. Test: lmkd_unit_tests Bug: 33808187 Change-Id: I3f5f8dd9acab2e28c81465d6195b73ae47e0a3c4
* Add MCL_ONFAULT to mlockallDaniel Colascione2018-01-231-1/+10
| | | | | | | | | | | This way, we don't fault in the entirety of our DSOs immediately; instead, used pages are "sticky" in memory. Works only on kernel 4.4 and up: downlevel, we ignore the mlockall failure. Once we get statically-linked lmkd in better shape, we'll just switch to that. Change-Id: I07a75ee3bc1264a1db41635c2acf611fede99b91
* Pin lmkd for realDaniel Colascione2018-01-031-1/+3
| | | | | | | | | | | | | | | | | We pin lmkd in memory so that we don't take page faults (and thus requisition memory) while we're in the process of responding to a low-memory condition. mlockall(2) is the right primitive for this pinning. Previously, we used the MCL_FUTURE flag to mlockall: used this way, mlockall doesn't actually pin all pages in memory, since MCL_FUTURE affects only the default flags for future mappings and doesn't affect mapping already in existence at the time of the mlockall call --- like the lmkd executable itself. This patch adds the MCL_CURRENT flag, which also pins all pages already mapped. Test: code inspection Change-Id: I4563959367a2f0a9cadc3ea41731b7f311326685
* Merge "Add lmkd/OWNERS."Elliott Hughes2017-12-091-0/+1
|\
| * Add lmkd/OWNERS.Elliott Hughes2017-12-081-0/+1
| | | | | | | | | | | | Bug: N/A Test: N/A Change-Id: Ic4970a95d799c16ffe06bc94a85adabc18d6cc0b
* | Simplify lmkd functionalityRobert Benea2017-09-171-5/+4
| | | | | | | | | | | | | | | | Get min adj score when needed, instead to propagate from caller funct. Bug:65642829 Test: tested on gobo_512 Change-Id: I87f15c5c6206d471002828a24d0462b0abb0d196
* | Downgrade memory pressure eventsRobert Benea2017-09-141-9/+30
| | | | | | | | | | | | | | | | | | If the system has enough memory the pressure events are ignored or downgraded from critical to medium. Bug: 65642829 Test: tested on gobo Change-Id: I44e66d2e35508aceee5c1719313db217b80d582e
* | Allow ANDROID_LOW_MEMORY_KILLER to coexist with lmkdRobert Benea2017-09-111-4/+8
| | | | | | | | | | | | | | | | | | | | For Go devices fallback to memcg/memory pressure events for LMK. Go devices will use memcg pressure events while inkernel module is disabled. Bug: 64852905 Test: tested on gobo Change-Id: I267ab00be85e324331f6c91551ba013184de817e
* | Detect critical preassureRobert Benea2017-08-251-2/+50
| | | | | | | | | | | | | | | | | | | | | | When close to oom the system tend to become very thrashy and keeps paging. This change looks at the current working sent and checks it against swap. Test: tested on gobo Bug: 64721547 Change-Id: I93d42def93cbc03a01a54988fd5286ec9f124e36
* | Improvements to lmkdRobert Benea2017-08-111-18/+17
| | | | | | | | | | | | | | | | | | | | | | - Don't show misleading messages, add the correct description for the reason of process killing - Don't kill Launcher3 upgrade the score to perceptible (200) - Limit the verbose logging Test: tested on gobo Bug: 64316273 Change-Id: Ic7c13853d939afe4f20cdaa5b488b6e1810f5ddf
* | Make lmkd memory pressure levels configurable.Robert Benea2017-08-021-1/+8
| | | | | | | | | | | | | | | | | | | | | | By doing so different platforms can customize them accordingly. For instance a low mem, 512MB device can do ro.lmk.medium=400, while a device with more memory can keep the default(800). Test: tested on gobo. Bug: 64316084 Change-Id: Ifc4f3853bc06f30488adb25883ccd9aaf683ba9b
* | Make lmkd use medium/critical mem pressure, and update soft limit based on ↵Robert Benea2017-06-141-52/+68
|/ | | | | | | | | | adj score. Test: GO device (512MB/1GB), both show improvements under heavy load. Bug: 62626918 Change-Id: I98afc8b1171db5b57056bc05d1f1ae9c5eed8506
* lmkd: Android.mk -> Android.bpSteven Moreland2017-04-282-12/+13
| | | | | Test: links Change-Id: I19aa62270488af02d64830ca90faf80b35423009
* liblog: use log/log.h when utilizing ALOG macrosMark Salyzyn2017-01-111-1/+1
| | | | | | Test: compile Bug: 30465923 Change-Id: Id6d76510819ebd88c3f5003d00d73a0dbe85e943
* system/core: preparation to pull back interfaces from android/log.hMark Salyzyn2016-10-201-0/+1
| | | | | | | | | | | | | | | | Point to log/log.h where necessary, define LOG_TAG where necessary. Accept that private/android_logger.h is suitable replacement for log/logger.h and android/log.h. Correct liblog/README Effectively a cleanup and controlled select revert of 'system/core: drop or replace log/logger.h' and 'system/core: Replace log/log.h with android/log.h'. Test: compile Bug: 30465923 Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
* system/core Replace log/log.h with android/log.hMark Salyzyn2016-09-301-1/+1
| | | | | | | | | | | Should use android/log.h instead of log/log.h as a good example to all others. Adjust header order to comply with Android Coding standards. Test: Compile Bug: 26552300 Bug: 31289077 Change-Id: I33a8fb4e754d2dc4754d335660c450e0a67190fc
* Move android_get_control_socket out of lineColin Cross2016-09-231-1/+1
| | | | | | | | | | | | android_get_control_socket has a warning from the implicit cast from long to int. The warning was being hidden because cutils/sockets.h was included with -isystem. Move android_get_control_socket to sockets.cpp, since we don't want header only dependencies anyways, and fix the warning with a range check and a static_cast. Bug: 31492149 Test: m -j <module that uses sockets.h and -Wall> Change-Id: I1f394ab26d4ec8a7dd0e7907c10416d7f8647624
* Merge "Most accept/accept4 calls in system/core don't actually want the ↵Elliott Hughes2016-08-231-5/+1
|\ | | | | | | | | | | | | | | remote address." am: 299d64144b Change-Id: I3fb9678dfed08f0b1d6e90e547ecae6cdcabc9a1
| * Most accept/accept4 calls in system/core don't actually want the remote address.Elliott Hughes2016-08-231-5/+1
| | | | | | | | | | | | | | So don't write the extra code for it or waste the kernel's time copying it around. Change-Id: I93de64064c2d4fe58ba5b5322cfa69bf31a76dad