platform/core/system/resourced.git
6 years agoSet the default DBus policy for send and own to deny 26/178726/1
Łukasz Stelmach [Fri, 11 May 2018 11:45:54 +0000 (13:45 +0200)]
Set the default DBus policy for send and own to deny

Change-Id: If607185a252fc7d15b603aeb8e0065c643631726
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
6 years agoFix heap-use-after-free error detected by Adress Sanitizer. 17/178117/1 submit/tizen/20180509.124204
Elmurod Talipov [Mon, 30 Apr 2018 02:50:11 +0000 (11:50 +0900)]
Fix heap-use-after-free error detected by Adress Sanitizer.

 - rt_task is released in proc_runtime_info_task_cb(), when
   proc_runtime_info_task() is called, and result is written to pipe.
   This happens before the thread is finished, which will create problem
   for accessing rt_task->task_name.

Change-Id: I8eea8e05aef80250d48a9046cdcc26a2681df3ae
Signed-off-by: Elmurod Talipov <e.talipov@samsung.com>
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
6 years agorelease : 0.5.3 27/171927/1 accepted/tizen/unified/20180313.162811 submit/tizen/20180308.070108
Kichan Kwon [Thu, 8 Mar 2018 07:00:04 +0000 (16:00 +0900)]
release : 0.5.3

Change-Id: I60c8344f159820b1499a92ee2b8afe41bec887b1
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoMerge remote-tracking branch 'origin/tizen_4.0' into tizen 19/171919/1
Kichan Kwon [Thu, 8 Mar 2018 06:07:35 +0000 (15:07 +0900)]
Merge remote-tracking branch 'origin/tizen_4.0' into tizen

Change-Id: I0802f410007bcb2ce798f640972a7840274447ce
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agomemory : ignore empty zone 06/171906/2
Kichan Kwon [Thu, 8 Mar 2018 05:54:04 +0000 (14:54 +0900)]
memory : ignore empty zone

- Some devices make a zone but don't allocate any pages for it
- In addition, fix divided by zero

Change-Id: Ifb11ce58384b0731706f5366a491ddb9f422fc90
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agovip : assign "System" exec label to enable access to "/sys/fs/cgroup/vip" 29/171329/1 accepted/tizen/4.0/unified/20180307.071414 submit/tizen_4.0/20180302.135759
Łukasz Stelmach [Thu, 1 Mar 2018 11:21:59 +0000 (12:21 +0100)]
vip : assign "System" exec label to enable access to "/sys/fs/cgroup/vip"

Change-Id: I6ad3ab3aec3c16410ebf92862b99dcaa50e20fe4
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
6 years agocommon: Fix off-by-one error in prog_find_match 61/168861/1 accepted/tizen/4.0/unified/20180228.140806 submit/tizen_4.0/20180228.071159
Paweł Szewczyk [Mon, 22 Jan 2018 16:45:41 +0000 (17:45 +0100)]
common: Fix off-by-one error in prog_find_match

Change-Id: I74743114e9fd8ce8975346aea5218c9696e770f3
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
6 years agoproc: Fix handling already terminated process 60/168860/1
Paweł Szewczyk [Mon, 22 Jan 2018 14:55:41 +0000 (15:55 +0100)]
proc: Fix handling already terminated process

There is no reason to allocate app info if main pid was terminated.

Change-Id: I2cb2c2568bd0a284caf0973fc84aa6124470b168
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
6 years agocommon: Fix off-by-one error in prog_find_match 84/167884/1 accepted/tizen/unified/20180130.055213 submit/tizen/20180129.125325
Paweł Szewczyk [Mon, 22 Jan 2018 16:45:41 +0000 (17:45 +0100)]
common: Fix off-by-one error in prog_find_match

Change-Id: I74743114e9fd8ce8975346aea5218c9696e770f3
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
6 years agoproc: Fix handling already terminated process 83/167883/1
Paweł Szewczyk [Mon, 22 Jan 2018 14:55:41 +0000 (15:55 +0100)]
proc: Fix handling already terminated process

There is no reason to allocate app info if main pid was terminated.

Change-Id: I2cb2c2568bd0a284caf0973fc84aa6124470b168
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
6 years agoRemove const from module_ops variable 30/163530/1 accepted/tizen/unified/20171212.064728 submit/tizen/20171212.021838
Kichan Kwon [Tue, 12 Dec 2017 02:09:54 +0000 (11:09 +0900)]
Remove const from module_ops variable

- .initialized will be modified

Change-Id: I4cefcf8dd8efcacbaf3e9023c726ae8e3366ebd4
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoRemove const from module_ops variable 24/163524/1 accepted/tizen/4.0/unified/20171212.064809 submit/tizen_4.0/20171212.021715 submit/tizen_4.0/20180202.144218 tizen_4.0.IoT.p2_release
Kichan Kwon [Tue, 12 Dec 2017 02:09:54 +0000 (11:09 +0900)]
Remove const from module_ops variable

- .initialized will be modified

Change-Id: I4cefcf8dd8efcacbaf3e9023c726ae8e3366ebd4
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agorelease : 0.5.2 53/162253/1 accepted/tizen/unified/20171130.113317 submit/tizen/20171130.023107
Kichan Kwon [Thu, 30 Nov 2017 02:23:59 +0000 (11:23 +0900)]
release : 0.5.2

Change-Id: I70f76fd7baba633add1433a3a464485b93f51342
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agotimer-slack : remove timer-slack module 59/159959/2
Kichan Kwon [Tue, 14 Nov 2017 02:44:21 +0000 (11:44 +0900)]
timer-slack : remove timer-slack module

