platform/core/system/resourced.git
4 years agoPort vmpressure-lowmem-handler.c 79/215379/4
Michal Bloch [Mon, 7 Oct 2019 14:42:46 +0000 (16:42 +0200)]
Port vmpressure-lowmem-handler.c

Change-Id: I21fe594cd921aea9943f82bb968e3759d8226fcf

4 years agoRemaining Useful Life (RUL) implementation 22/207422/4
Amandeep Chauhan [Mon, 3 Jun 2019 14:48:17 +0000 (16:48 +0200)]
Remaining Useful Life (RUL) implementation

RUL implementation for monitoring battery health
and detecting when battery needs to be replaced

Change-Id: Id286f292630ede1670be2859e4439f236551631f
Signed-off-by: Amandeep Chauhan <a.chauhan@samsung.com>
4 years agoFix indent 05/218005/2 accepted/tizen/unified/20191121.073441 submit/tizen/20191121.052121
INSUN PYO [Mon, 18 Nov 2019 10:57:37 +0000 (19:57 +0900)]
Fix indent

Change-Id: I38295ad9d738103ae2041db8c5a4eea08153d554

4 years agoRelease 6.0.1 22/217722/2 accepted/tizen/unified/20191115.083924 submit/tizen/20191114.101902
Karol Lewandowski [Wed, 13 Nov 2019 15:41:49 +0000 (16:41 +0100)]
Release 6.0.1

This version introduces plugin system, allowing to drop -light
variant as all functionality can be enabled/disabled by providing
or not respective modules.

Change-Id: Ifb5b37652c622a7ea335ac4166b9c2e51be8032b

4 years agoDrop light variant if favour of plugins 66/216266/6
Karol Lewandowski [Tue, 22 Oct 2019 21:18:08 +0000 (23:18 +0200)]
Drop light variant if favour of plugins

Change-Id: Ie00753f470a0d214db3c0d478df88d9f4bb5445a

4 years agoplugins: Separate heart module 65/216265/5
Karol Lewandowski [Fri, 8 Nov 2019 14:32:19 +0000 (15:32 +0100)]
plugins: Separate heart module

Change-Id: I6a87903ad00e7bc65879eca2fd4661d5e1f64e70

4 years agoplugins: Separate swap module 48/216248/9
Karol Lewandowski [Tue, 22 Oct 2019 12:37:55 +0000 (14:37 +0200)]
plugins: Separate swap module

Change-Id: Iea7ce4fefe2444de444b7f353df733322f561aac

4 years agoplugins: Separate freezer module 33/216233/10
Karol Lewandowski [Tue, 22 Oct 2019 10:00:50 +0000 (12:00 +0200)]
plugins: Separate freezer module

Change-Id: Id5a60a03a93064a8e8666cef682214e750baca50

4 years agoplugins: Separate block module 32/216232/9
Karol Lewandowski [Tue, 22 Oct 2019 09:13:47 +0000 (11:13 +0200)]
plugins: Separate block module

Change-Id: I43a67d96c0796df8d3da96ab612458c79064ab3a

4 years agoplugins: Introduce private API and plugin architecture 58/216058/13
Karol Lewandowski [Mon, 21 Oct 2019 09:13:04 +0000 (11:13 +0200)]
plugins: Introduce private API and plugin architecture

Split resourced into:
  + private api (libresourced-private-api library and headers)
  + plugins using the api (/usr/lib/resourced/plugins)

Change-Id: I426a9ed26b74f389194300936508cb3f055a2c00

4 years agoBring back some "unused" functions for module use 51/217351/2
Michal Bloch [Fri, 8 Nov 2019 13:11:14 +0000 (14:11 +0100)]
Bring back some "unused" functions for module use

These are used in freezer.

This partially reverts ced08db5bb62fd4ba35f0fbc38799097d2da3240.

Change-Id: I2ca2b63c51f2aae6ed576a9a01d9630ef429b1de
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoDrop debugging defines 31/216231/6
Karol Lewandowski [Tue, 22 Oct 2019 09:10:30 +0000 (11:10 +0200)]
Drop debugging defines

These are rarely/never used - leave them in .c files so that one
can still enable these if really needed.

Change-Id: I2005d9f5121f01d48ede99d7b86ada04c208ad09

4 years agoAvoid redundant module redefinitions 36/215936/8
Karol Lewandowski [Mon, 21 Oct 2019 09:10:46 +0000 (11:10 +0200)]
Avoid redundant module redefinitions

Change-Id: Icbd38fa648cb14817ecde3c38d6e9434b5371417

4 years agoDrop unused defines 35/215935/8
Karol Lewandowski [Thu, 17 Oct 2019 13:24:09 +0000 (15:24 +0200)]
Drop unused defines

Change-Id: Ia7a8c43f7e42ab11c9a4b89d635b2b3b1e4e82a3

