lkml.org 
[lkml]   [2011]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: Seeking Linux watchdog design advice to trouble shoot mystory silent reboot issue
From
On Wed, Dec 14, 2011 at 2:11 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Dec 5, 2011 at 8:55 PM, Vincent Li <vincent.mc.li@gmail.com> wrote:
>
>> we have  a complex system with a large number of processes running
>> simutanously. If any of the processes gets into a faulty state and
>> hangs or consumes more than its fair share of the system resources,
>> the other processes may not get a chance to run, and the whole system
>> can hang, interrupting the system functionality and user traffic.
>
> Have you tried using RLIMITs?
>
> Last time I used something like this from each process:
>
> #include <sys/time.h>
> #include <sys/resource.h>
>
> struct rlimit rl;
> int ret;
>
> // No process run more than 5 seconds
> rl.rlim_cur = rl.rlim_max = 5;
> ret = setrlimit(RLIMIT_CPU, &rl);
> // No realtime process run more than 1 second
> rl.rlim_cur = rl.rlim_max = 1000000;
> ret = setrlimit(RLIMIT_RTTIME, &rl);
>
> The latter is good if you have real-time processes.
>
> There are also RLIMITs for memory consumption.
>
> Consult:
> http://kernel.org/doc/man-pages/online/pages/man2/getrlimit.2.html
>

thank you for the link, I will look into it.

Vincent
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-12-17 23:53    [W:0.045 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site