Change-Id: If2f351cb27608f92e0b87fc3c3cf189b1dd7a316
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoMerge remote-tracking branch 'origin/tizen_4.0' into tizen 51/162251/1
Kichan Kwon [Thu, 30 Nov 2017 02:21:10 +0000 (11:21 +0900)]
Merge remote-tracking branch 'origin/tizen_4.0' into tizen

Change-Id: Ia8b39adc5b14870c9bf1a317180ca60196158023
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoFix contradictory package dependency 44/162244/1 accepted/tizen/4.0/unified/20171205.155502 submit/tizen_4.0/20171130.083142
Kichan Kwon [Thu, 30 Nov 2017 01:40:18 +0000 (10:40 +0900)]
Fix contradictory package dependency

Change-Id: I860504eaa4af53662d83554b402f6e35c3bc839c
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoproc-stat : replace proc-exclude to watchdog-exclude 03/160903/7 accepted/tizen/4.0/unified/20171130.063628 submit/tizen_4.0/20171129.083912 submit/tizen_4.0/20171129.102443
Kichan Kwon [Mon, 20 Nov 2017 09:56:15 +0000 (18:56 +0900)]
proc-stat : replace proc-exclude to watchdog-exclude

- To simplicate config files
- You can use fixed OOM not to control OOM score
- To exclude your app from watchdog, modify proc.conf

Change-Id: I0cf866a9789f9081b84b64705782f6accce5635a
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoproc-stat : block modifying the OOM-fixed app's score 42/159742/6
Kichan Kwon [Mon, 13 Nov 2017 01:45:42 +0000 (10:45 +0900)]
proc-stat : block modifying the OOM-fixed app's score

- We can't control widget's OOM score with existing mechanism
  because widget's score is modified not via set_foregrd(backgrd)
- For performance, make another hashtable using PID as the key

Change-Id: Ib89c84cf6062c0f4d73438b2425234422d2eb2b3
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agorelease : 0.5.1 40/159840/1 submit/tizen/20171113.074827 submit/tizen/20171113.075016 submit/tizen/20171113.081738
Kichan Kwon [Mon, 13 Nov 2017 07:37:13 +0000 (16:37 +0900)]
release : 0.5.1

Change-Id: I084ccf5ea4851018e616eed0e0ea12230ea252b5
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoproc-stat : introduce oom-fixed app 11/157111/4
Kichan Kwon [Mon, 23 Oct 2017 09:28:29 +0000 (18:28 +0900)]
proc-stat : introduce oom-fixed app

- Predefine in proc.conf
- It's oom_score_adj will be fixed without fg/bg status

Change-Id: Id87ea6280c4932db904fb1d40eaf6b7b5327c4e5
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoDetach block, freezer, and swap from resourced-light 35/159535/1
Kichan Kwon [Thu, 9 Nov 2017 11:40:48 +0000 (20:40 +0900)]
Detach block, freezer, and swap from resourced-light

Change-Id: I5c29e903a58c5d32c9f6a994388e39e335e0d864
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoMerge branch 'tizen_4.0' into tizen 79/157379/1
Kichan Kwon [Tue, 24 Oct 2017 07:06:12 +0000 (16:06 +0900)]
Merge branch 'tizen_4.0' into tizen

Change-Id: Ib26523597f897350c7817ab8c5559121983252d6
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agomemory : build resourced-config-tv package 04/156604/1 accepted/tizen/4.0/unified/20171020.014703 submit/tizen_4.0/20171019.080409 tizen_4.0.m2_release
Kichan Kwon [Thu, 19 Oct 2017 05:49:28 +0000 (14:49 +0900)]
memory : build resourced-config-tv package

- Configuration file for TV profile
- In current, TV profile disables memory compaction and memlimit

Change-Id: I3b86704b1cf055f0724d405843c1b03b5432c763
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agomm: compact: Add memory compaction module 76/155376/2 accepted/tizen/4.0/unified/20171019.081849 submit/tizen_4.0/20171018.094512
ByungSoo Kim [Mon, 21 Nov 2016 04:47:26 +0000 (13:47 +0900)]
mm: compact: Add memory compaction module

External fragmentation tracking module triggering
system-wide compaction case the fragmentation level
indicates possible failures of potential high-order
allocations.

Below are presented *rough* stats for similar workload
for both cases: compaction module being disabled and enabled.
Those are only to give a generic overview of potential benefits
of triggering memory compaction from user-space.
Note that those are based on kprobes and may have some
shortcomings.

Change-Id: Id4ec3a9ccd552eee02018a563746abd404029f35
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
[Rebase, fix svace issue]
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agocommon : check SMACK and privilege before running D-Bus signal handler 57/152057/8
Kichan Kwon [Fri, 15 Sep 2017 10:50:15 +0000 (19:50 +0900)]
common : check SMACK and privilege before running D-Bus signal handler

- To block malicious request
  - e.g. Send freezer signal for the app being in foreground
- In addition, modify the privilege for ProcSweep
  - Wearable home app has the code about sending this signal
  - Although it doesn't send currently, but if it send someday,
    we have to control with setting platform privilege

Change-Id: I7f260db24df31679514f00dbeb080e00979f42f9
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agomemory : consider sysinfo.mem_unit to get memory size 36/154936/4
Kichan Kwon [Wed, 11 Oct 2017 11:28:46 +0000 (20:28 +0900)]
memory : consider sysinfo.mem_unit to get memory size

- If (RAM + swap) size is larger than 4G, sysinfo.mem_unit
  is set to more than 1
- In this case, overflow can occur. So we have to use
  larger variable for storing memory size

Change-Id: Idf8e0ceade0596423a7d800e3db134391ced6ff0
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agomemory : remove setting memory limit for foreground app 05/154905/1
Kichan Kwon [Wed, 11 Oct 2017 11:07:28 +0000 (20:07 +0900)]
memory : remove setting memory limit for foreground app

- After vmpressure refactoring, foreground cgroup is removed