4 years agoUse alternatives mechanism to manage configuration (bump to v5.5.3) 46/215846/15 accepted/tizen/unified/20191106.124748 submit/tizen/20191104.114511
Karol Lewandowski [Wed, 16 Oct 2019 12:38:18 +0000 (14:38 +0200)]
Use alternatives mechanism to manage configuration (bump to v5.5.3)

This is necessary to support multiple configuration providers.

Bump version to 5.5.3 as this is required for external package to depend
on new resourced configuration scheme.

Change-Id: Ic188a0fc4a75569107e13b9a218652f20ed31f1d
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
4 years agoRemove unused functions and static vars 79/215779/2
Maciej Slodczyk [Mon, 21 Oct 2019 11:05:10 +0000 (13:05 +0200)]
Remove unused functions and static vars

Change-Id: Ic1c519b2bd019ebd64cb165c4fe0bb64fc86d623
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agoRemove unused heart/decision module 51/216151/1
Maciej Slodczyk [Mon, 21 Oct 2019 11:04:22 +0000 (13:04 +0200)]
Remove unused heart/decision module

Change-Id: I516b6de69e56c6e9bb2bf0977d875e77894e9fee
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agoMerge "Fix parsing proc-appusage config" into tizen
Karol Lewandowski [Mon, 21 Oct 2019 10:56:23 +0000 (10:56 +0000)]
Merge "Fix parsing proc-appusage config" into tizen

4 years agodbus-handler: changed to use gvariant 56/215956/3
sanghyeok.oh [Fri, 18 Oct 2019 02:04:41 +0000 (11:04 +0900)]
dbus-handler: changed to use gvariant

Change-Id: I9b5cd2fe813cb2390f4aa7f160c38201a64824b2
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agosvace fix 43/215943/1 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.023103 accepted/tizen/5.5/unified/mobile/hotfix/20201027.090719 accepted/tizen/5.5/unified/wearable/hotfix/20201027.113341 accepted/tizen/unified/20191018.152357 submit/tizen/20191018.084730 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 submit/tizen_5.5_wearable_hotfix/20201026.184304 tizen_5.5.m2_release
sanghyeok.oh [Fri, 18 Oct 2019 00:46:12 +0000 (09:46 +0900)]
svace fix

Change-Id: Ib467abdfa3b6b09a78e689438240945bc31e7ab6
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agoFix parsing proc-appusage config 08/215908/1
INSUN PYO [Thu, 17 Oct 2019 10:25:19 +0000 (19:25 +0900)]
Fix parsing proc-appusage config

/etc/resourced/proc.conf has multi sections.
So, "config-parser.c: config_parse(124) > Failed to read /etc/resourced/proc.conf:16!" appears on dlog.

///////////////////////////////////////////////////////////////////////////////////////////////////////
0  config_parse (file_name=0x41a960 "/etc/resourced/proc.conf", cb=0x40bda9 <load_appusage_config>, user_data=user_data@entry=0x0) at /usr/src/debug/resourced-5.5.2/src/common/config-parser.c:123
1  0x0040bcec in proc_appusage_table_init () at /usr/src/debug/resourced-5.5.2/src/proc-stat/proc-appusage.c:114
2  booting_done (data=<optimized out>) at /usr/src/debug/resourced-5.5.2/src/proc-stat/proc-appusage.c:136
3  0x00418a1a in resourced_notify (status=RESOURCED_NOTIFIER_BOOTING_DONE, data=0x0) at /usr/src/debug/resourced-5.5.2/src/common/notifier.c:101
4  0x0040ccac in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/resourced-5.5.2/src/resourced/main.c:64
//////////////////////////////////////////////////////////////////////////////////////////////////////

Change-Id: I6ae7befc4131adc6eaad05b7f7e6f861b46439fe

4 years agoRemove unused defines 78/215778/1
Maciej Slodczyk [Tue, 15 Oct 2019 14:47:14 +0000 (16:47 +0200)]
Remove unused defines

Change-Id: I87c7d362e27b1cdd2e02335a716118a3f1db6aaa
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agoRemove unused struct definitions 77/215777/1
Maciej Slodczyk [Tue, 15 Oct 2019 14:25:53 +0000 (16:25 +0200)]
Remove unused struct definitions

Change-Id: I2e2d4b21562e7fca4ee1868e132affffb0893ae0
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agoRemove unused enum definitions 76/215776/1
Maciej Slodczyk [Tue, 15 Oct 2019 14:24:16 +0000 (16:24 +0200)]
Remove unused enum definitions

Change-Id: Ideaf0c0446a672d047386ac325851c80a0e6fde9
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agoDetect missing cgroups gracefully 27/215627/1
Michal Bloch [Fri, 11 Oct 2019 16:10:22 +0000 (18:10 +0200)]
Detect missing cgroups gracefully

Change-Id: Ied92bf63f47977067f69a77961b465fa6d4673ed
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoFix a critical section being too short 31/215531/1 accepted/tizen/unified/20191015.011907 submit/tizen/20191010.143025 submit/tizen/20191011.103233
Michal Bloch [Thu, 10 Oct 2019 06:57:11 +0000 (08:57 +0200)]
Fix a critical section being too short

