On Mar 14, 2011, at 5:25 AM, Daniel Wagner wrote:
> Hi Grant,
> 
> On Fri, Mar 11, 2011 at 04:16:48PM -0800, Grant Erickson wrote:
>> Added support for optionally specifying, via a global, read-only
>> configuration file, system resource limits for address space, core
>> files, data segment size, file size, lockable memory, open files,
>> number of processes and stack size.
> 
> Is rlimit still the prefered way to limit resources? I ask because we
> had some discussion about using cgroups. And if I got it right,
> systemd has support for them. So do you need built-in support for
> resource limiting or could you life with cgroups from systemd?
> 
> If not this code is also needed then for oFono, BlueZ, obexd etc... 

Daniel:

Excellent questions, all.

I've taken a look at systemd and, like Lennart's other work, I like it. And 
while I plan to use it in the future, for today's project delivery goals I am 
not. Likewise, cgroups also look great; however, I'm not using them today. 
Likewise, nor am I using oFono, BlueZ or obexd.

If there's a better long-term solution, I'm all for iterating towards it. In 
the interim, an rlimit-based solution in connman provides a simple, 
straightforward, low-overhead solution to limit connman's resource usage for a 
simple Wi-Fi-only system in which connman-0.69 currently leaks about 9.75 
KiB/hour*--until I can find and eliminate that leak.

>> diff --git a/src/rlimits.h b/src/rlimits.h
>> new file mode 100644
>> index 0000000..db4e754
>> --- /dev/null
>> +++ b/src/rlimits.h
>> 
>> [ ... ]
>> 
>> +
>> +#ifdef __cplusplus
>> +extern "C" {
>> +#endif
>> +
>> +int __connman_rlimits_init(const gchar *path);
> 
> If the function has a __connman prefix, it is only used inside the
> core and therefore you can move it to src/connman.h

Thanks. I'll update and resubmit.

Best,

Grant

* Latest leak statistics available on request.
_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to