Change-Id: I3bb107bbe3f2ed8d348e4861773464eb9cd9edef
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoFix always true statement 71/152671/2 accepted/tizen/4.0/unified/20170927.181814 submit/tizen_4.0/20170927.011024 tizen_4.0.IoT.p1_release
Kichan Kwon [Wed, 27 Sep 2017 01:02:29 +0000 (10:02 +0900)]
Fix always true statement

Change-Id: Ia7ed847a5755109743f913065c035b7b7bb02830
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
6 years agoFix minor issues 48/152448/3 submit/tizen_4.0/20170926.084635
Kichan Kwon [Tue, 26 Sep 2017 07:20:27 +0000 (16:20 +0900)]
Fix minor issues

- Prevent to access out of array
- Use larger constant for shifting more than 32
- Free before exit

Change-Id: I0297f8dca302148430332c521629ff0f14323536
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agocommon : check SMACK label before running D-Bus signal handler 12/150412/3
Kichan Kwon [Fri, 15 Sep 2017 10:50:15 +0000 (19:50 +0900)]
common : check SMACK label before running D-Bus signal handler

- To block malicious request
  - e.g. Send freezer signal for the app being in foreground
- In addition, modify the privilege for ProcSweep
  - Wearable home app has the code about sending this signal
  - Although it doesn't send currently, but if it send someday,
    we have to control with setting platform privilege

Change-Id: I7f260db24df31679514f00dbeb080e00979f42f9
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoSet the maximum input length 09/150709/1 accepted/tizen/4.0/unified/20170920.081626 submit/tizen_4.0/20170918.094512
Kichan Kwon [Mon, 18 Sep 2017 09:35:40 +0000 (18:35 +0900)]
Set the maximum input length

Change-Id: Id2f2ab716502e815636abc80e926e52ed2de21dd
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoDetach block module from resourced-light 21/147921/1 accepted/tizen/unified/20170907.060521 submit/tizen/20170906.065233
Kichan Kwon [Wed, 6 Sep 2017 05:19:31 +0000 (14:19 +0900)]
Detach block module from resourced-light

- Resourced-light will do only resource management

Change-Id: Icd1a5f006dda418fed6a586ce222292673c60f83
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agovip : restore vip-agent module 15/147915/1 accepted/tizen/4.0/unified/20170907.195935 submit/tizen_4.0/20170907.022036
Kichan Kwon [Wed, 6 Sep 2017 03:19:35 +0000 (12:19 +0900)]
vip : restore vip-agent module

- Faultd is excluded in Tizen 4.0
- In addition, apply ASLR with vip-release-agent

Change-Id: Ib636105377cef708621e6de72d8cc936960620f2
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoChange SMACK label to System 89/144989/3 accepted/tizen/4.0/unified/20170829.020402 accepted/tizen/unified/20170823.031728 submit/tizen/20170822.105330 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004
Kichan Kwon [Mon, 21 Aug 2017 01:21:13 +0000 (10:21 +0900)]
Change SMACK label to System

- System::Privileged is used to modify SMACK label
- Resourced doesn't modify

Change-Id: Ice91ad826515d84648a2df1a8afcdf95ac757092
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoscripts : remove upgrade script 53/143453/4
Kichan Kwon [Thu, 10 Aug 2017 04:19:43 +0000 (13:19 +0900)]
scripts : remove upgrade script

- No more support 2.4 -> 3.0 upgrade

Change-Id: Ia2849ab3af17ca3561bb8d86ff493c34776e9f90
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoFix minor issues 24/142424/10
Kichan Kwon [Thu, 3 Aug 2017 09:29:03 +0000 (18:29 +0900)]
Fix minor issues

Change-Id: I9a02a8840542e319abcef63abbc2f8e61f113593
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoMerge "Heart: Fixed memory leak in heart_cpu_get_appusage_list()" into tizen
Kwon [Fri, 4 Aug 2017 08:04:27 +0000 (08:04 +0000)]
Merge "Heart: Fixed memory leak in heart_cpu_get_appusage_list()" into tizen

7 years agomemory: remove redundant operations 55/137655/11 submit/tizen/20170803.075349
ByungSoo Kim [Tue, 28 Mar 2017 05:56:18 +0000 (14:56 +0900)]
memory: remove redundant operations

Resourced will search all cgroup directories about systemd slice.
It is necessary to optimize the function lowmem_reassign_limit
by removing redundant codes.

Change-Id: Ica62829f18e4ade4394d88de7008c37ffcb4279b
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agomemory: follow kernel condition during chaning memory limit 54/137654/8
ByungSoo Kim [Thu, 16 Mar 2017 02:07:01 +0000 (11:07 +0900)]
memory: follow kernel condition during chaning memory limit

Kernel always compares new value with memswlimit.
So, if new value is smaller than memswlimit, memlimit should be set at first.
Otherwise, memswlimit should be set before setting memlimit.

++ mem_cgroup_resize_limit
if (memswlimit < val)
ret = -EINVAL;

++ mem_cgroup_resize_memsw_limit
if (memlimit > val)
ret = -EINVAL;

Change-Id: Ia0b848b0a2266f740f1c196cb7d089a80b77ec63
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agomemory : free old entry when memory limit is re-assigned 54/142254/1
Kichan Kwon [Thu, 3 Aug 2017 07:08:37 +0000 (16:08 +0900)]
memory : free old entry when memory limit is re-assigned

- Define destroy function to free automatically

Change-Id: Id3e511f7a794e99673a32857b67f7c149f780659
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agomemory: control memory limit in user space. 52/137652/10
ByungSoo Kim [Tue, 10 Jan 2017 11:13:50 +0000 (20:13 +0900)]
memory: control memory limit in user space.

Both kernel and system supported to register memory events for memcg.
But it had some problems that it can't check swap usage and notify which
application has a problem.