Change-Id: I51ec823849f273f9f529d33ee5cfdf6395171b6b
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoFix various complaints by SVACE static analysis 52/213352/7
Michal Bloch [Fri, 30 Aug 2019 12:49:26 +0000 (14:49 +0200)]
Fix various complaints by SVACE static analysis

Change-Id: I30253cab444b3592ca57822b3d398bc69bacf2e0
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoRefactoring error handling 37/214737/1
INSUN PYO [Thu, 26 Sep 2019 02:32:37 +0000 (11:32 +0900)]
Refactoring error handling

Change-Id: Ia1d1a2eb9c50c3c1e72f86101e2af5119f744ee0

4 years agoFix memory leak 65/214565/2
INSUN PYO [Tue, 24 Sep 2019 04:55:24 +0000 (13:55 +0900)]
Fix memory leak

Change-Id: I9b99d08acae29d280d1dd32dd6616d8e6d373b57

4 years agoMerge "proc: check application status" into tizen
Karol Lewandowski [Fri, 20 Sep 2019 16:14:50 +0000 (16:14 +0000)]
Merge "proc: check application status" into tizen

4 years agoMerge "heart: Notify SluggishFW on app malfunction detection" into tizen
Karol Lewandowski [Fri, 20 Sep 2019 14:03:52 +0000 (14:03 +0000)]
Merge "heart: Notify SluggishFW on app malfunction detection" into tizen

4 years agovip: disable release agent when resourced doesn't work such as poweroff scenario 48/212348/6
ByungSoo Kim [Fri, 1 Dec 2017 09:05:36 +0000 (18:05 +0900)]
vip: disable release agent when resourced doesn't work such as poweroff scenario

[Problem scenario]
- request poweroff
- deviced tries to umount /opt/usr partition
- send sigterm signal using "fuser" command
- If a VIP process is accessing /opt/usr, it is terminated by deviced
- resourced detects VIP release agent and restarts device with silent option

So, even though user wants to shutdown device with other option,
device will be started with only "silent" mode.

It is not necessary to check VIP process during poweroff.
It should be disabled.

Change-Id: I4f9185c74de41a2de3d8772975fb17ac2108a1cd
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
[Fixed typos in commit message]
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoproc: increase period of favorite lists 60/212360/3
ByungSoo Kim [Fri, 2 Mar 2018 10:47:06 +0000 (19:47 +0900)]
proc: increase period of favorite lists

[Problem] sluggish test fail
[Cause & Measure] don't change the favorite lists while sluggish test
[Checking Method] sluggish test

Change-Id: I5b3886cd822ec5a68e57f6b08644878fc701aec5
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
4 years agocpu: fix wrong condition while checking predefined process 42/212342/4
ByungSoo Kim [Mon, 12 Jun 2017 12:41:00 +0000 (21:41 +0900)]
cpu: fix wrong condition while checking predefined process

If some process was fixed in predefined lists,
resourced didn't allow to change cpu cgroup inspite of excluded dbus signal.
However, previous condition was wrong so normal process always returned
without changing cpu cgroup.
It was not impact in tizen 3.0 because most process has already declared the category.
But it should be fixed in order to support previous platform.

Change-Id: Ie9bc76fa304e89be274dd630ab2e8dca25c8df40
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
4 years agoInitialize all modules immediately 65/214065/2 accepted/tizen/unified/20190919.010654 submit/tizen/20190918.083638
Michal Bloch [Tue, 17 Sep 2019 14:22:53 +0000 (16:22 +0200)]
Initialize all modules immediately

Waiting for BootingDone is fragile and may leave some modules uninitialized.

Change-Id: I77296d9d7eec770cc6013861204e7d05ed1ea7ff

4 years agoFix a complaint by SVACE static analysis 55/214055/2
Michal Bloch [Tue, 17 Sep 2019 10:39:08 +0000 (12:39 +0200)]
Fix a complaint by SVACE static analysis

Change-Id: I289f2d9684332ee1bf7e9b8eb3f971e177443ef3
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoRemove legacy file logging functionality 22/213922/2
Baumann [Mon, 16 Sep 2019 16:10:51 +0000 (18:10 +0200)]
Remove legacy file logging functionality

Change-Id: If859c95bb7f86faba51ad7280fb44a432dd99cb2

4 years agoproc: check application status 61/212361/3
ByungSoo Kim [Tue, 10 Jan 2017 07:41:41 +0000 (16:41 +0900)]
proc: check application status

When deviced requests application status,
resourced can identify whether it is normal or malicious.
So, resourced will return good or bad application status to deviced.

Change-Id: I0f0967fc6dc2e50eaaf83771f183999b95adc6fd
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
4 years agoheart: Notify SluggishFW on app malfunction detection 57/212457/3
jyotsna.a@samsung.com [Tue, 20 Dec 2016 12:49:35 +0000 (18:19 +0530)]
heart: Notify SluggishFW on app malfunction detection

