From: yamamoto@valinux.co.jp (YAMAMOTO Takashi)
To: kamezawa.hiroyu@jp.fujitsu.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
balbir@linux.vnet.ibm.com, xemul@openvz.org, menage@google.com,
lizf@cn.fujitsu.com
Subject: Re: [RFC][PATCH 1/2] memcg: res_counter hierarchy
Date: Mon, 2 Jun 2008 11:15:40 +0900 (JST) [thread overview]
Message-ID: <20080602021540.5C6705A0D@siro.lan> (raw)
In-Reply-To: Your message of "Fri, 30 May 2008 10:45:15 +0900" <20080530104515.9afefdbb.kamezawa.hiroyu@jp.fujitsu.com>
> @@ -135,13 +138,118 @@ ssize_t res_counter_write(struct res_cou
> if (*end != '\0')
> goto out_free;
> }
> - spin_lock_irqsave(&counter->lock, flags);
> - val = res_counter_member(counter, member);
> - *val = tmp;
> - spin_unlock_irqrestore(&counter->lock, flags);
> - ret = nbytes;
> + if (member != RES_LIMIT || !callback) {
is there any reason to check member != RES_LIMIT here,
rather than in callers?
> +/*
> + * Move resource to its parent.
> + * child->limit -= val.
> + * parent->usage -= val.
> + * parent->limit -= val.
s/limit/for_children/
> + */
> +
> +int res_counter_repay_resource(struct res_counter *child,
> + struct res_counter *parent,
> + unsigned long long val,
> + res_shrink_callback_t callback, int retry)
can you reduce gratuitous differences between
res_counter_borrow_resource and res_counter_repay_resource?
eg. 'success' vs 'done', how to decrement 'retry'.
YAMAMOTO Takashi
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-06-02 2:15 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-30 1:43 [RFC][PATCH 0/2] memcg: simple hierarchy (v2) KAMEZAWA Hiroyuki
2008-05-30 1:45 ` [RFC][PATCH 1/2] memcg: res_counter hierarchy KAMEZAWA Hiroyuki
2008-05-30 22:20 ` Balbir Singh
2008-05-31 1:59 ` kamezawa.hiroyu
2008-05-31 11:20 ` Balbir Singh
2008-05-31 14:47 ` kamezawa.hiroyu
2008-05-31 17:18 ` Balbir Singh
2008-06-01 0:35 ` kamezawa.hiroyu
2008-06-02 6:16 ` Balbir Singh
2008-06-02 9:48 ` kamezawa.hiroyu
2008-06-02 2:15 ` YAMAMOTO Takashi [this message]
2008-06-02 9:52 ` kamezawa.hiroyu
2008-05-30 1:46 ` [RFC][PATCH 2/2] memcg: memcg hierarchy KAMEZAWA Hiroyuki
2008-05-30 1:46 ` [RFC][PATCH 0/2] memcg: simple hierarchy (v2) Rik van Riel
2008-06-04 4:58 [RFC][PATCH 0/2] memcg: hierarchy support (v3) KAMEZAWA Hiroyuki
2008-06-04 5:01 ` [RFC][PATCH 1/2] memcg: res_counter hierarchy KAMEZAWA Hiroyuki
2008-06-04 6:54 ` Li Zefan
2008-06-04 7:03 ` KAMEZAWA Hiroyuki
2008-06-04 7:20 ` YAMAMOTO Takashi
2008-06-04 7:32 ` KAMEZAWA Hiroyuki
2008-06-04 8:59 ` Paul Menage
2008-06-04 9:18 ` KAMEZAWA Hiroyuki
2008-06-09 9:48 ` Balbir Singh
2008-06-09 10:20 ` KAMEZAWA Hiroyuki
2008-06-09 10:37 ` Balbir Singh
2008-06-11 23:24 ` Randy Dunlap
2008-06-12 4:59 ` KAMEZAWA Hiroyuki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080602021540.5C6705A0D@siro.lan \
--to=yamamoto@valinux.co.jp \
--cc=balbir@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--cc=xemul@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox