platform/core/system/resourced.git
2 years agoRename memory state and rearrange code 91/273091/1
Unsung Lee [Tue, 15 Mar 2022 11:09:58 +0000 (20:09 +0900)]
Rename memory state and rearrange code

Change-Id: I09961cc9ed126a79920a1688119ce1e245479a34
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoEnhance exception handling of memlimit 56/272356/5
Unsung Lee [Tue, 15 Mar 2022 07:32:51 +0000 (16:32 +0900)]
Enhance exception handling of memlimit

consider panic on oom case

Change-Id: Ie609129858b035b3e2a14a69d1ff834c1b1c3563
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoUpdate memory limit 16/272316/3
Unsung Lee [Mon, 14 Mar 2022 11:44:07 +0000 (20:44 +0900)]
Update memory limit

send SIGTERM and SIGKILL after 2 seconds &
set memory.limit_in_bytes and memory.memsw.limit_in_bytes for safety

Change-Id: I188529ecc1587355716c2eac87ab787a1008d208
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoSupport per app(service) management 06/272206/6
Unsung Lee [Fri, 11 Mar 2022 03:08:31 +0000 (12:08 +0900)]
Support per app(service) management

Delete old style configuration &
Support per app(service) management

Change-Id: Iabfd9e3e7146f1ace575bf8ee0fd3c65e164961f
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoAdd 'PerProcess' configurations 05/272205/1
Unsung Lee [Tue, 22 Feb 2022 05:20:36 +0000 (14:20 +0900)]
Add 'PerProcess' configurations

Change-Id: Ie03df4b237eeaf9bd445cbd0648fd00e58e144b5
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoFix bugs reported on SVACE 21/271421/7
Unsung Lee [Mon, 21 Feb 2022 04:35:47 +0000 (13:35 +0900)]
Fix bugs reported on SVACE

Change-Id: Ibec54113306431ffe8d059d6fb4e22838c4c86b9
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoParse 'PerProcess' section 16/271416/8
Unsung Lee [Mon, 21 Feb 2022 03:57:57 +0000 (12:57 +0900)]
Parse 'PerProcess' section

Change-Id: If58a8ef63fc88acdb3a9e726068b6697304b7e0f
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoModify comments & remove useless things 80/271180/2
Unsung Lee [Wed, 16 Feb 2022 12:22:54 +0000 (21:22 +0900)]
Modify comments & remove useless things

add proper tags in the comments
delete old style code and comments

Change-Id: Ia8aa4f61453c29327c4720cffc5046e4017efdb1
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoRearrange vip and watchdog modules 98/271098/3
Unsung Lee [Thu, 10 Feb 2022 11:42:40 +0000 (20:42 +0900)]
Rearrange vip and watchdog modules

vip module -> (proc-)watchdog module
proc-watchdog -> app-watchdog

Change-Id: I1d33ac2ae20c91537e10cbed8b81e95c5e957b96
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoModify LMK policy 97/271097/1
Unsung Lee [Thu, 10 Feb 2022 10:53:45 +0000 (19:53 +0900)]
Modify LMK policy

change oom_score_adj range and
use only one LMK policy to choose victims

Change-Id: I88befaf4dcf2e11682bbda9a1d45b619c8c0dde1
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoFix bugs of "Modify configurations" 77/270877/4
Unsung Lee [Thu, 10 Feb 2022 10:44:46 +0000 (19:44 +0900)]
Fix bugs of "Modify configurations"

merge get_total_memory() and setup_memcg_params()
free vip_apps after printing logs

Change-Id: I8a63dfe4a84cd0a8eb050daff26e725016101795
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoModify configurations 36/270636/8
Unsung Lee [Fri, 4 Feb 2022 09:22:04 +0000 (18:22 +0900)]
Modify configurations

delete old style configuration files and create new configuration files

Change-Id: I11e0cf2d9856f41aea81675b880271d4abd16143
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoClassify apps & optimize memory cgroup 67/270167/2
Unsung Lee [Mon, 24 Jan 2022 04:00:26 +0000 (13:00 +0900)]
Classify apps & optimize memory cgroup

Classify apps according to oom_score_adj &
remove useless find_app_info() functions

Change-Id: Id7131dd11a36b16cc6b2b061cccc9aa842c51224
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoModify configuration file name/path 31/269331/3
Unsung Lee [Wed, 12 Jan 2022 11:18:57 +0000 (20:18 +0900)]
Modify configuration file name/path

Change-Id: I3b84a0961d379e127025762ee6b2a705ad14d031
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoModify victim task size unit(MB->KB) 18/269118/1
Unsung Lee [Mon, 10 Jan 2022 03:47:48 +0000 (12:47 +0900)]
Modify victim task size unit(MB->KB)

Change-Id: I87d0c6312817159821a24d8203146a5231fb7aa4
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoModify swap size unit(bytes->mbytes) 16/269116/1
Unsung Lee [Mon, 10 Jan 2022 03:38:31 +0000 (12:38 +0900)]
Modify swap size unit(bytes->mbytes)

Change-Id: I428240e773ddd001de4e8f1d318039a0da55116a
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoModify cgroup structure 05/269105/2
Unsung Lee [Fri, 7 Jan 2022 06:12:39 +0000 (15:12 +0900)]
Modify cgroup structure

