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
| ||
|
Date: Fri, 19 Sep 2008 10:08:32 -0700 From: Randy Dunlap <randy.dunlap@...cle.com> To: Andrea Righi <righi.andrea@...il.com> Cc: Balbir Singh <balbir@...ux.vnet.ibm.com>, Paul Menage <menage@...gle.com>, agk@...rceware.org, akpm@...ux-foundation.org, axboe@...nel.dk, baramsori72@...il.com, Carl Henrik Lunde <chlunde@...g.uio.no>, dave@...ux.vnet.ibm.com, Divyesh Shah <dpshah@...gle.com>, eric.rannaud@...il.com, fernando@....ntt.co.jp, Hirokazu Takahashi <taka@...inux.co.jp>, Li Zefan <lizf@...fujitsu.com>, Marco Innocenti <m.innocenti@...eca.it>, matt@...ehost.com, ngupta@...gle.com, roberto@...it.it, Ryo Tsuruta <ryov@...inux.co.jp>, Satoshi UCHIDA <s-uchida@...jp.nec.com>, subrata@...ux.vnet.ibm.com, yoshikawa.takuya@....ntt.co.jp, containers@...ts.linux-foundation.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH -mm 2/6] introduce struct res_counter_ratelimit On Wed, 17 Sep 2008 13:05:24 +0200 Andrea Righi wrote: > Introduce res_counter_ratelimit as a generic structure to implement > throttling-based cgroup subsystems. > > [ Only the interfaces needed by the IO controller are implemented right now ] > > Signed-off-by: Andrea Righi <righi.andrea@...il.com> > --- > include/linux/res_counter.h | 70 +++++++++++++++++++++++++ > kernel/res_counter.c | 118 ++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 187 insertions(+), 1 deletions(-) > > diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h > index 0ab55c4..ff677d9 100644 > --- a/include/linux/res_counter.h > +++ b/include/linux/res_counter.h > @@ -45,6 +46,38 @@ struct res_counter { > spinlock_t lock; > }; > > +/* The various policies that can be used for throttling */ > +#define RATELIMIT_LEAKY_BUCKET 0 > +#define RATELIMIT_TOKEN_BUCKET 1 > + > +struct res_counter_ratelimit { > + /* > + * the current resource consumption level > + */ > + unsigned long long usage; > + /* > + * the maximal value of the usage from the counter creation > + */ > + unsigned long long max_usage; > + /* > + * the rate limit that cannot be exceeded > + */ > + unsigned long long limit; > + /* > + * the limiting policy / algorithm > + */ > + unsigned long long policy; > + /* > + * timestamp of the last accounted resource request > + */ > + unsigned long long timestamp; > + /* > + * the lock to protect all of the above. > + * the routines below consider this to be IRQ-safe > + */ > + spinlock_t lock; > +}; With such nice struct comments, it looks like you should convert them to kernel-doc for structs. See Documentation/kernel-doc-nano-HOWTO.txt for into, or ask me if you need some help with it. Thanks, --- ~Randy -- 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