This patch introduces that all systemd services and desired applications
can register memory limit evenat with swap usage
and the resourced can kill a process which has a memory leak with a
popup and log files.
And all service application can't spend memory above 100MB.
Resourced will make crash popup for debugging in ENG binary or kill them
silently in USR binary.

Memory limit can support three kinds of configration.
1. threshold : resourced increases memory limit of kernel memcg.
    But instead, it registers threshold event.
    When kernel detects and notify threshold event,
    resourced finds a victim application and kills it with logs.
2. oom : If resourced can control the sysfs node of memcg oom_control,
    it can collect more debug informations when it exceeds memory limitation.
    Of course, it can be supported when only kernel allows to disable oom in user space.
    Otherwise, there is no difference between MEM_LIMIT_NONE and MEM_LIMIT_OOM.
3. other values : resourced registers the swap memory limit with normal memory limit.
    It doesn't register any memcg event.
    And it leaves everything about controlling memcg oom to kernel.

Change-Id: I6767183bb87964c8b5709503ee1288eaf6de5f42
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
[Rebase]
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoHeart: Fixed memory leak in heart_cpu_get_appusage_list() 00/140700/2
“JIBAN [Wed, 26 Jul 2017 06:06:19 +0000 (11:36 +0530)]
Heart: Fixed memory leak in heart_cpu_get_appusage_list()

[Model] COMMON
[BinType] AP
[Customer] OPEN

[Issue#] NA
[Request] NA
[Occurrence Version] NA

[Problem]  Memory Leak. app_lists was freed in error case
[Cause & Measure] Fixed memory leak
[Checking Method] NA

[Team] system framework
[Developer] Jiban Prakash
[Solution company] Samsung
[Change Type] Change

Change-Id: I3356bcd2517ea79dd7f60f0470658e8ee8244d50
Signed-off-by: “JIBAN <p.jiban@samsung.com>
7 years agocommon : explain why resourced doesn't use g_dbus_method_return_error 38/137438/7
Kichan Kwon [Thu, 6 Jul 2017 02:18:33 +0000 (11:18 +0900)]
common : explain why resourced doesn't use g_dbus_method_return_error

- cf) Process resource usage functions use return_error because
     it is only for Runtime-info (we can control this package)

Change-Id: Ia5ce23367ee4273eeca2b59c80096892fc1a6bb7
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoproc-stat : clarify process resource usage functions. 19/137219/7
Kichan Kwon [Mon, 3 Jul 2017 10:33:19 +0000 (19:33 +0900)]
proc-stat : clarify process resource usage functions.

- Specify reply signature
- Return error when it is failed

Change-Id: I960bfaadb2bbfc202adab516efb12d6ee9fc3212
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agomemory : set internal functions to static 76/138676/1 accepted/tizen/4.0/unified/20170816.011910 accepted/tizen/4.0/unified/20170816.015007 accepted/tizen/unified/20170717.021100 submit/tizen/20170713.073149 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0_unified/20170814.115522
Kichan Kwon [Thu, 13 Jul 2017 07:26:40 +0000 (16:26 +0900)]
memory : set internal functions to static

Change-Id: I18844ccd5275ca80dd162b09748b016ae755750d
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agovip : remove vip-agent module. 18/137218/3
Kichan Kwon [Wed, 5 Jul 2017 02:16:05 +0000 (11:16 +0900)]
vip : remove vip-agent module.

- Faultd will work this function

Change-Id: I5303d2353545c2cfae2e9d79bee8479b422d6676
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agomemory: reclaim memory when there is no high order buddy in kernel 56/131456/4
ByungSoo Kim [Wed, 26 Apr 2017 13:31:30 +0000 (22:31 +0900)]
memory: reclaim memory when there is no high order buddy in kernel

Even though there is enough memory, kswapd uses much cpu
when there is no high order buddy.
We have already triggered memory compaction.
But, if many background applications are running,
kernel can't reduce fragmentation.
The best method for reducing kernel fragmentation is
to run proactive LMK in resourced.

For example, when automatic test tool launched many applications continuously,
there were so many background applications over 24 numbers
and we could observe kswapd always used 5% cpu in order to reclaim memory
until available memory was not enough in medium threshold.

Therefore it is necessary to check buddy info and start proactive LMK.
It has been already applied in low memory device and we got better result.
Moreover, it will be better in even high memory device also.

Change-Id: Ibb888a73e2185c35aae3025e2a8e210885acfaae
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoproc: add /proc/buddyinfo parse api 54/131454/2
ByungSoo Kim [Wed, 26 Apr 2017 13:26:20 +0000 (22:26 +0900)]
proc: add /proc/buddyinfo parse api

Resourced needs to know current buddy information.
When there is no high order buddy in kernel,
it makes sluggish issue due to high cpu consumption of kswapd.

Change-Id: I173e5d4e43a842be713788372d55feb61ce65cf6
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agomemory : don't clear logs when the directory path is too long 83/133883/4
Kichan Kwon [Wed, 14 Jun 2017 01:15:37 +0000 (10:15 +0900)]
memory : don't clear logs when the directory path is too long

Change-Id: Iabed7123bdf03cabc381ed16f0a0b983fb627090
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoUse the string copy function having maximum limit 24/132824/2 accepted/tizen/unified/20170608.185103 submit/tizen/20170608.101022
Kichan Kwon [Thu, 8 Jun 2017 02:00:25 +0000 (11:00 +0900)]
Use the string copy function having maximum limit

- To prevent from making non-terminated string
- strcpy -> strncpy
- sprintf -> snprintf

Change-Id: I0c01ff4e25bceb943c3ade45f9fa5bacd6c9209b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoLimit the maximum input string length of sscanf 66/132566/6
Kichan Kwon [Wed, 7 Jun 2017 02:47:50 +0000 (11:47 +0900)]
Limit the maximum input string length of sscanf