Modify memory cgroup hierarchy and memory cgroup structure
Add cgroup(common) structure

Change-Id: I4fb03e9e52ef700069ed0d3102d04b0d5cd59205
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoModify CPU cgroup hierarchy 16/269016/9
Unsung Lee [Fri, 31 Dec 2021 06:22:30 +0000 (15:22 +0900)]
Modify CPU cgroup hierarchy

/sys/fs/cgroup/cpu/high/medium/low
                       /tizendocker

Change-Id: I67160165e21149353f0f3acda9048e214df1c8f2
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoSeparate notifiers 34/268634/5
Unsung Lee [Tue, 28 Dec 2021 09:15:51 +0000 (18:15 +0900)]
Separate notifiers

Change-Id: Idb97d63a168a4026eb71c9d1b44977b09c2030bc
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoRefactor cgroup components 53/268753/2
Unsung Lee [Mon, 27 Dec 2021 09:59:17 +0000 (18:59 +0900)]
Refactor cgroup components

Collect all cgroup-related functions into the src/common/cgroup

Change-Id: I4ebc924baae5ace0b933360d8f12e96584a63c22
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoFix some memory leaks 84/268684/1 accepted/tizen/unified/20211231.161332 submit/tizen/20211230.110505
Mateusz Majewski [Wed, 29 Dec 2021 13:14:42 +0000 (14:14 +0100)]
Fix some memory leaks

Issues reported by jm0508.kwon@samsung.com and
ravi.singh1@samsung.com. Thanks!

Change-Id: I9658a23bf9f0960f8b29167c0a28b80c995b706f
Co-authored-by: Ravi Singh <ravi.singh1@samsung.com>
2 years agoFix convert_status_to_str 40/267840/1
Unsung Lee [Fri, 10 Dec 2021 10:17:42 +0000 (19:17 +0900)]
Fix convert_status_to_str

Change-Id: I7dd3389e9adbe12a2fb5028dca272ccf9282ab1e
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoDisable make_memps_log 11/267711/1 accepted/tizen/unified/20211213.133408 submit/tizen/20211210.093152
Unsung Lee [Thu, 9 Dec 2021 05:59:53 +0000 (14:59 +0900)]
Disable make_memps_log

Change-Id: I14cad87f047a119179251f91355043549147cbd8
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoUpdate LMK policy 47/267647/4
Unsung Lee [Wed, 8 Dec 2021 06:59:31 +0000 (15:59 +0900)]
Update LMK policy

Search victims from all LMK app groups in the first try.

Change-Id: I2ee8732e2276b5b375db1dbf0d3382b3547151ee
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
2 years agoRewire extern "C" blocks 21/266321/2 accepted/tizen/unified/20211116.130508 submit/tizen/20211115.094018
Mateusz Majewski [Wed, 10 Nov 2021 14:01:08 +0000 (15:01 +0100)]
Rewire extern "C" blocks

This is needed in order not to #include "glib.h" in the extern "C"
blocks, which breaks in the newest GLib version.

Change-Id: Ia00fcb42434c1e70165dffe3bc1e9b1c57a78fe1

2 years agoprocess: update oom_score_adj back to itself 87/265987/6
Youngjae Cho [Wed, 3 Nov 2021 08:27:07 +0000 (17:27 +0900)]
process: update oom_score_adj back to itself

In initializing service app, it initializes /proc/pid/oom_score_adj,
but cannot initialize the data structure itself within its subroutine.
Therefore manually update the oom_score_adj.

Change-Id: Ifc2a13a020dcd570d318c79e7e67d5f04ed41fc0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRevamp resourced directory hierarchy 90/265090/8 accepted/tizen/unified/20211105.130514 submit/tizen/20211029.132023 submit/tizen/20211103.072537 submit/tizen/20211104.031932 submit/tizen/20211104.080231
Hubert Kowalski [Thu, 7 Oct 2021 13:11:15 +0000 (15:11 +0200)]
Revamp resourced directory hierarchy

Done in preparation for resourced's new
role as a centralized resource management
framework. Makes the organization more
modular, with clearer responsibility.

Change-Id: I432f83537a6ca9dcfce00172942ca1bb422f3cf1

2 years agovip-process: rework vip-agent 41/263441/4 accepted/tizen/6.5/unified/20211028.115453 accepted/tizen/unified/20210914.084920 submit/tizen/20210913.042525 submit/tizen_6.5/20211028.162501 tizen_6.5.m2_release
Youngjae Cho [Thu, 2 Sep 2021 07:39:39 +0000 (16:39 +0900)]
vip-process: rework vip-agent

vip-process now constructs vip configurations from each vip packages,
not from resourced itself. Each vip packages now define and install
vip configuration file at /etc/resourced/vip-process.d, and resourced
collects these configuration files. The format of new configuration
file is like below, and more option might be added in the future.

  [VIP_GROUP1]          // Section format: VIP_GROUP#
                           There can be multiple vip groups.
   If there is only one group, then just
   [VIP_GROUP] is possible.

  PROCESS=some_binary1 // Define vip processes.
  PROCESS=some_binary2
  ...

  SERVICE=some_unit1.service // Define vip services.
  SERVICE=some_unit2.service
  ...

  ACTION_ON_FAILURE=reboot  // Define action for the vip group.
                            // Currently only "reboot" is supported.

  [VIP_GROUP2]
  ...

