Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755635AbYFPIvh (ORCPT ); Mon, 16 Jun 2008 04:51:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756945AbYFPIvO (ORCPT ); Mon, 16 Jun 2008 04:51:14 -0400 Received: from sacred.ru ([62.205.161.221]:43717 "EHLO sacred.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756070AbYFPIvN (ORCPT ); Mon, 16 Jun 2008 04:51:13 -0400 Message-ID: <48562894.5080307@openvz.org> Date: Mon, 16 Jun 2008 12:47:16 +0400 From: Pavel Emelyanov User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: kamezawa.hiroyu@jp.fujitsu.com CC: linux-mm@kvack.org, LKML , menage@google.com, balbir@linux.vnet.ibm.com, yamamoto@valinux.co.jp, nishimura@mxp.nes.nec.co.jp, lizf@cn.fujitsu.com Subject: Re: [PATCH 1/6] res_counter: handle limit change References: <4856231B.9050704@openvz.org> <48561B68.6060503@openvz.org> <48560A7C.9050501@openvz.org> <20080613182714.265fe6d2.kamezawa.hiroyu@jp.fujitsu.com> <20080613182924.c73fe9eb.kamezawa.hiroyu@jp.fujitsu.com> <33011576.1213601977563.kamezawa.hiroyu@jp.fujitsu.com> <11930674.1213604250738.kamezawa.hiroyu@jp.fujitsu.com> <11706925.1213605137616.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <11706925.1213605137616.kamezawa.hiroyu@jp.fujitsu.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (sacred.ru [62.205.161.221]); Mon, 16 Jun 2008 12:49:35 +0400 (MSD) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2260 Lines: 64 kamezawa.hiroyu@jp.fujitsu.com wrote: > ----- Original Message ----- > >> kamezawa.hiroyu@jp.fujitsu.com wrote: >>> ----- Original Message ----- >>> >>>>> I think when I did all in memcg, someone will comment that "why do that >>>>> all in memcg ? please implement generic one to avoid code duplication" >>>> Hm... But we're choosing between >>>> >>>> sys_write->xxx_cgroup_write->res_counter_set_limit->xxx_cgroup_call >>>> >>>> and >>>> >>>> sys_write->xxx_cgroup_write->res_counter_set_limit >>>> ->xxx_cgroup_call >>>> >>>> With the sizeof(void *)-bytes difference in res_counter, nNo? >>>> >>> I can't catch what you mean. What is res_counter_set_limit here ? >> It's res_counter_resize_limit from your patch, sorry for the confusion. >> >>> (my patche's ?) and what is sizeof(void *)-bytes ? >> I meant, that we have to add 4 bytes (8 on 64-bit arches) on the >> struct res_counter to store the pointer on the res_counter_ops. >> > Okay, maye all you want is "don't increase the size of res_counter" Actually no, what I want is not to put indirections level when not required. But keeping res_counter as small as possible is also my wish. :) >>> Is it so strange to add following algorithm in res_counter? >>> == >>> set_limit -> fail -> shrink -> set limit -> fail ->shrink >>> -> success -> return 0 >>> == >>> I think this is enough generic. >> It is, but my point is - we're calling the set_limit (this is a >> res_counter_resize_limit from your patch, sorry for the confusion again) >> routine right from the cgroup's write callback and thus can call >> the desired "ops->shrink_usage" directly, w/o additional level of >> indirection. >> > Hmm, to do that, I'd like to remove strategy function from res_counter. Oops... I'm looking at 2.6.26-rc5-mm1's res_counter and don't see such. I tried to follow the changes in res_counter, but it looks like I've already missed something. What do you mean by "strategy function from res_counter"? > Ok? > > Thanks, > -Kame > -- 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/