[Problem] New request from Tizen community
[Cause & Measure] Updating sluggish FW to support app malfunction reporting

Change-Id: If2a183a2504f29b30b03dcb969338e5dc89850a9
Signed-off-by: jyotsna.a@samsung.com <jyotsna.a@samsung.com>
4 years agoPort DeviceD poweroff signal handler 53/212453/3
Michal Bloch [Wed, 21 Aug 2019 15:00:16 +0000 (17:00 +0200)]
Port DeviceD poweroff signal handler

Change-Id: Ie57f88a42b0433df0989a91b42ef656b36ad2ef0

4 years agovip-process: add ac.service to vip process 32/212632/2
WaLyong Cho [Tue, 18 Jul 2017 02:38:59 +0000 (11:38 +0900)]
vip-process: add ac.service to vip process

Change-Id: Ib98e4d97ebda57db78f2b6d1b9f5b8dcf86294d4
Signed-off-by: WaLyong Cho <walyong.cho@samsung.com>
4 years agoFix incorrect errno check 95/212195/8
Baumann [Fri, 16 Aug 2019 11:04:26 +0000 (13:04 +0200)]
Fix incorrect errno check

Change-Id: Ifbe35f844c00d1df41ca7f04556a97b9d922e368
Signed-off-by: Baumann <a.baumann@samsung.com>
4 years agoExtract D-Bus signal name definitions 88/210988/15
Michal Bloch [Fri, 26 Jul 2019 15:22:19 +0000 (17:22 +0200)]
Extract D-Bus signal name definitions

Change-Id: I304e540307fb7565a80d4d88190e652d4a808330

4 years agoIntroduce D-Bus pid query. 84/210984/14
Michal Bloch [Fri, 26 Jul 2019 13:04:19 +0000 (15:04 +0200)]
Introduce D-Bus pid query.

Will be used in future patches.

Change-Id: I4893b9bc63a60b2ee3f2a3de3ad5788d4993ac46

4 years agoCheck GVariant correctness for DBus calls 35/207635/15
Michal Bloch [Tue, 30 Jul 2019 11:31:38 +0000 (13:31 +0200)]
Check GVariant correctness for DBus calls

Change-Id: Id4c7dd8bbf99ac47ae4ab41f4c88cd5eb36b6980
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
4 years agoRefactor out some needless repetition 60/211160/4 accepted/tizen/unified/20190904.224514 submit/tizen/20190904.140208
Michal Bloch [Tue, 30 Jul 2019 10:34:49 +0000 (12:34 +0200)]
Refactor out some needless repetition

Change-Id: Ibba71119e587affb05da27919c087537a903267c

4 years agoFix double free 51/212951/1 accepted/tizen/unified/20190829.040204 submit/tizen/20190828.131328 submit/tizen/20190828.162915
Michal Bloch [Wed, 28 Aug 2019 11:52:34 +0000 (13:52 +0200)]
Fix double free

Change-Id: I6d9d9b4d4a6f7bd3de13f675a580ae8b1dd519ed
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoFix a memory leak 50/212950/1
Michal Bloch [Wed, 28 Aug 2019 11:53:23 +0000 (13:53 +0200)]
Fix a memory leak

Change-Id: I0a6d5aed3646065d39876d36132eeb49f57f7729
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoheart: Increase heart module priority 29/212629/2 submit/tizen/20190823.122228
Karol Lewandowski [Fri, 23 Aug 2019 09:31:48 +0000 (11:31 +0200)]
heart: Increase heart module priority

This should ensure that heart moudule is always properly initialized,
as it does not depend on external signal notification (as needed for
late modules which wait for BootingDone signal).

Change-Id: I2c0884c77e1bb2e04e390d2e863d6ba5472f9357

4 years agosignal handler: Depend on D-Bus policy as single source for policy information 19/212419/2 accepted/tizen/unified/20190826.000109 submit/tizen/20190822.134540 submit/tizen/20190823.062038
Karol Lewandowski [Wed, 21 Aug 2019 08:55:45 +0000 (10:55 +0200)]
signal handler: Depend on D-Bus policy as single source for policy information

If something has to be blocked, it has to be blocked by standard D-Bus policy.
This reverts commit 26f17bcd9864ebc3bc0ec068a5dea8cabda01198 (effectively).

Change-Id: Ifad4e830cf490247d4781f59ae3d6d0c8e74719c

4 years agoFix some incorrect method call replies 59/211159/2
Michal Bloch [Tue, 30 Jul 2019 11:18:39 +0000 (13:18 +0200)]
Fix some incorrect method call replies

Change-Id: I8be8d489738749de1e657f97cc342e3baaed9132
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoMerge "Update (formerly) deviced booting signal paths" into tizen submit/tizen/20190814.170318
Karol Lewandowski [Wed, 14 Aug 2019 16:28:12 +0000 (16:28 +0000)]
Merge "Update (formerly) deviced booting signal paths" into tizen