Change-Id: I4d88f59a009a5a7800651a07f79ab37f2cfae719
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoTemporarily disable VIP reboot for enlightenment 75/263375/1 accepted/tizen/unified/20210901.114631 submit/tizen/20210901.105117
Hyotaek Shim [Wed, 1 Sep 2021 10:50:40 +0000 (19:50 +0900)]
Temporarily disable VIP reboot for enlightenment

Change-Id: I14051c258f4d2794fa1fd0cc7c7c0111013a27d2
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agovip-process: disable vip by boot parameter 59/262759/1 accepted/tizen/unified/20210824.123813 submit/tizen/20210819.082047
Youngjae Cho [Thu, 19 Aug 2021 07:30:45 +0000 (16:30 +0900)]
vip-process: disable vip by boot parameter

If boot parameter 'tizen.vip_reboot_disable' is given, disable
vip-process module.

Change-Id: I816bc60e8e7674d96fdf0ea0fd2f09fa3732b0e1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agovip-process: print dlog in vip_print_console() 50/262550/2
Youngjae Cho [Fri, 13 Aug 2021 06:21:01 +0000 (15:21 +0900)]
vip-process: print dlog in vip_print_console()

Change-Id: I764b1ef75c76ab61e28044ee044f8a89a3f3499b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRemove unused mem-stress package 77/261777/1 accepted/tizen/unified/20210727.124406 submit/tizen/20210726.170601
Hyotaek Shim [Mon, 26 Jul 2021 07:41:15 +0000 (16:41 +0900)]
Remove unused mem-stress package

Change-Id: I11f8c744e4b92246ea7a4fd7b18180dca3096ea4
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agocpu: change udev buffer size from default value to 512 KB 89/261289/3 accepted/tizen/unified/20210727.124552 submit/tizen/20210726.050348
INSUN PYO [Wed, 14 Jul 2021 08:00:09 +0000 (17:00 +0900)]
cpu: change udev buffer size from default value to 512 KB

Between udev_monitor_enable_receiving() and the start of g_main_loop, a lot of udev events accumulate, and G_IO_ERR occurs in udev.

In vim3 target, many udev events occur when booting.
========================================================
KERNEL[3947.849435] add      /kernel/slab/:atA-0000192/cgroup/dentry(660:storaged.service) (cgroup)
KERNEL[3947.849544] add      /kernel/slab/inode_cache/cgroup/inode_cache(660:storaged.service) (cgroup)
KERNEL[3947.851730] add      /kernel/slab/sock_inode_cache/cgroup/sock_inode_cache(660:storaged.service) (cgroup)
KERNEL[3947.851822] add      /kernel/slab/:t-0000256/cgroup/kmalloc-256(660:storaged.service) (cgroup)
KERNEL[3947.851964] add      /kernel/slab/:t-0000512/cgroup/kmalloc-512(660:storaged.service) (cgroup)
KERNEL[3947.852916] add      /kernel/slab/:tA-0000192/cgroup/cred_jar(660:storaged.service) (cgroup)
KERNEL[3947.852971] add      /kernel/slab/:t-0000128/cgroup/kmalloc-128(660:storaged.service) (cgroup)
KERNEL[3947.853031] add      /kernel/slab/proc_inode_cache/cgroup/proc_inode_cache(660:storaged.service) (cgroup)
KERNEL[3947.853760] add      /kernel/slab/:tA-0000896/cgroup/mm_struct(660:storaged.service) (cgroup)
KERNEL[3947.853807] add      /kernel/slab/:tA-0000176/cgroup/vm_area_struct(660:storaged.service) (cgroup)
KERNEL[3947.853831] add      /kernel/slab/:tA-0000064/cgroup/anon_vma_chain(660:storaged.service) (cgroup)
KERNEL[3947.853848] add      /kernel/slab/anon_vma/cgroup/anon_vma(660:storaged.service) (cgroup)
==============================================================

Default value of udev buffer: /proc/sys/net/core/rmem_default (212992 byte on vim3 target)

Change-Id: I810a4f872b23e0f4b8e3ed8b68cdb5915ce1b0a3

2 years agoheart-battery: check battery feature before init 12/261112/2 accepted/tizen/unified/20210715.124008 submit/tizen/20210714.103132
Youngjae Cho [Mon, 12 Jul 2021 06:20:34 +0000 (15:20 +0900)]
heart-battery: check battery feature before init

Change-Id: Ib3c1453f77fbc9f66bd961d29d73774c75649d71
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agocommon: fix G_IO_ERR handling bug. 84/261184/8
INSUN PYO [Tue, 13 Jul 2021 03:30:01 +0000 (12:30 +0900)]
common: fix G_IO_ERR handling bug.

If "G_IO_IN | G_IO_ERR" occurs, function can not handle G_IO_IN.
As a result, G_IO_IN continues to trigger in the poll.

Change-Id: Iebb22830f71074aaed0fff93dab569854e4a6c71

2 years agoprocess: rename proc-stat to process 48/261048/2
Youngjae Cho [Fri, 9 Jul 2021 05:05:58 +0000 (14:05 +0900)]
process: rename proc-stat to process

Change-Id: I546adc6e84d0995450ef85f4f7e6e79a8b18ea14
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agomemory: add relative vmpressure threshold for iot-headless 87/260687/4
Youngjae Cho [Thu, 1 Jul 2021 05:09:24 +0000 (14:09 +0900)]
memory: add relative vmpressure threshold for iot-headless

resourced-headless have managed vmpressure based on ratio of available
memory to the total memory. Since resourced-headless has been replaced
with resourced, bring this functionality into resourced for iot-headless
profile.

Change-Id: I4683fce74d61417bb3052dd857a912be5058d614
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agovip-process: add config for headless profile 53/260553/6 accepted/tizen/unified/20210630.143921 submit/tizen/20210630.045241
Youngjae Cho [Tue, 29 Jun 2021 02:48:07 +0000 (11:48 +0900)]
vip-process: add config for headless profile

resourced-headless of iot-headless profile is replaced by resourced.

Change-Id: Ica83f027d0ffa040d84b8ec170c545eb959f007b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRename conf file for consistency 60/260560/2
Youngjae Cho [Tue, 29 Jun 2021 05:24:55 +0000 (14:24 +0900)]
Rename conf file for consistency

Change-Id: I37b3ffdad300b2902586615f93bef1657796df71
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRevert "Temporarily disable VIP reboot for dbus.service" 52/260252/1 accepted/tizen/unified/20210623.125304 submit/tizen/20210623.023127
Hyotaek Shim [Tue, 22 Jun 2021 12:07:25 +0000 (12:07 +0000)]
Revert "Temporarily disable VIP reboot for dbus.service"

This reverts commit b38f0b9812af44b5b97d7673b3e3b3e1407a4553.

Change-Id: I1a40ef122188003ac877bd4c908b0ca073d0a6fd

2 years agoTemporarily disable VIP reboot for dbus.service 93/260193/1 accepted/tizen/unified/20210622.045004 submit/tizen/20210622.020044
Hyotaek Shim [Tue, 22 Jun 2021 02:00:03 +0000 (11:00 +0900)]
Temporarily disable VIP reboot for dbus.service

Change-Id: Ifeefd4fc0d70455621bf93ca625bfec034427492
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agovip-process: print VIP fail log on console 14/259814/5 accepted/tizen/unified/20210616.132434 submit/tizen/20210616.024518 submit/tizen/20210616.025608
Youngjae Cho [Tue, 15 Jun 2021 06:26:00 +0000 (15:26 +0900)]
vip-process: print VIP fail log on console

Change-Id: I82a748248f2c2f62cb49548edaae0cd849425ed0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agovip-process: add tv exclusive configuration 89/259589/3
Youngjae Cho [Thu, 10 Jun 2021 03:31:33 +0000 (12:31 +0900)]
vip-process: add tv exclusive configuration

Change-Id: I954a156fbeb4126c34dc088f7729027f293cc81d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agofreezer: print log on killing ConnectionOverflow app 87/259587/1
Youngjae Cho [Thu, 10 Jun 2021 03:00:26 +0000 (12:00 +0900)]
freezer: print log on killing ConnectionOverflow app

Change-Id: Iedaa2fbc781af244e62075aed4fd14c252816df0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoFreezer: handle DBus SocketOverflow 75/259075/6 accepted/tizen/unified/20210611.145105 submit/tizen/20210610.022051
Michal Bloch [Fri, 28 May 2021 20:16:07 +0000 (22:16 +0200)]
Freezer: handle DBus SocketOverflow

Public part, has no freezer module changes

Change-Id: I95928115d1a33d5ccd8940a8375145ade1869c70
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
2 years agoTemporarily disable VIP reboot for dbus.service 43/259443/1 accepted/tizen/unified/20210608.091133 submit/tizen/20210608.062824
Hyotaek Shim [Tue, 8 Jun 2021 06:27:46 +0000 (15:27 +0900)]
Temporarily disable VIP reboot for dbus.service

Change-Id: Ie1cc4f88defd21045e7ccbe09571e20d4524bd49
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agovip-agent: double check VIPs on booting done 78/258078/11 accepted/tizen/unified/20210528.134755 submit/tizen/20210528.010751
Youngjae Cho [Mon, 10 May 2021 07:29:55 +0000 (16:29 +0900)]
vip-agent: double check VIPs on booting done

Change-Id: Id2596633387d44233b6df9729c0d24550bd35a68
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoFix svace defects 40/258140/1
Youngjae Cho [Tue, 11 May 2021 06:52:11 +0000 (15:52 +0900)]
Fix svace defects

Change-Id: I6bb82e9293308da17217a67c98c49d8682ba9658
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agomemlimit: Introduce limit for background apps 47/253847/6 accepted/tizen/unified/20210301.130200 submit/tizen/20210225.162154
Karol Lewandowski [Thu, 18 Feb 2021 11:54:04 +0000 (12:54 +0100)]
memlimit: Introduce limit for background apps