- If there is no limit, sscanf can write the out of array's bound
- To make format specifier setting limit to macro, define STR_FS(macro)

Change-Id: I800112b37386192708db26f0b009f3a40a5fbb07
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoOpen proc D-Bus methods for non-root having systemmonitor privilege 62/131062/3 accepted/tizen/unified/20170602.152125 submit/tizen/20170531.011833
Kichan Kwon [Thu, 25 May 2017 08:11:20 +0000 (17:11 +0900)]
Open proc D-Bus methods for non-root having systemmonitor privilege

Change-Id: I527e37b4778be9d45a1ade41423dcb24ac68e41f
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoClean up unneceassry build dependency 72/130972/1
Kunhoon Baik [Wed, 24 May 2017 23:54:59 +0000 (08:54 +0900)]
Clean up unneceassry build dependency

Change-Id: Iaff85867cb0d5887de1335b5eb031f100b23907a

7 years agoHeart: Remove the mechanism which removes logging-data from Heart DB by explict data... 53/130953/1
Kunhoon Baik [Wed, 24 May 2017 12:45:00 +0000 (21:45 +0900)]
Heart: Remove the mechanism which removes logging-data from Heart DB by explict data-query

In Tizen 3.0 and Early Tizen 4.0, we observed whether there are some requirements for deleting logging-data explictly.

Meanwhile, the logging functions like logging_get_latest_in_cache,logging_read_foreach has been used for several purposes.
However, there are some bugs that the logging functions do not consider such deleting data cache entries in module cache.
Thus, our plan was to improve the functions if there are some requirement for deleting logging-data explictly.

However, there are no requirements about it.
Thus, finally, we decided to remove the explict logging-data removing mechanism because there are no use cases.

Thus, from now, data of heart DBs will be removed according to just impliict(internal) rule.
That is, in this time, the old data is removed automatically when the DB size limit is reached.

Change-Id: Ief4cf1baa595030fddd6becd929165ee4857e8bb

7 years agoswap : remove const at module_ops variable 98/130898/1
Kichan Kwon [Wed, 24 May 2017 09:23:16 +0000 (18:23 +0900)]
swap : remove const at module_ops variable

- .initalized will be modified

Change-Id: I21626a1c5732dc156978007024a64ceb3a0127ec
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoheart : delete after collecting candidates to prevent deadlock 28/130828/3
Kichan Kwon [Wed, 24 May 2017 00:44:38 +0000 (09:44 +0900)]
heart : delete after collecting candidates to prevent deadlock

- Both read_foreach and logging_delete locks cache mutex
- Therefore, logging_delete should be called after read_foreach
 is ended

Change-Id: I4a34fc4a26bc27e1739f1cfa4ce7331ed1fcab3b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoproc: get approximate memory usage from /proc/{pid}/statm 82/130482/1
ByungSoo Kim [Tue, 2 May 2017 11:53:40 +0000 (20:53 +0900)]
proc: get approximate memory usage from /proc/{pid}/statm

Considering RSS and Shared of statm is more accurate than using the ratio for RSS.
And, there are many apis for getting memory usage in procfs.
Of course, resourced should know all kinds of memory information
depending on the situations.

For instance, when LMK predicts secured memory usage after killing victims,
it should check real ram usage which considers zram compression ratio.
On the other hand, if someone wants to know memory usage,
it can check approximate memory usage from /proc/{pid}/statm
and swap usage from /proc/{pid}/status.

Conflicts:
src/memory/lowmem-limit.c

Change-Id: I7e664ff40f05fa9c1d8122be64180e5e7a8fab77
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agomemory: trigger proactive oom killer based on heart memory 74/130474/1
ByungSoo Kim [Wed, 26 Apr 2017 13:10:30 +0000 (22:10 +0900)]
memory: trigger proactive oom killer based on heart memory

We haven't yet enabled history based proactive LMK
because heart memory makes an overhead.
But, previous patches as well as this reduced an overhead and simplied.
Now, we can check average memory usage and trigger proactive LMK
when application is launched.

Conflicts:
src/memory/vmpressure-lowmem-handler.c

Change-Id: Id83ca0b3517d6ae73ee1a8713096cfae8516a254
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agoheart: calculate memory usage of child processes if it is available 70/130470/2
ByungSoo Kim [Wed, 26 Apr 2017 13:06:26 +0000 (22:06 +0900)]
heart: calculate memory usage of child processes if it is available

Many applications have child processes when they are groupped together
for instance browser.
If resourced logs exact memory usage, it has to check child processes too.

Change-Id: I1ecae490d679de1d8ef0d1bb26796d2ea3874e33
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agoheart: remove decision memory in heart-memory 68/130468/1
ByungSoo Kim [Tue, 25 Apr 2017 11:37:16 +0000 (20:37 +0900)]
heart: remove decision memory in heart-memory

We haven't ever enabled both heart-memory and decision-memory.
Further, heart-memory will support accumulated application memory usages
and other modules or services can reference this information.
However, decision memory based on heart isn't still unstable
because we can't decide whether some application is malicious or not
how much memory it uses.
Of course, if we collect more information and check others such as LMK pattern,
we can enable decision memory again.
But not now.

Change-Id: I7b7c80dfc5218823cf05ff2e80a0c327bfad28d6
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agoheart: simplify heart memory module 63/130463/1
ByungSoo Kim [Tue, 25 Apr 2017 11:30:43 +0000 (20:30 +0900)]
heart: simplify heart memory module

Getting USS and PSS from smaps of each application is big overhead
whenever application goes to the background state.
It is enough to check RSS of application in order to provide application memory usage.

Conflicts:
src/heart/heart-memory.c