4 years agoRestrict access to vip-release-agent 46/212046/2
Michal Bloch [Tue, 13 Aug 2019 13:24:05 +0000 (15:24 +0200)]
Restrict access to vip-release-agent

 * file mode: 755 → 700
 * SMACK access label: "_" → "System"

Change-Id: I2c725a75a11d60b0c63c2f7d00579cd96cb3a815
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoUpdate (formerly) deviced booting signal paths 30/212030/1
Michal Bloch [Mon, 12 Aug 2019 15:17:46 +0000 (17:17 +0200)]
Update (formerly) deviced booting signal paths

BootingDone is under system.Booting and EarlyBootingDone no longer exists.

Change-Id: I4e91e037784a454e51bf7c3b639df08076031a30
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
4 years agoMerge "Remove unused feature "default-extra-dependencies"" into tizen
Karol Lewandowski [Fri, 9 Aug 2019 13:37:53 +0000 (13:37 +0000)]
Merge "Remove unused feature "default-extra-dependencies"" into tizen

5 years agoMinor const correctness 83/210983/1
Michal Bloch [Fri, 26 Jul 2019 12:36:07 +0000 (14:36 +0200)]
Minor const correctness

Change-Id: Iccd107b4e0858480abbe1b62108f386d3d36db65
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
5 years agoRemove unused feature "default-extra-dependencies" 06/209106/4
INSUN PYO [Tue, 2 Jul 2019 07:50:25 +0000 (16:50 +0900)]
Remove unused feature "default-extra-dependencies"

"default-extra-dependencies" was a feature used in an unpublished
version of systemd but has since been dropped.

This has been replaced by a delayed target in public systemd.

Change-Id: Ie6929b26bdd45c157ad4527c6da7fec9a7df7622

5 years agoRelease 5.5.2 54/209954/1 submit/tizen/20190712.184306 submit/tizen/20190722.101820 submit/tizen/20190724.105257
Michal Bloch [Fri, 12 Jul 2019 12:50:53 +0000 (14:50 +0200)]
Release 5.5.2

 - port some heart and lowmem related code
 - miscellaneous fixes

Change-Id: I5e2ab97866be4a5369fbca34a25e4f89a612cfdc
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
5 years agoFix a null pointer dereference 45/209545/1
Michal Bloch [Mon, 8 Jul 2019 13:29:24 +0000 (15:29 +0200)]
Fix a null pointer dereference

Change-Id: Ib8d841c9ab8a7e7448a0545791cc3455b1a67903
Signed-off-by: Michal Bloch <m.bloch@partner.samsung.com>
5 years agoMerge changes I349c8798,I6222a416,Id06cad1d,I0994ea8c into tizen submit/tizen/20190704.121256 submit/tizen/20190705.134528
Karol Lewandowski [Fri, 28 Jun 2019 13:49:26 +0000 (13:49 +0000)]
Merge changes I349c8798,I6222a416,Id06cad1d,I0994ea8c into tizen

* changes:
  Port (merge) `lowmem-system` for resourced to handle lowmem of systemd units
  memory: restart timer after changing timeout interval
  memory: reset swappiness to memcg directories which have been already created by systemd.
  lowmem: add to control systemd services

5 years agoMerge changes from topic "resourced-porting-2019" into tizen
Karol Lewandowski [Fri, 28 Jun 2019 13:48:05 +0000 (13:48 +0000)]
Merge changes from topic "resourced-porting-2019" into tizen

* changes:
  lowmem: broadcast event when some process uses memory over limit
  proc: check minimum value of oom score adj about all UI applications
  heart-cpu: consider the service app type while considering the cpu time for process.

5 years agoEnsure resourced is started before user session 07/208607/2
Karol Lewandowski [Wed, 26 Jun 2019 10:15:42 +0000 (12:15 +0200)]
Ensure resourced is started before user session

resourced listens on AUL signals from lauchpad, and it has to be
started before it.

Change-Id: I6a161d8555824c696a53d462aa7bacef747e18e9

5 years agolowmem: broadcast event when some process uses memory over limit 23/207423/4
ByungSoo Kim [Tue, 13 Nov 2018 07:48:04 +0000 (16:48 +0900)]
lowmem: broadcast event when some process uses memory over limit

Other process can receive this broadcast signal
when resourced kills the process which uses memory over limit.

Change-Id: I77fe18a71c7d09df47b9144e47d43c7965864f6b
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
5 years agoproc: check minimum value of oom score adj about all UI applications 89/207289/4
ByungSoo Kim [Mon, 28 May 2018 05:15:57 +0000 (14:15 +0900)]
proc: check minimum value of oom score adj about all UI applications

Resourced groups UI and service applications with same package name
and controls oom score adj of service app according to changing UI app.
But even if there are other applications with lower oom score adj such as widget or clock,
service applications goes to the background state abnormally.
So, it requires to check oom score value of all UI applications.