Use MemLimitBgApp to set memory limit for any kind of application
(gui, widget).

Change-Id: I9879601ef214ef2e68ede1496084e2f99d27b221

3 years agoAdd new dbus method "ProcSwapUsage" 36/253536/2 accepted/tizen/unified/20210219.134906 submit/tizen/20210217.044338 submit/tizen/20210218.041307
Yunmi Ha [Mon, 15 Feb 2021 06:36:05 +0000 (15:36 +0900)]
Add new dbus method "ProcSwapUsage"

- method name: ProcSwapUsage
- in: 'ai'
- out: 'a(i)'

Change-Id: I673db6c06fc85eb648840298a64f1938ac0f4e17
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
3 years agoMemLimit: update memory usage immediately 06/251906/1 accepted/tizen/unified/20210125.073659 submit/tizen/20210122.124242
Michal Bloch [Wed, 20 Jan 2021 16:51:04 +0000 (17:51 +0100)]
MemLimit: update memory usage immediately

Change-Id: Ifb2297d6458a7721d0a39a0d4e9b08d76844a062
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
3 years agoBump version to 6.5.x 41/251141/1 accepted/tizen/unified/20210113.121047 submit/tizen/20210108.125336
Karol Lewandowski [Fri, 8 Jan 2021 12:46:25 +0000 (13:46 +0100)]
Bump version to 6.5.x

Change-Id: I32233eb801e55ab1a48ce3835dcd3a542109608b

3 years agomemlimit: Introduce gui app and widget limits 32/250432/4
Karol Lewandowski [Thu, 24 Dec 2020 11:14:29 +0000 (12:14 +0100)]
memlimit: Introduce gui app and widget limits

Use MemLimitGUIApp and MemLimitWidget options to set gui app and widget
limits, respectively.

Change-Id: I70e1040438dd930ea06f268fde0514c3381e17ad

3 years agocpu-sched: move all threads using cgroup.procs 66/249866/3 accepted/tizen/unified/20201218.124446 submit/tizen/20201218.025549
Cho youngjae [Thu, 17 Dec 2020 06:11:17 +0000 (22:11 -0800)]
cpu-sched: move all threads using cgroup.procs

Use cgroup.procs instead of tasks to move all threads.

Change-Id: I83a75ab39ea61036c26e5951998181fd8bc0bdc8
Signed-off-by: Cho youngjae <4nuri1205@naver.com>
3 years agoRevert "cpu-sched: move all threads, not just the main one" 65/249865/4
Cho youngjae [Thu, 17 Dec 2020 06:10:56 +0000 (22:10 -0800)]
Revert "cpu-sched: move all threads, not just the main one"

This reverts commit c18193530e5a5ad0e89902b6318f114e8432cc4c.

Change-Id: Idfe24be6476d731ccc16e41482498e16dc780399
Signed-off-by: Cho youngjae <4nuri1205@naver.com>
3 years agocpu-sched: move all threads, not just the main one 63/249463/8 accepted/tizen/unified/20201216.215925 submit/tizen/20201216.004818
Michal Bloch [Fri, 11 Dec 2020 19:11:06 +0000 (20:11 +0100)]
cpu-sched: move all threads, not just the main one

Change-Id: If8947e4127d49554ca492571c9d08d755d02902a
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
3 years agoType correctness fixes 04/248204/1 accepted/tizen/unified/20201127.130445 submit/tizen/20201126.152656
Michal Bloch [Mon, 23 Nov 2020 13:22:33 +0000 (14:22 +0100)]
Type correctness fixes

Change-Id: I60385a605ac92461da1c438ca0037672954abf0a
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
3 years agoSilence ABI incompatibility warnings 03/248203/1
Michal Bloch [Mon, 23 Nov 2020 19:43:12 +0000 (20:43 +0100)]
Silence ABI incompatibility warnings

Since Tizen stuff gets rebuilt from scratch all the time anyway

Change-Id: I1fcc9c479ce15c160141920ef4885716afee63b9
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
3 years agoFix a strncpy size/length mismatch 02/248202/1 accepted/tizen/unified/20201125.124018 submit/tizen/20201125.015241
Michal Bloch [Mon, 23 Nov 2020 19:42:37 +0000 (20:42 +0100)]
Fix a strncpy size/length mismatch

Doesn't actually do anything (since we
manually add the null) but the compiler complains.

Change-Id: Ie222ec4b9b077268407db3cf8386f82bcb134db3
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
3 years agoBug fix: parsing memcg threshold 07/247507/2 accepted/tizen/unified/20201113.130840 submit/tizen/20201111.094630
Youngjae Cho [Wed, 11 Nov 2020 09:13:41 +0000 (18:13 +0900)]
Bug fix: parsing memcg threshold

Change-Id: I670abe3b9d38f3f7a6ce9c6546e4f2d175c5bb0a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoMake memory logging configurable 50/247350/13
Youngjae Cho [Tue, 10 Nov 2020 05:09:13 +0000 (14:09 +0900)]
Make memory logging configurable

Logging section in memory.conf file now configures the memory
logging. Now it is able to set the path and prefix of a logfile,
maximum number of logfiles, or even disable logging itself.