Change-Id: Ie50c00910f20da522a49f1fc3ebf31f5b5647c99
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agoPreparation to providing process memory information at OOM situation 51/130451/1
Kunhoon Baik [Mon, 22 May 2017 09:56:25 +0000 (18:56 +0900)]
Preparation to providing process memory information at OOM situation

The memory information log may be useful when some process is killed in high memory pressure.
However, we did not yet decide when the information is provided.
This patch is just preparation for such purpose.

Note : This functionality is originated from Mr.ByungSoo Kim.

Change-Id: Id1b3a7d2cebd07ac00548cc80f9e27061c738bfe

7 years agomemory: make generic api for getting rss 37/130437/1
ByungSoo Kim [Tue, 18 Apr 2017 11:18:57 +0000 (20:18 +0900)]
memory: make generic api for getting rss

Other modules also need to get RSS
because it is faster than checking smaps.

Change-Id: I4af8207cf57ae47c8ba66177770a012a02d6566a
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agomemory: don't search smaps for calculating uss 33/130433/2
ByungSoo Kim [Mon, 9 Jan 2017 04:52:09 +0000 (13:52 +0900)]
memory: don't search smaps for calculating uss

In oom situation, it needs to kill victim applciations as soon as
possible.
However, searching smaps for getting uss value takes a long time about
50 ~ 100ms per application.
It is not necessary for lowmem handler to check memory status.
But instead, RSS is not exact value about real memory usage even though
it is fast to get.
So heuristic weight factors should be considered.

Conflicts:
src/memory/vmpressure-lowmem-handler.c

Change-Id: I8381094afc3ba6420068c0adff82280e67031931
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agoFix memory issues 93/130393/1 accepted/tizen/unified/20170522.185658 submit/tizen/20170522.085130 tizen_4.0.m1_release
Kichan Kwon [Mon, 22 May 2017 07:13:12 +0000 (16:13 +0900)]
Fix memory issues

Change-Id: I9313053711593b4a202b018f83827042aa676b65
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoRevert "Version up" 85/130385/1
Kwon [Mon, 22 May 2017 07:13:28 +0000 (07:13 +0000)]
Revert "Version up"

This reverts commit 6a7ef2e939783b1c8197fada0e96ec63a942e585.

Change-Id: I1ac024fec44f234144156c442ee7719154f6b344

7 years agoVersion up 68/130368/1
Kichan Kwon [Mon, 22 May 2017 06:41:54 +0000 (15:41 +0900)]
Version up

Change-Id: Ia7d1c31402c049937e5b32f042edb9ac11091a3a
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agocommon: flush cache memory 21/130321/1
ByungSoo Kim [Mon, 9 Jan 2017 08:08:40 +0000 (17:08 +0900)]
common: flush cache memory

Flush resourced memory such as other processes.
Resourced can use both many fast bins and sqlite3 cache memery.
It can be increased over 10MB while running applications continuously for a long time.

Change-Id: If59758ccd81f6a9c656760fc800e8f88c1403832
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agoproc: don't increase reference count of app-info 83/130283/2
ByungSoo Kim [Wed, 5 Apr 2017 12:57:05 +0000 (21:57 +0900)]
proc: don't increase reference count of app-info

The function proc_create_app_info can be called multiple times.
If it increases reference count of app-info continuously,
app-info is never released after application has been already terminated.

Change-Id: I614c7526e228ceb260d7f0b7c95888288b237ecb

7 years agoproc: increase default oom score about widget applications 82/130282/2
ByungSoo Kim [Tue, 21 Feb 2017 05:18:17 +0000 (14:18 +0900)]
proc: increase default oom score about widget applications

Most widget applications are prelaunched while booting.
But if user can't select them, oom score is not changed.
When resourced meets the out of memory situation,
it is hard to select widget applications to victims.

Change-Id: Iecac6181ba7973355128c557085e476c6f8e72d0
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
7 years agoClean up remained Dbus-1 related codes 78/130278/3
Kunhoon Baik [Sat, 20 May 2017 04:52:11 +0000 (13:52 +0900)]
Clean up remained Dbus-1 related codes

Clean up codes, makefile and specfile to remove dbus-1 dependency

Change-Id: Idd75e3395fff79697010b49ac418d41967a898c7

7 years agoBug Fix to original behavior 10/130210/8
Kunhoon Baik [Fri, 19 May 2017 10:50:32 +0000 (19:50 +0900)]
Bug Fix to original behavior

During migration to gdbus, there are some bugs changing communication behaviors.
This patch fixes such bugs

In addition, following issues also are solved.
a) variable uninitilization for checking dbus param error
b) memory leak

Change-Id: I1f89cf761fced330cb90a24e823d31f0a68d74b5

7 years agoFix gdbus related issues 78/130178/2 accepted/tizen/unified/20170519.200634 submit/tizen/20170519.102149
Kichan Kwon [Fri, 19 May 2017 09:35:08 +0000 (18:35 +0900)]
Fix gdbus related issues

- Modify return argument type
- Fix method table overlapping
- Add missing return argument type

Change-Id: I10958b275c05f81b8f23fd3ca44fb6485f884b75
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoFix memory issues 93/130093/3
Kichan Kwon [Fri, 19 May 2017 06:06:49 +0000 (15:06 +0900)]
Fix memory issues

Change-Id: Ic8cc351686234e39937c9e972c351385b46bd665
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoheart : remove pipe and fd handler for SyncCpuData 13/130113/1
Kichan Kwon [Fri, 19 May 2017 07:00:08 +0000 (16:00 +0900)]
heart : remove pipe and fd handler for SyncCpuData

- Main thread has replied message because libdbus is not thread-safe
- However, we are using gdbus, so other thread can reply directly