Change-Id: I4b032affe761d071c4bc5eb337d1f4fa38dfb7bf
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
5 years agoheart-cpu: consider the service app type while considering the cpu time for process. 88/207288/4
Jiban Prakash [Thu, 10 May 2018 13:13:34 +0000 (18:43 +0530)]
heart-cpu: consider the service app type while considering the cpu time for process.

Change-Id: I5e9ff9f241aad365d2e1d69d3239743df3a9765b
Signed-off-by: Jiban Prakash <p.jiban@samsung.com>
5 years agoPort (merge) `lowmem-system` for resourced to handle lowmem of systemd units 89/207889/3
Michal Bloch [Thu, 27 Jun 2019 12:12:30 +0000 (14:12 +0200)]
Port (merge) `lowmem-system` for resourced to handle lowmem of systemd units

Change-Id: I349c8798f5308580b63829edac13eb12055eda14

5 years agomemory: restart timer after changing timeout interval 88/207888/3
ByungSoo Kim [Mon, 16 Apr 2018 13:52:18 +0000 (22:52 +0900)]
memory: restart timer after changing timeout interval

glib timer can't change timeout interval in same timer source.
If it wants to change timeout interval, it should destroy current timer
nd attach new timer again.

Change-Id: I6222a416e0e16402585ae4b6f836ccdae3c347dc
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
5 years agomemory: reset swappiness to memcg directories which have been already created by... 87/207887/3
ByungSoo Kim [Tue, 28 Mar 2017 06:03:17 +0000 (15:03 +0900)]
memory: reset swappiness to memcg directories which have been already created by systemd.

Systemd makes all cgroup directories as soon as it starts.
So, if someone tires to change default swappiness by using sysctl,
kernel can't change systemd cgroup directories with changed value
because they are already created.
So, resourced can search all systemd cgroup directories
while it reassigns memory limit.
At that time, it will check swappiness and reset again
with current swappiness of root memcgroup.

Change-Id: Id06cad1decff768daa042f61f84e63ba9d733f03
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
5 years agolowmem: add to control systemd services 86/207886/3
ByungSoo Kim [Tue, 28 Mar 2017 05:40:09 +0000 (14:40 +0900)]
lowmem: add to control systemd services

Resourced doesn't know systemd services which are included in memcg of systemd slice.
If resourced can check these processes, it will be useful for resourced
to control LMK, mem limit and so on.

Change-Id: I0994ea8c8a7c707cfd6000ef0dcd9d96c31c7176
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
5 years agoMerge "swap: remove const type in the swap module ops" into tizen
Karol Lewandowski [Wed, 19 Jun 2019 15:28:23 +0000 (15:28 +0000)]
Merge "swap: remove const type in the swap module ops" into tizen

5 years agoswap: remove const type in the swap module ops 87/207287/3
minsoo kim [Tue, 3 Apr 2018 14:00:06 +0000 (23:00 +0900)]
swap: remove const type in the swap module ops

The swap module ops also has RW variables to set the values at runtime
from kernel node.
It should remove the const type.

Change-Id: Ifece59f241aad365d2e1d69d3239743df3a9765b
Signed-off-by: ByungSoo Kim <bs1770.kim@samsung.com>
Signed-off-by: minsoo kim <ms203.kim@samsung.com>
5 years agoRemove the "retry in case it works" antipattern. 41/207641/2
Michal Bloch [Mon, 10 Jun 2019 10:53:17 +0000 (12:53 +0200)]
Remove the "retry in case it works" antipattern.

Change-Id: I54e987f7d797183ed099fdf9d1fd471fa3e233b0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoSilence a SVACE complaint. 39/207639/2
Michal Bloch [Mon, 10 Jun 2019 10:22:04 +0000 (12:22 +0200)]
Silence a SVACE complaint.

"[Major] Possible missing lock before accessing to the ''data'' variable"

SVACE believes that `data` should be handled under a mutex because
it is usually handled under a mutex above, but it is in fact a regular
local variable and the case at hand is for when mutex unlock fails.

Change-Id: Ife1df6a9d2761f56f1ca579f1acb0c94e254a83c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoHeart : Added NULL check handing for pointer before deferencing. 83/206383/1
“JIBAN [Tue, 25 Jul 2017 10:01:34 +0000 (15:31 +0530)]
Heart : Added NULL check handing for pointer before deferencing.

[Model] Z4
[BinType]
[Customer] NA

