Re: [RFC] How to handle the rules engine for cgroups

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Vivek Goyal
Date: Thursday, July 3, 2008 - 8:54 am

On Thu, Jul 03, 2008 at 10:19:57AM +0900, KAMEZAWA Hiroyuki wrote:

I see following text in netlink man page.

"However, reliable transmissions from kernel to user are impossible in
 any case. The kernel can’t send a netlink message if the socket buffer
 is full: the message will be dropped and the kernel and  the userspace
 process will no longer have the same view of kernel state. It is up to
 the application to detect when this  happens  (via  the  ENOBUFS error
 returned by recvmsg(2)) and resynchronize."

So at the end of the day, it looks like unreliability comes from the
fact that we can not allocate memory currently so we will discard the
packet.

Are there alternatives as compared to dropping packets?

- Let sender cache the packet and retry later. So maybe netlink layer
  can return error if packet can not be queued and connector can cache the
  event and try sending it later. (Hopefully later memory situation became
  better because of OOM or some process exited or something else...).

  This looks like a band-aid to handle the temporary congestion kind of
  problems. Will not be able to help if consumer is inherently slow and
  event generation is faster.

This probably can be one possible enhancement to connector, but at the end
of the day, any kind of user space daemon will have to accept the fact
that packets can be dropped, leading to lost events. Detect that situation
(using ENOBUFS) and then let admin know about it (logging). I am not sure
what admin is supposed to do after that.

I am CCing Thomas Graf. He might have a better idea of netlink limitations
and is there a way to overcome these.


I am not sure if proc connector currently allows filtering of various
events like fork, exec, exit etc. In a quick look it looks like it
does not. But probably that can be worked out. Even then, it will just
help reduce the number of messages queued for user space on that socket
but will not take away the fact that messages can be dropped under
memory pressure. 


As of today it should happen because newly execed process will run into
same cgroup as parent.  But that's what probably we need to avoid.
For example, if an admin has created three cgroups "database", "browser"
"others" and a user launches "firefox" from shell (assuming shell is running
originally in "others" cgroup), then any memory allocation for firefox should
come from "browser" cgroup and not from "others".

I am assuming that this will be a requirement for enterprise class
systems. Would be good to know the experiences of people who are already
doing some kind of work load management.

Thanks
Vivek
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Tue Jul 1, 12:11 pm)
RE: [RFC] How to handle the rules engine for cgroups, Kazunaga Ikeno, (Wed Jul 2, 2:33 am)
Re: [RFC] How to handle the rules engine for cgroups, KAMEZAWA Hiroyuki, (Wed Jul 2, 6:19 pm)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 3, 8:54 am)
Re: [RFC] How to handle the rules engine for cgroups, KAMEZAWA Hiroyuki, (Thu Jul 3, 5:34 pm)
Re: [RFC] How to handle the rules engine for cgroups, Balbir Singh, (Tue Jul 8, 2:35 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Tue Jul 8, 6:45 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 2:07 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 2:23 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 7:06 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 7:30 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 7:33 am)
Re: [RFC] How to handle the rules engine for cgroups, Rik van Riel, (Thu Jul 10, 7:48 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 8:40 am)
Re: [RFC] How to handle the rules engine for cgroups, Dhaval Giani, (Thu Jul 10, 8:42 am)
Re: [RFC] How to handle the rules engine for cgroups, Ulrich Drepper, (Thu Jul 10, 8:56 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 9:41 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 9:46 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Thu Jul 10, 9:51 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 10:19 am)
Re: [RFC] How to handle the rules engine for cgroups, Rik van Riel, (Thu Jul 10, 10:25 am)
Re: [RFC] How to handle the rules engine for cgroups, Ulrich Drepper, (Thu Jul 10, 10:39 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 10, 11:41 am)
Re: [RFC] How to handle the rules engine for cgroups, Ulrich Drepper, (Thu Jul 10, 3:29 pm)
Re: [RFC] How to handle the rules engine for cgroups, KAMEZAWA Hiroyuki, (Thu Jul 10, 5:55 pm)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Mon Jul 14, 6:57 am)
Re: [RFC] How to handle the rules engine for cgroups, David Collier-Brown, (Mon Jul 14, 7:44 am)
Re: Re: [RFC] How to handle the rules engine for cgroups, kamezawa.hiroyu, (Mon Jul 14, 8:07 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Mon Jul 14, 8:21 am)
RE: [RFC] How to handle the rules engine for cgroups, Kazunaga Ikeno, (Thu Jul 17, 12:05 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Thu Jul 17, 6:47 am)
Re: [RFC] How to handle the rules engine for cgroups, KAMEZAWA Hiroyuki, (Fri Jul 18, 2:52 am)
Re: [RFC] How to handle the rules engine for cgroups, Paul Menage, (Fri Jul 18, 8:46 am)
Re: [RFC] How to handle the rules engine for cgroups, Balbir Singh, (Fri Jul 18, 9:39 am)
Re: [RFC] How to handle the rules engine for cgroups, Vivek Goyal, (Fri Jul 18, 11:55 am)
Re: Re: [RFC] How to handle the rules engine for cgroups, kamezawa.hiroyu, (Fri Jul 18, 4:05 pm)
Re: Re: [RFC] How to handle the rules engine for cgroups, kamezawa.hiroyu, (Fri Jul 18, 4:10 pm)
Re: [RFC] [PATCH -mm] cgroup: uid-based rules to add proce ..., David Collier-Brown, (Tue Aug 26, 8:04 am)
Re: [RFC] [PATCH -mm] cgroup: uid-based rules to add proce ..., David Collier-Brown, (Tue Aug 26, 9:32 am)