Change-Id: I06325194791203d9c917047e873330f4fad51650
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agomemory : remove dynamic oom threshold 48/126848/6
Kichan Kwon [Tue, 25 Apr 2017 06:51:50 +0000 (15:51 +0900)]
memory : remove dynamic oom threshold

- It is introduced to prevent killing foreground app frequently
- But now, it isn't handled; this value is always fixed.
- What's more, resourced has been improved that it doesn't kill
 foreground app frequently

Change-Id: I8d1affb409030cb1a1d4f07ac2a8abceb32dc123
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoArrange exclude list 95/121895/8
Kichan Kwon [Wed, 29 Mar 2017 09:47:18 +0000 (18:47 +0900)]
Arrange exclude list

- Remove not used app in Public Tizen
- Use org.tizen.XXX instead of com.samsung.XXX

Change-Id: I97a38fb07d726c440bc60583c4200a293875dc25
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoheart : flush and print data when charging is started 81/121581/8
Kichan Kwon [Tue, 28 Mar 2017 08:52:17 +0000 (17:52 +0900)]
heart : flush and print data when charging is started

- Flush condition : cap(last_charge_is_ended) - cap(cur) > 10

Change-Id: I11ab67f16abeca8bc9d326bf1b5cc581b4d88157
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoheart : use root's pid for logging instead of process' 01/121401/8
Kichan Kwon [Tue, 28 Mar 2017 02:32:56 +0000 (11:32 +0900)]
heart : use root's pid for logging instead of process'

Change-Id: I536a50eb6b3cfce05fc84bd78d7ccaaededa527b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoproc-stat : no more use cleanup macro if the function can be ended before opening... 19/121219/8
Kichan Kwon [Mon, 27 Mar 2017 08:46:21 +0000 (17:46 +0900)]
proc-stat : no more use cleanup macro if the function can be ended before opening proc_app_list

- cleanup_app_list_close macro decreases reference counter
- Therefore, this macro should be called after proc_app_list is opened
- In this case, we will not use this macro

Change-Id: I66a074523543e9791c61a718e1530836189f9714
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoproc-stat : record app's starttime and use it for getting cpu usage 16/121216/6
Kichan Kwon [Mon, 27 Mar 2017 07:41:02 +0000 (16:41 +0900)]
proc-stat : record app's starttime and use it for getting cpu usage

- In previous approach, starttime is gotten from /proc/{pid}/stat
- But, this value can't guarantee time delta with current uptime
  - In case of multicore environment
- Therefore, we will use the uptime when app is launched

- To use uptime to starttime, we will store this time

Change-Id: I86dab9bc261012686a1e92ed7c2b2bd3fdf5be47
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoVersion up 13/130013/1 submit/tizen/20170519.013701
Kichan Kwon [Fri, 19 May 2017 00:54:56 +0000 (09:54 +0900)]
Version up

Change-Id: Ibbb86b13a10adb2102b085d22016eacbed9fe061
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoReplace libdbus to gdbus 56/128656/7
Kichan Kwon [Tue, 2 May 2017 09:22:31 +0000 (18:22 +0900)]
Replace libdbus to gdbus

- For unification with other system modules using gdbus

- NOTICE : to use freezer, you must use latest libsystem-freezer

Change-Id: I28853c2065cddbb4a00674302d17670c6fc566ff
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoswap : make module to build without error 56/120356/10
Kichan Kwon [Wed, 22 Mar 2017 11:04:21 +0000 (20:04 +0900)]
swap : make module to build without error

- Until now, swap module is not concerned (just disabled)
- However, it can be used vaulable in low memory
- In addition, it checks whether kernel supports force reclaim or not
  - Regardless of force reclaim, you can use swap module

Change-Id: I3c6c41e3f40b5a1293bad91cfd3d628c148c9e36
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoRemove ecore dependency 53/125253/11
Kichan Kwon [Tue, 11 Apr 2017 01:35:15 +0000 (10:35 +0900)]
Remove ecore dependency

- For resourced to be lighten

- Instead, we will use glib and libdbus
  - ecore_fd_handler -> fd-handler (based on GIO)
  - ecore_timer -> GSource (g_timeout)
  - ecore_main_loop -> g_main_loop
  - edbus -> libdbus (it is lighter than gdbus)

Change-Id: I85f0cdd0ca83438226d335a7860acea9e6ad4fb7
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoproc-stat : move something used by other modules to common header 78/125178/8
Kichan Kwon [Fri, 14 Apr 2017 05:07:07 +0000 (14:07 +0900)]
proc-stat : move something used by other modules to common header

Change-Id: Icd6c565e2306396af726a77f56515619c1c2bf9d
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoAllow building without memory module 44/124244/7
Kichan Kwon [Tue, 11 Apr 2017 02:12:07 +0000 (11:12 +0900)]
Allow building without memory module

- proc-stat uses the function of memory module, so build is failed
 when memory module is disabled

- memory.conf will be included only if memory module is enabled

Change-Id: I58b7e250f9fed3774d606dd7ba8fd12b57ef6b9b
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoproc-stat : no more freeze app soon after it goes to the background state 88/126388/2 accepted/tizen/unified/20170425.044936 submit/tizen/20170424.051821
Kichan Kwon [Fri, 21 Apr 2017 07:09:39 +0000 (16:09 +0900)]
proc-stat : no more freeze app soon after it goes to the background state

- We want to give a time for apps to prepare for being frozen
- The app going to the background a moment ago will skip this process

Change-Id: Ib9f453beb6a96865e424651055318dec695887bc
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoUse %license macro 32/126132/1 accepted/tizen/unified/20170421.042209 submit/tizen/20170421.010936
Kichan Kwon [Thu, 20 Apr 2017 07:48:08 +0000 (16:48 +0900)]
Use %license macro