[Issue#] P170720-06362
[Request] NA
[Occurrence Version] NA

[Problem] NULL check handle was missing before deferencing the pointer
[Measure] Added NULL check handing for pointer before deferencing.
[Checking Method]

[Team] SYSTEM FRAMEWORK
[Developer] p.jiban
[Solution company] Samsung

Change-Id: I9df1acad5d2ea4848924e9a3328635514f90d793
Signed-off-by: “JIBAN <p.jiban@samsung.com>
Change-Id: I23830d2715c4f1dca81bb7bdf8e5f81b37319098
Signed-off-by: “JIBAN <p.jiban@samsung.com>
5 years agoRelease 5.5.1 54/205954/1 submit/tizen/20190513.123842
Michal Bloch [Fri, 10 May 2019 14:12:11 +0000 (16:12 +0200)]
Release 5.5.1

 - new cgroup for bg-locked processes
 - add an option to activate background reclaim
 - early reclaim controllable through config
 - misc bugfixes and maintenance

Change-Id: I3fb7eedc67d11a04fbe2ff75a1b2f801abf9a0af
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoMerge "Replace a call to a missing method with a warning" into tizen
Karol Lewandowski [Thu, 9 May 2019 15:16:14 +0000 (15:16 +0000)]
Merge "Replace a call to a missing method with a warning" into tizen

5 years agoMerge "tracing: introduce _W warning macro" into tizen
Karol Lewandowski [Thu, 9 May 2019 15:15:55 +0000 (15:15 +0000)]
Merge "tracing: introduce _W warning macro" into tizen

5 years agoReplace a call to a missing method with a warning 92/205692/3
Michal Bloch [Wed, 8 May 2019 11:11:10 +0000 (13:11 +0200)]
Replace a call to a missing method with a warning

system-popup doesn't actually expose the MalfunctionNotifierLaunch method,
at least the upstream version. The function was only disabled instead of
completely removed to give any potential legacy systems or forks time to
adapt.

Change-Id: I45884184b4b7734bbe9b1c24692e7fd62d4df258
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agotracing: introduce _W warning macro 91/205691/1
Michal Bloch [Wed, 8 May 2019 10:48:11 +0000 (12:48 +0200)]
tracing: introduce _W warning macro

Change-Id: If8dd95102ecb8d251c6de2648c0e10f858c70a61
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoFix system-popup DBus call signatures 84/205584/4
Michal Bloch [Wed, 8 May 2019 10:02:52 +0000 (12:02 +0200)]
Fix system-popup DBus call signatures

Popup wants an array of string-string dictionary entries while
these functions used to send a bunch of "raw" strings.

Change-Id: I70d3a350a04b4bc514b960159d7d8ce68a914abe
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoDBus helpers: say more about the error 83/205583/4
Michal Bloch [Tue, 7 May 2019 15:57:11 +0000 (17:57 +0200)]
DBus helpers: say more about the error

Change-Id: Id340067a830b70959c650b24dc76c838f313bb74
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoDBus helpers: add a version accepting GVariant 82/205582/3
Michal Bloch [Tue, 7 May 2019 13:49:04 +0000 (15:49 +0200)]
DBus helpers: add a version accepting GVariant

This allows passing parameter packs more complex than `append_variant`
can produce. This commit just introduces this interface without making
any functions actually use it yet.

Change-Id: If0b3e3ae16913fde11df637ffd59842edaa7cf53
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoReclaim at boot now controllable from the config 25/204825/4
Michal Bloch [Fri, 26 Apr 2019 14:59:40 +0000 (16:59 +0200)]
Reclaim at boot now controllable from the config

Introduce two new config fields to `swap.conf`:
 * `ReclaimAtBoot` controls whether this behaviour happens at all (bool)
 * `TimerReclaimAtBoot` controls how long (in seconds) to wait
   until the reclaim happens after booting is done (int)

The feature is now disabled by default.
When enabled, the default timer is still 60s.

Change-Id: I5008248541169156070b3c24fdd7b275e39b8f56
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agoMerge "tests: change core_pattern to /dev/null temporarily" into tizen
Karol Lewandowski [Mon, 25 Mar 2019 12:30:33 +0000 (12:30 +0000)]
Merge "tests: change core_pattern to /dev/null temporarily" into tizen

5 years agoMerge "Add author's commentary to ade9c91f8b" into tizen
Karol Lewandowski [Mon, 25 Mar 2019 12:23:40 +0000 (12:23 +0000)]
Merge "Add author's commentary to ade9c91f8b" into tizen

5 years agofind . -name "*.c" -exec chmod -x {} ; 99/201799/1
Michal Bloch [Tue, 19 Mar 2019 12:55:29 +0000 (13:55 +0100)]
find . -name "*.c" -exec chmod -x {} ;

Change-Id: I590deb0dda83094a3825bc9bf3d20d876c196059
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
5 years agotests: change core_pattern to /dev/null temporarily 27/200827/2
Łukasz Stelmach [Mon, 4 Mar 2019 15:31:02 +0000 (16:31 +0100)]
tests: change core_pattern to /dev/null temporarily

Change coredump handler temporarily to avoid timeouts due to lengthy
core processing.

Change-Id: I516f88fd65c18535e15117b6864424ccc1d71b5b
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
5 years agoAdd author's commentary to ade9c91f8b 24/200824/1
swift.kim [Mon, 4 Mar 2019 13:37:06 +0000 (14:37 +0100)]
Add author's commentary to ade9c91f8b

Change-Id: Idb9eb462fcdb5e929630ffb1e4956f84fe918dac

5 years agotests: Add watchdog test 09/200709/7 accepted/tizen/unified/20190307.231005 submit/tizen/20190301.133444
Łukasz Stelmach [Wed, 27 Feb 2019 13:23:49 +0000 (14:23 +0100)]
tests: Add watchdog test

Add .editorconfig too by the way

Change-Id: If2722c9ac0a4b9e39a986620dc91cfb187ecf154
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
5 years agowatchdog: Check types of parameters explicitly 82/200382/4
Łukasz Stelmach [Thu, 21 Feb 2019 18:43:24 +0000 (19:43 +0100)]
watchdog: Check types of parameters explicitly

Change-Id: Ie8e307c6f1628e481543ad90535fcb99b530c419
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
5 years agowatchdog: DBus method handler need to return a message 81/200381/4
Łukasz Stelmach [Thu, 21 Feb 2019 18:20:00 +0000 (19:20 +0100)]
watchdog: DBus method handler need to return a message

A DBus method handler needs to send a return message to a caller even
if the message is empty.

Change-Id: I037c3d4da8f3810f769fa5bc9ab830fbe9f3ce5e
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
5 years agowatchdog: Do not check message signature 80/200380/3
Łukasz Stelmach [Thu, 21 Feb 2019 18:04:26 +0000 (19:04 +0100)]
watchdog: Do not check message signature

There is no need to check parameter types, because glib handles it before
calling a handler.

Change-Id: I930809d05205ddc00aa3fe5d8bb156108004f754
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
5 years agolowmem: Add an option to activate background reclaim 32/200432/2
swift.kim [Fri, 22 Feb 2019 09:35:14 +0000 (18:35 +0900)]
lowmem: Add an option to activate background reclaim

An option is added to conf to proactively reclaim the background
memory usage when the device screen goes dim.

Change-Id: I97f39c2be4938e6c2e0f7bddc608aaf0393d0ae2

5 years agolowmem: A new cgroup for bg-locked processes 31/200431/2
swift.kim [Fri, 22 Feb 2019 08:13:28 +0000 (17:13 +0900)]
lowmem: A new cgroup for bg-locked processes

Some long-lived processes such as background-locked or favorite apps
were not previously under proper control of LMK or swap. Some devices
with a number of such apps run in background (e.g. a wearable device
with home screen widgets) might not perform efficiently with respect
to memory they use. Thus we want to give lowmem a little chance to do
something more with processes in this separate memcg.

Change-Id: I1c59fa749688f283fc5f7d6a49d22c7e3c1d8b10

5 years agoproc-stat: Initialize pai earlier than proc_set_oom_score_adj 30/200430/2
swift.kim [Fri, 22 Feb 2019 07:55:26 +0000 (16:55 +0900)]
proc-stat: Initialize pai earlier than proc_set_oom_score_adj

pai structure has first to be initialized before oom score to take
any effect.

Change-Id: Ie58a9e0e17e2074479cb077f882eb0ee165ca7df

5 years agoswap: Fix typo and clean up 29/200429/2
swift.kim [Fri, 22 Feb 2019 06:42:20 +0000 (15:42 +0900)]
swap: Fix typo and clean up

- Typos (e.g. MODLE, RECLIAM)
- Misleading notifier handler (swap_activate_handler instead of swap_booting_done)

Change-Id: I087ecbaf199c5414084e8648cb3ac9ef363d4c7d

5 years agopackaging: Bump version 50/200050/1 accepted/tizen/unified/20190218.163125 submit/tizen/20190218.104917
Karol Lewandowski [Mon, 18 Feb 2019 10:41:54 +0000 (11:41 +0100)]
packaging: Bump version

Let the version follow target tizen release.

Change-Id: I97cc5e6c1c92300f8cd5c4d0dbb19fe1c3dd388b

5 years agocommon: Fix logic error in g_variant_is_of_type() 49/200049/1
Karol Lewandowski [Mon, 18 Feb 2019 10:34:58 +0000 (11:34 +0100)]
common: Fix logic error in g_variant_is_of_type()

Change-Id: I93fa5444993daa71ee5eb55a4c8377171b1d786c

5 years agocommon: file-helper: Remove unused code 11/199811/4 submit/tizen/20190215.113808
Karol Lewandowski [Thu, 14 Feb 2019 14:34:10 +0000 (15:34 +0100)]
common: file-helper: Remove unused code

Change-Id: Id0728f6acf74bd71289cf185f3ab165274b0d5f3

5 years agomemory: Add D-Bus type checking to remaining handlers 17/199717/6
Karol Lewandowski [Thu, 14 Feb 2019 08:18:36 +0000 (09:18 +0100)]
memory: Add D-Bus type checking to remaining handlers

Change-Id: I5db0d57456965f008e45357bbbba4c8e28632ee6