lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9406923.1216422307592.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Sat, 19 Jul 2008 08:05:07 +0900 (JST)
From:	kamezawa.hiroyu@...fujitsu.com
To:	Paul Menage <menage@...gle.com>
Cc:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Vivek Goyal <vgoyal@...hat.com>,
	linux kernel mailing list <linux-kernel@...r.kernel.org>,
	Libcg Devel Mailing List <libcg-devel@...ts.sourceforge.net>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	Dhaval Giani <dhaval@...ux.vnet.ibm.com>,
	Peter Zijlstra <pzijlstr@...hat.com>,
	Kazunaga Ikeno <k-ikeno@...jp.nec.com>,
	Morton Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: Re: [RFC] How to handle the rules engine for cgroups

----- Original Message -----
>On Fri, Jul 18, 2008 at 2:52 AM, KAMEZAWA Hiroyuki
><kamezawa.hiroyu@...fujitsu.com> wrote:
>>
>> For example, create a new file under memory cgroup
>> ==
>>  /opt/memory_cgroup/group_A/notify_at_memory_reach_limit
>> ==
>> And a user watches the file by inotify.
>> The kernel modify modified-time of notify_at_memory_reach_limit file and ca
ll
>> fs/notify_user.c::notify_change() against this inode. He can catchthe event
>> by inotify.
>> (I think he can also catch removal of this file, etc...)
>>
>
>We've been doing something like this to handle OOMs in userspace, with
>pretty good success. The approach that we used so far was a custom
>control file tied to a wait queue, that gets woken when a cgroup
>triggers OOM, but it's a bit hacky. I've been considering some kind of
>more generic approach that could be reused by different subsystems for
>other notifications, maybe using eventfd or maybe netlink.
>
Hmm, eventfd is AIO's one ?
Anyway I agree we need something generic. (hopefully, reuse existing one.)

>inotify would be an option too, but that seems like it might be
>forcing ourselves into filesystem semantics too much.
>
At quick glance, Inotify's good points are

- can be used for any file. for example, even changes in "tasks" file can be
  cathced if it modify modified-time.
- It can be queued.
- It supports ONESHOT, NONBLOCK, etc...
- All memory allocation is done by the waiter (the user).

But yes, we cannot notify other events than "there is some change".

Thanks,
-Kame
>Paul

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