Change-Id: Id55a24875a0e34fcd9cfe00abad819b330093e04
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoCheck valid range 88/125788/2 accepted/tizen/unified/20170419.165410 submit/tizen/20170419.094909
Kichan Kwon [Wed, 19 Apr 2017 01:15:31 +0000 (10:15 +0900)]
Check valid range

- Use snprintf instead of sprintf
- Check positive pid and pgid

Change-Id: I147fb011bbfe3350c1aa57070d61d3de3771d99f
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agomemory : remove "const" from memory_modules_ops 50/125450/1 accepted/tizen/unified/20170418.072908 submit/tizen/20170417.083520
Kichan Kwon [Mon, 17 Apr 2017 08:23:47 +0000 (17:23 +0900)]
memory : remove "const" from memory_modules_ops

- Every module_ops.initalized is modified after their init is called

Change-Id: Iee0b55655c1e335c1c1aba5b953fbe266e0f799e
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agomemory : use size_t instead of int 02/123302/1 accepted/tizen/unified/20170406.055123 submit/tizen/20170405.073013
Kichan Kwon [Wed, 5 Apr 2017 07:13:47 +0000 (16:13 +0900)]
memory : use size_t instead of int

- To pass argument with resourced_notify, you should cast to (void *)
- However, in 64bit architecture, build is failed because
 the size of (int) and (void *) is different

Change-Id: Ic7750e292b711777a31b9e80058baaff2b57dee4
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoIncrease release number 82/123182/1 submit/tizen/20170405.012656
Kichan Kwon [Wed, 5 Apr 2017 01:35:06 +0000 (10:35 +0900)]
Increase release number

Change-Id: I7eaeab83e74d769081b46fa84de453498d3da6cf
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoMerge "Revert "No more unmount cgroup directory before power off"" into tizen
Kwon [Wed, 5 Apr 2017 01:33:14 +0000 (18:33 -0700)]
Merge "Revert "No more unmount cgroup directory before power off"" into tizen

7 years agoRevert "No more unmount cgroup directory before power off" 53/122753/3
Kunhoon Baik [Mon, 3 Apr 2017 09:03:45 +0000 (02:03 -0700)]
Revert "No more unmount cgroup directory before power off"

This reverts commit e76a114e90e33a78408f5c04ad2eb35aca5b90d1.

This commit should be reconsidered
because systemd unit file cannot distinguish
between power-off SIGTERM and normal SIGTERM.

For example, deviced sends SIGTERM
when a process do not close fd using a file in SD-CARD
during the SD-card is removed / unmounted.
Deviced also sends SIGTERM during a power-off for unmounting /opt/usr.

Thus, a process cannot distiguish the situation with systemd unit.

As a result,
another solution for stopping service-restart during power-off
should be considered. (like modifying systemd or faultd)

Until the time, resourced's original solution should be kept.

cf) Solving the power-off animation problem,
    deviced should wait to start "power-off animation service".

Change-Id: I5f271a427109cdf26847411f8dc1cea91742d2f9

7 years agomemory : LMK refactoring. 38/99838/16
Kichan Kwon [Mon, 21 Nov 2016 09:19:23 +0000 (18:19 +0900)]
memory : LMK refactoring.

- Find victims not in the memory cgroup but proc_app_list
- Make LMK worker in thread and resourced requests reclaim with enqueue
- Unify (eng/user) conf files
- Restore memcg when resourced is restarted
- Apply new cgroup hierarchy
  "/"             : root cgroup
  "/Apps"         : all apps and services managed by Tizen
  "/MemLimit"     : apps with set memory limit
  "/Swap"         : swapped and reclaimed (if swap module is enabled)
  "/system.slice" : services managed by systemd

Change-Id: I7ef459ad98ad9c765897fd2e4d8593e006c43a32
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoFix memory issues 43/122443/3 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170331.152911 accepted/tizen/ivi/20170331.130515 accepted/tizen/mobile/20170331.130425 accepted/tizen/tv/20170331.130442 accepted/tizen/unified/20170331.130530 accepted/tizen/wearable/20170331.130456 submit/tizen/20170331.103559
Kichan Kwon [Thu, 16 Feb 2017 05:09:39 +0000 (14:09 +0900)]
Fix memory issues

Change-Id: I2186547b4207c8313e0a269617840a86c5d15789
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agocpu : no more restrict CPU usage of media service app 48/120348/2
Kichan Kwon [Wed, 22 Mar 2017 10:19:57 +0000 (19:19 +0900)]
cpu : no more restrict CPU usage of media service app

- Media service apps can make a sound in background
- If these apps use limited CPU usage, sound distortion can be occurred
- Apps having media bg category will not be restricted

Change-Id: I9a6c1efc1e2169a1ccb0da6f61891837521feeef
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoheart : remove unused static const variable 58/118158/1 accepted/tizen/common/20170309.175527 accepted/tizen/ivi/20170309.072616 accepted/tizen/mobile/20170309.072528 accepted/tizen/tv/20170309.072545 accepted/tizen/unified/20170310.080531 accepted/tizen/wearable/20170309.072558 submit/tizen/20170309.064503 submit/tizen_unified/20170310.011402
Kichan Kwon [Thu, 9 Mar 2017 05:00:21 +0000 (14:00 +0900)]
heart : remove unused static const variable

- Before gcc6, not used static const variable isn't be warned
- But, gcc6x compiler introduces -Wunused-const-variable with returning error

Change-Id: I85fc2615cf6e6b4b8421e00d3da7fdd8e90b2a05
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoheart : insert table after making 76/117676/1
Kichan Kwon [Tue, 7 Mar 2017 05:41:29 +0000 (14:41 +0900)]
heart : insert table after making

- This routine is for multi-user scenario (new user is added)

Change-Id: I33078113aef6d14382c910259930abb28d0dcd47
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>