Change-Id: Id18da1b8df4ab4ba346080ad17f7c59da60acccb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoFix typo 40/246140/1 accepted/tizen/unified/20201102.124342 submit/tizen/20201030.075745
taemin.yeom [Mon, 26 Oct 2020 01:00:09 +0000 (10:00 +0900)]
Fix typo

Change-Id: I47e0174082dbcda4e473a5514496dc26f217e11a
Signed-off-by: taemin.yeom <taemin.yeom@samsung.com>
3 years agoFix the condition for escaping lowmem 38/244838/7
Youngjae Cho [Fri, 25 Sep 2020 01:32:17 +0000 (10:32 +0900)]
Fix the condition for escaping lowmem

The condition for escaping lowmem should be applied only when the lowmem
limit operates as MEM_LIMIT_THRESHOLD.

In case of MEM_LIMIT_OOM, kernel has already blocked the process which
used memory over the limit of cgroup. So if resourced got the eventfd
from the kernel about memory limit, resourced should control the
memory.oom_control node, enabling kernel to handle that oom. Otherwise,
this process would be stuck in D state until receiving SIGKILL signal.

Change-Id: I6279714037a4112823513529c414c3d4a1a04030
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoAdd memcg threshold for memory size larger than 2GB 12/245512/5
Youngjae Cho [Mon, 12 Oct 2020 01:30:04 +0000 (10:30 +0900)]
Add memcg threshold for memory size larger than 2GB

Change-Id: I5e7a46cba90d8eb57fa80a3fc181541dc4762269
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agospec: remove tapi build requirement 96/245296/1
Michal Bloch [Tue, 6 Oct 2020 10:34:32 +0000 (12:34 +0200)]
spec: remove tapi build requirement

Seems to build correctly without.

Change-Id: I832c78c43786f906cb70e45413c688fd45ddb383
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
3 years agoFix svace issue 96/243396/3 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.114030 accepted/tizen/6.0/unified/hotfix/20201103.002008 accepted/tizen/unified/20200911.043144 submit/tizen/20200910.050828 submit/tizen_6.0/20201029.205105 submit/tizen_6.0_hotfix/20201102.192505 submit/tizen_6.0_hotfix/20201103.114805 tizen_6.0.m2_release
Youngjae Cho [Mon, 7 Sep 2020 08:07:27 +0000 (17:07 +0900)]
Fix svace issue

In addition to fix svace issue,
change yoda conditions in cpu-sched.c to usual style.

Change-Id: Ifde1796c2bdfbb2893505ec3365036068e454d75
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoswap: do NOT set ZRAM size if it is already set by kernel 06/243206/1 accepted/tizen/unified/20200908.060819 submit/tizen/20200907.113616 submit/tizen/20200908.010406
Elmurod Talipov [Fri, 4 Sep 2020 02:26:40 +0000 (11:26 +0900)]
swap: do NOT set ZRAM size if it is already set by kernel

 ZRAM disksize can be set with configuration in Kernel or by other
 means, in that case setting and verify ZRAM size fails.

Change-Id: Id296cf8106ecbea368959f92e06ad7d7a6a57f4c
Signed-off-by: Elmurod Talipov <e.talipov@samsung.com>
3 years agoRelease 6.0.5 42/242542/5 accepted/tizen/unified/20200828.225436 submit/tizen/20200828.121504
Karol Lewandowski [Thu, 27 Aug 2020 14:22:35 +0000 (16:22 +0200)]
Release 6.0.5

Change-Id: I2af07d1c242916a025ad21320d25c82527b67ea4

3 years agocpu-sched: Fix leaks in load_config 38/242638/3
Karol Lewandowski [Fri, 28 Aug 2020 10:18:05 +0000 (12:18 +0200)]
cpu-sched: Fix leaks in load_config

Change-Id: I46201ea6244fc8fd42cd388f4bc5f78d7d86fa7b

3 years agocpu-sched: Handle suspend event too 41/242541/3
Karol Lewandowski [Thu, 27 Aug 2020 14:22:09 +0000 (16:22 +0200)]
cpu-sched: Handle suspend event too

resume event was supported previously, suggesting suspend is missing

Change-Id: Idabe1e8559961332079de018854321466f8ea902

3 years agocpu-sched: Add support for handling background events 53/242353/4
Karol Lewandowski [Tue, 25 Aug 2020 15:04:38 +0000 (17:04 +0200)]
cpu-sched: Add support for handling background events

Change-Id: I2f1f2b8af0ecf146c507697e02cfda0c9e3f5282

3 years agocpu-sched: Support assigning cpusets to services 07/242307/5
Karol Lewandowski [Tue, 25 Aug 2020 12:00:11 +0000 (14:00 +0200)]
cpu-sched: Support assigning cpusets to services

Change-Id: Ie745a30723d4556fb57efaa4a70f76d63ee08c3e

3 years agocpu-sched: Do not depend on foreground= being set in configuration 82/242182/5
Karol Lewandowski [Mon, 24 Aug 2020 23:35:52 +0000 (01:35 +0200)]
cpu-sched: Do not depend on foreground= being set in configuration

