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>
Ł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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
“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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Kunhoon Baik [Wed, 24 May 2017 23:54:59 +0000 (08:54 +0900)]
Clean up unneceassry build dependency
Change-Id: Iaff85867cb0d5887de1335b5eb031f100b23907a
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
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
Kwon [Mon, 22 May 2017 07:13:28 +0000 (07:13 +0000)]
Revert "Version up"
This reverts commit
6a7ef2e939783b1c8197fada0e96ec63a942e585.
Change-Id: I1ac024fec44f234144156c442ee7719154f6b344
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>
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>
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
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>
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Kwon [Wed, 5 Apr 2017 01:33:14 +0000 (18:33 -0700)]
Merge "Revert "No more unmount cgroup directory before power off"" into tizen
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
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>
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>
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>
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>
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>
Kichan Kwon [Fri, 17 Feb 2017 00:59:17 +0000 (09:59 +0900)]
No more unmount cgroup directory before power off
- Sometimes power off animation is not shown because
systemd can't control after cgroup unmount
- Notice : if some apps are infinitely restarted,
their service file should be modified
Change-Id: Ic4d3700c90ffbfb4b1743fb6c73116d5cce0d200
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Mon, 20 Feb 2017 10:29:45 +0000 (19:29 +0900)]
Merge branch 'tizen_3.0' into tizen
Change-Id: I5af804e7f0c19044071d805096102f72b2462d15
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Thu, 26 Jan 2017 05:19:57 +0000 (14:19 +0900)]
heart : update DB to modify appid after grouping
- After grouping, child will be considered to parent
- Therefore, appid in DB should also be changed
Change-Id: Ia205631af711f1573b0d5c7fa6363745cfee3b71
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
MyungJoo Ham [Wed, 2 Nov 2016 05:07:48 +0000 (14:07 +0900)]
Make resourced-light package
- In current, resourced-light just excludes HEART module
Change-Id: Ib239bdd85e33b0efc6cf72145f87129e77e8b433
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
[Bug fix, simplify package]
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Fri, 20 Jan 2017 01:06:51 +0000 (10:06 +0900)]
heart : set to static function using static variable
Change-Id: I9e6434c33a324b75d562daa5970178ffcdc71eb8
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Wed, 18 Jan 2017 01:00:54 +0000 (10:00 +0900)]
Fix for gnu11 compiler
- Set to static function using static variable
- Replace deprecated readdir_r to readdir
Change-Id: I13473f8e984376d56a71b97dc06c04a95311e930
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Fri, 30 Dec 2016 08:01:18 +0000 (17:01 +0900)]
Fix Tizen coding rule
Change-Id: Ia22c4efed664898d786cde7e619d5fa53b915af2
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Thu, 29 Dec 2016 05:05:37 +0000 (14:05 +0900)]
proc-stat : remove clearly after grouping
- When application is grouped, grouped app info is removed
- But, each ppi has a list pointing pai
- Therefore, ppi also should be processed when pai is removed
- proc_remove_app_info will do appropriately
Change-Id: Ib1a1dde61302be37f272ca1407e3c9ab4a446b85
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Thu, 29 Dec 2016 02:44:59 +0000 (11:44 +0900)]
Replace strerror_r() to '%m'.
- strerror_r() always need additional buffer
- We don't have to declare buffer by using '%m'
Change-Id: I326a306d15b1d74360b4264ff99024b5b7a6fb43
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Fri, 13 Jan 2017 02:05:52 +0000 (11:05 +0900)]
Merge branch 'tizen_3.0' into tizen
Change-Id: I6fcfd62968c45276ba202605f73f000c685af1a3
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Thu, 5 Jan 2017 06:27:45 +0000 (15:27 +0900)]
heart : fix argument
Change-Id: Ib8a342468847a5a9ff412cfcd98fcd94a18a8a04
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Wed, 4 Jan 2017 05:27:51 +0000 (14:27 +0900)]
heart : sync thread no more reply D-Bus message
- D-Bus methods using same path are not thread-safe
- Sync thread will invoke main thread to finish its work by using pipe
Change-Id: I81f917a7abc905aa483b19e465564012744f4e5d
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Thu, 29 Dec 2016 04:25:14 +0000 (13:25 +0900)]
Merge branch 'tizen_3.0' into tizen
Change-Id: I9c66ded00e187a68b52c13334dc6c1732d1b0933
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
Kichan Kwon [Tue, 27 Dec 2016 01:05:57 +0000 (10:05 +0900)]
heart : pull out DB size checking statement
Change-Id: I0e420c64c14bbcb8864d6509bf6172ab3c04b4f5
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>