login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
July
»
4
Re: [PATCH 1/2] res_counter : check limit change
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Pavel Emelyanov <xemul@...>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>
Cc: LKML <linux-kernel@...>, linux-mm@kvack.org <linux-mm@...>, Andrew Morton <akpm@...>, balbir@linux.vnet.ibm.com <balbir@...>, menage@google.com <menage@...>, nishimura@mxp.nes.nec.co.jp <nishimura@...>, yamamoto@valinux.co.jp <yamamoto@...>
Subject:
Re: [PATCH 1/2] res_counter : check limit change
Date: Friday, July 4, 2008 - 6:34 am
KAMEZAWA Hiroyuki wrote:
quoted text
> Add an interface to set limit. This is necessary to memory resource controller > because it shrinks usage at set limit. > > (*) Other controller may not need this interface to shrink usage because > shrinking is not necessary or impossible in it. > > Changelog: > - fixed white space bug. > > Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
quoted text
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> > > > include/linux/res_counter.h | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > Index: test-2.6.26-rc8-mm1/include/linux/res_counter.h > =================================================================== > --- test-2.6.26-rc8-mm1.orig/include/linux/res_counter.h > +++ test-2.6.26-rc8-mm1/include/linux/res_counter.h > @@ -176,4 +176,19 @@ static inline bool res_counter_can_add(s > return ret; > } > > +static inline int res_counter_set_limit(struct res_counter *cnt, > + unsigned long long limit) > +{ > + unsigned long flags; > + int ret = -EBUSY; > + > + spin_lock_irqsave(&cnt->lock, flags); > + if (cnt->usage < limit) { > + cnt->limit = limit; > + ret = 0; > + } > + spin_unlock_irqrestore(&cnt->lock, flags); > + return ret; > +} > + > #endif > >
--
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 1/2] res_counter : check limit change
, KAMEZAWA Hiroyuki
, (Fri Jul 4, 5:12 am)
Re: [PATCH 1/2] res_counter : check limit change
, Pavel Emelyanov
, (Fri Jul 4, 6:34 am)
[PATCH 2/2] memcg: check limit change
, KAMEZAWA Hiroyuki
, (Fri Jul 4, 5:16 am)
Re: [PATCH 2/2] memcg: check limit change
, Pavel Emelyanov
, (Fri Jul 4, 6:35 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Srivatsa Vaddagiri
containers (was Re: -mm merge plans for 2.6.23)
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Tarkan Erimer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Benjamin Herrenschmidt
Re: [PATCH] Remove process freezer from suspend to RAM pathway
git
:
linux-netdev
:
Jarek Poplawski
[PATCH take 2] pkt_sched: Protect gen estimators under est_lock.
David Miller
[GIT]: Networking
Gerhard Pircher
3c59x: shared interrupt problem
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
2 users
and
895 guests
online.
Online users
strcmp
maheshdm
Syndicate