Change-Id: I48330dfe807ab4c581ae2d8a17a0019eead18dd8

3 years agofix svace buffer-overflow issue 97/242597/1 submit/tizen/20200828.070910
Sung-hun Kim [Fri, 28 Aug 2020 06:49:04 +0000 (15:49 +0900)]
fix svace buffer-overflow issue

Change-Id: I1f9b81cf51538d42fcde478fb43dbada82160041
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
3 years agoswap: zramswap: Use zstd compression algorithm 63/242463/1 accepted/tizen/unified/20200828.121534 submit/tizen/20200827.070546
Dongwoo Lee [Thu, 27 Aug 2020 05:42:07 +0000 (14:42 +0900)]
swap: zramswap: Use zstd compression algorithm

Change-Id: I6bab2db5cc888d3de8fa199a6f62a8a428984a3b
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoswap: zramswap: Fallback to write default compressor 62/242462/1
Dongwoo Lee [Thu, 27 Aug 2020 05:38:08 +0000 (14:38 +0900)]
swap: zramswap: Fallback to write default compressor

If it fails to write compression algorithm to zram, try again with
default compressor to address that compression algorithm described
in conf file is not supported by kernel.

Change-Id: I69f5b52042b20b5aba504d1baea965e07c315ceb
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoEnable memory optimization features on default configuration 32/242232/3 submit/tizen/20200827.041709
Dongwoo Lee [Tue, 25 Aug 2020 02:17:22 +0000 (11:17 +0900)]
Enable memory optimization features on default configuration

This enables dedup module and ReclaimAtBoot of swap module as default.
If the kernel does not support deduplcation, it is ignored.

Change-Id: I0902be43e3f8dc1588bbecea33d21a3d66d3a5c9
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoswap: Add support for reclaiming more memory at boot 08/237208/6
Dongwoo Lee [Mon, 24 Aug 2020 06:52:43 +0000 (15:52 +0900)]
swap: Add support for reclaiming more memory at boot

To reclaim more memory on earily reclaim stage, this provides
new configuration for '[SWAP]' section as "ReclaimAtBootThreshold".
If this is set, reclaim at earily stage continuously until the
reclaimed memory is lower than this threshold. Otherwise, default
value is very large (1024MB), so reclaim will be perfomed once as
before.

Change-Id: Icdd9206cf451a64a9c872833af88e91e8d8a6c6e
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoDEDUP: a dedup module to control LKSM 52/240852/5
Sung-hun Kim [Thu, 23 Jan 2020 07:18:20 +0000 (16:18 +0900)]
DEDUP: a dedup module to control LKSM

To manage LKSM in the kernel, a dedup module is added to resourced codebase.

The resourced daemon checks memory pressure level when an event is delivered
from the kernel. When the memory pressure level is crossed the predefined
threshold (which is configured by memory.conf), the daemon requests to invoke
memory deduplication via sysfs interface.

In order to enable a dedup module in resourced, the kernel should support LKSM
features.

Change-Id: I6bec596d40e68e1d6cc0c047d80ef30700ab846e
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
3 years agoRelease 6.0.4 08/241008/1 accepted/tizen/unified/20200814.123106 submit/tizen/20200813.115042
Karol Lewandowski [Thu, 13 Aug 2020 11:34:28 +0000 (13:34 +0200)]
Release 6.0.4

Change-Id: Ifa47a5cc4a601812db1da103f6b41052702771ad

3 years agomemory: Fix: Avoid copying garbage when dir is shorter than fpath 02/241002/1
Karol Lewandowski [Thu, 13 Aug 2020 11:33:09 +0000 (13:33 +0200)]
memory: Fix: Avoid copying garbage when dir is shorter than fpath

Change-Id: If6966bd3623499f88006f6eb1b740d7de3b4b3d9

3 years agoprocfs: Fix: do not copy garbage when filename is shorter than PROC_NAME_MAX 96/240896/2
Karol Lewandowski [Wed, 12 Aug 2020 13:59:04 +0000 (15:59 +0200)]
procfs: Fix: do not copy garbage when filename is shorter than PROC_NAME_MAX

Change-Id: I04d5d68b25fa9795691d109bc52192406758e99f

3 years agoFix ASan build 76/239776/1 accepted/tizen/unified/20200731.145753 submit/tizen/20200730.102703
Slava Barinov [Wed, 29 Jul 2020 10:40:26 +0000 (13:40 +0300)]
Fix ASan build

Address Sanitizer build requires symbols to be visible for interception.

Change-Id: Ifb56beaa6f24273d8f28c05423323828e993c8cf
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
3 years agoIncrease MemLimitService to 128MB 74/239574/2 accepted/tizen/unified/20200728.045250 submit/tizen/20200728.005611
Hyotaek Shim [Tue, 28 Jul 2020 00:48:39 +0000 (09:48 +0900)]
Increase MemLimitService to 128MB

Change-Id: If90f9215189a3ad61a33f637c7496399b1a6af05
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoDefault conf file for cpu core pinning 77/239077/1 accepted/tizen/unified/20200722.144549 submit/tizen/20200722.034444
Hyotaek Shim [Tue, 21 Jul 2020 12:11:40 +0000 (21:11 +0900)]
Default conf file for cpu core pinning

Change-Id: I43b1e5e73e83297112cd68935f86424184f7a31c
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agocpu-sched: check app list on startup 72/237472/5 accepted/tizen/unified/20200722.014938 submit/tizen/20200721.120800
Maciej Słodczyk [Tue, 30 Jun 2020 14:14:54 +0000 (16:14 +0200)]
cpu-sched: check app list on startup

Change-Id: Id0f468171e0b9b750bfc38e5e469928e270fa60f
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agocpu-sched: add apps' static cpusets 64/237364/6
Maciej Słodczyk [Mon, 29 Jun 2020 13:28:10 +0000 (15:28 +0200)]
cpu-sched: add apps' static cpusets

Change-Id: I1ce586e2923ea39c280c4e7bb53a04335554f5c1
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agocpu-sched: use apps' foreground events to pin to proper cpuset 65/236965/7
Maciej Słodczyk [Tue, 23 Jun 2020 20:24:08 +0000 (22:24 +0200)]
cpu-sched: use apps' foreground events to pin to proper cpuset

Change-Id: Icb19ef5628f1576aa87f9cc86ed3db59b24f18ef
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agocpu-sched: use cpu on/off events to create cpusets 64/236964/6
Maciej Słodczyk [Tue, 23 Jun 2020 19:24:48 +0000 (21:24 +0200)]
cpu-sched: use cpu on/off events to create cpusets

Change-Id: I158f2a8e26ae3334065717c06b16b9e161e3281e
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agocpu-sched: add cpu hotplug notification mechanism 11/236311/7
Maciej Słodczyk [Mon, 15 Jun 2020 14:12:38 +0000 (16:12 +0200)]
cpu-sched: add cpu hotplug notification mechanism

Change-Id: I8b01ef5d757501a709c3e067cdcf95223d522266
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agocpu-sched: foreground core set data structures 63/236963/6
Maciej Słodczyk [Tue, 23 Jun 2020 18:46:11 +0000 (20:46 +0200)]
cpu-sched: foreground core set data structures

Change-Id: I2bd110e85d7ebc8f30f0b7949abccbbb92cd6881
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agocpu-sched: add new module 62/236962/6
Maciej Słodczyk [Tue, 23 Jun 2020 13:57:59 +0000 (15:57 +0200)]
cpu-sched: add new module

Change-Id: I324d4e32be5d64ba993f8637d0500d8f76c3986b
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agoMerge "file-helper: fix possible memleak" into tizen
Maciej Slodczyk [Mon, 13 Jul 2020 05:32:50 +0000 (05:32 +0000)]
Merge "file-helper: fix possible memleak" into tizen

3 years agotests: Fix wrong operator 54/237954/2
sanghyeok.oh [Tue, 7 Jul 2020 02:47:07 +0000 (11:47 +0900)]
tests: Fix wrong operator

Change-Id: Ieb322a7824b29818f112b0fccd81e02821a48e24
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
3 years agofile-helper: fix possible memleak 29/237929/2
Maciej Słodczyk [Mon, 6 Jul 2020 12:45:55 +0000 (14:45 +0200)]
file-helper: fix possible memleak

Assigning NULL to **str passed pointer on fgets() error
may result in being unable to free memory pointed by *str
(if it was previously allocated dynamically).

Change-Id: Ieda457c4d9da02dab277d476ed79537da41e744e
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agoFix misspelled "swappiness" 07/237207/1
Dongwoo Lee [Mon, 20 Apr 2020 07:55:52 +0000 (16:55 +0900)]
Fix misspelled "swappiness"

Memcg attribute "swappiness" is misspelled as "swapness", so this
corrects them.

Change-Id: Ia6cf4774b26af613e344c25dca6591980a183247
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoswap: fix wrong indentation 06/237206/1
Dongwoo Lee [Mon, 20 Apr 2020 07:48:56 +0000 (16:48 +0900)]
swap: fix wrong indentation

Change-Id: I95e53f4855ff04cf3241d997d2548e28d7cb3d37
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
3 years agoRelease 6.0.3 09/236209/1 accepted/tizen/unified/20200616.170900 submit/tizen/20200615.141410 submit/tizen/20200616.073101
Maciej Słodczyk [Mon, 15 Jun 2020 14:10:33 +0000 (16:10 +0200)]
Release 6.0.3

Change-Id: I5e84c4682e25a285dfa0b579530ad5db82c7cb23
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agosafe-kill: unit tests 77/235777/3
Maciej Słodczyk [Tue, 9 Jun 2020 15:34:42 +0000 (17:34 +0200)]
safe-kill: unit tests

Change-Id: I658e9e85aa57c2cdffc5ce0fa9a44bd28d5bbb28
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>
3 years agosafe-kill: prevent processes from being killed while dumping a core 96/235196/12
Maciej Słodczyk [Tue, 2 Jun 2020 12:58:56 +0000 (14:58 +0200)]
safe-kill: prevent processes from being killed while dumping a core

Change-Id: I24bd152f04b90b3b7b4f64d06561e2833cf3d130
Signed-off-by: Maciej Słodczyk <m.slodczyk2@partner.samsung.com>