From: yamamoto@valinux.co.jp (YAMAMOTO Takashi)
To: balbir@linux.vnet.ibm.com
Cc: minoura@valinux.co.jp, nishimura@mxp.nes.nec.co.jp,
linux-mm@kvack.org, containers@lists.osdl.org, hugh@veritas.com
Subject: Re: [RFC][PATCH] another swap controller for cgroup
Date: Wed, 14 May 2008 12:21:25 +0900 (JST) [thread overview]
Message-ID: <20080514032125.46F7D5A07@siro.lan> (raw)
In-Reply-To: Your message of "Thu, 08 May 2008 21:13:50 +0530" <48231FB6.7000206@linux.vnet.ibm.com>
> >>> + BUG_ON(mm == NULL);
> >>> + BUG_ON(mm->swap_cgroup == NULL);
> >>> + if (scg == NULL) {
> >>> + /*
> >>> + * see swap_cgroup_attach.
> >>> + */
> >>> + smp_rmb();
> >>> + scg = mm->swap_cgroup;
> >> With the mm->owner patches, we need not maintain a separate
> >> mm->swap_cgroup.
> >
> > i don't think the mm->owner patch, at least with the current form,
> > can replace it.
> >
>
> Could you please mention what the limitations are? We could get those fixed or
> take another serious look at the mm->owner patches.
for example, its callback can't sleep.
> >>> + /*
> >>> + * swap_cgroup_attach is in progress.
> >>> + */
> >>> +
> >>> + res_counter_charge_force(&newscg->scg_counter, PAGE_CACHE_SIZE);
> >> So, we force the counter to go over limit?
> >
> > yes.
> >
> > as newscg != oldscg here means the task is being moved between cgroups,
> > this instance of res_counter_charge_force should not matter much.
> >
>
> Isn't it bad to force a group to go over it's limit due to migration?
we don't have many choices as far as ->attach can't fail.
although we can have racy checks in ->can_attach, i'm not happy with it.
> >> We need to write actual numbers here? Can't we keep the write
> >> interface consistent with the memory controller?
> >
> > i'm not sure what you mean here. can you explain a bit more?
> > do you mean K, M, etc?
> >
>
> Yes, I mean the same format that memparse() uses.
i'll take a look.
> >> Is moving to init_mm (root
> >> cgroup) a good idea? Ideally with support for hierarchies, if we ever
> >> do move things, it should be to the parent cgroup.
> >
> > i chose init_mm because there seemed to be no consensus about
> > cgroup hierarchy semantics.
> >
>
> I would suggest that we fail deletion of a group for now. I have a set of
> patches for the cgroup hierarchy semantics. I think the parent is the best place
> to move it.
ok.
> >>> + info->swap_cgroup = newscg;
> >>> + res_counter_uncharge(&oldscg->scg_counter, bytes);
> >>> + res_counter_charge_force(&newscg->scg_counter, bytes);
> >> I don't like the excessive use of res_counter_charge_force(), it seems
> >> like we might end up bypassing the controller all together. I would
> >> rather fail the destroy operation if the charge fails.
> >
> >>> + bytes = swslots * PAGE_CACHE_SIZE;
> >>> + res_counter_uncharge(&oldscg->scg_counter, bytes);
> >>> + /*
> >>> + * XXX ignore newscg's limit because cgroup ->attach method can't fail.
> >>> + */
> >>> + res_counter_charge_force(&newscg->scg_counter, bytes);
> >> But in the future, we could plan on making attach fail (I have a
> >> requirement for it). Again, I don't like the _force operation
> >
> > allowing these operations fail implies to have code to back out
> > partial operations. i'm afraid that it will be too complex.
> >
>
> OK, we need to find out a way to fix that then.
note that a failure can affect other subsystems which belong to
the same hierarchy as well, and, even worse, a back-out attempt can also fail.
i'm afraid that we need to play some kind of transaction-commit game,
which can make subsystems too complex to implement properly.
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-05-14 3:21 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-17 2:04 YAMAMOTO Takashi
2008-03-17 5:11 ` Balbir Singh
2008-03-17 8:15 ` Daisuke Nishimura
2008-03-17 8:50 ` YAMAMOTO Takashi
2008-04-29 22:50 ` YAMAMOTO Takashi
2008-04-30 4:09 ` Daisuke Nishimura
2008-05-22 4:46 ` YAMAMOTO Takashi
2008-05-22 4:54 ` Daisuke Nishimura
2008-05-05 6:11 ` Balbir Singh
2008-05-07 5:50 ` YAMAMOTO Takashi
2008-05-08 15:43 ` Balbir Singh
2008-05-14 3:21 ` YAMAMOTO Takashi [this message]
2008-05-14 3:27 ` Paul Menage
2008-05-14 8:44 ` Paul Menage
2008-05-15 6:23 ` YAMAMOTO Takashi
2008-05-15 7:19 ` Paul Menage
2008-05-15 8:56 ` YAMAMOTO Takashi
2008-05-15 12:01 ` Daisuke Nishimura
2008-05-19 4:14 ` YAMAMOTO Takashi
2008-03-24 12:10 ` Daisuke Nishimura
2008-03-24 12:22 ` Balbir Singh
2008-03-25 6:46 ` Daisuke Nishimura
2008-03-25 3:10 ` YAMAMOTO Takashi
2008-03-25 4:35 ` Daisuke Nishimura
2008-03-25 8:57 ` YAMAMOTO Takashi
2008-03-25 12:35 ` Daisuke Nishimura
2008-03-27 6:28 ` YAMAMOTO Takashi
2008-03-28 9:00 ` Daisuke Nishimura
[not found] ` <47ECB3B1.6040500-YQH0OdQVrdy45+QrQBaojngSJqDPrsil@public.gmane.org>
2008-04-08 3:29 ` YAMAMOTO Takashi
2008-04-10 7:40 ` YAMAMOTO Takashi
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=20080514032125.46F7D5A07@siro.lan \
--to=yamamoto@valinux.co.jp \
--cc=balbir@linux.vnet.ibm.com \
--cc=containers@lists.osdl.org \
--cc=hugh@veritas.com \
--cc=linux-mm@kvack.org \
--cc=minoura@valinux.co.jp \
--cc=nishimura@mxp.nes.nec.co.jp \
/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