[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090421153137.GL19637@balbir.in.ibm.com>
Date: Tue, 21 Apr 2009 21:01:37 +0530
From: Balbir Singh <balbir@...ux.vnet.ibm.com>
To: Ryo Tsuruta <ryov@...inux.co.jp>, randy.dunlap@...cle.com,
axboe@...nel.dk, dradford@...ehost.com, akpm@...ux-foundation.org,
ngupta@...gle.com, fernando@....ntt.co.jp,
linux-kernel@...r.kernel.org, chlunde@...g.uio.no,
dave@...ux.vnet.ibm.com, roberto@...it.it, agk@...rceware.org,
matt@...ehost.com, containers@...ts.linux-foundation.org,
menage@...gle.com, subrata@...ux.vnet.ibm.com,
eric.rannaud@...il.com
Subject: Re: [PATCH 3/9] bio-cgroup controller
* Andrea Righi <righi.andrea@...il.com> [2009-04-20 16:56:59]:
> On Mon, Apr 20, 2009 at 08:35:40PM +0900, Ryo Tsuruta wrote:
> > > > +/*
> > > > + * Assign "page" the same owner as "opage."
> > > > + */
> > > > +void bio_cgroup_copy_owner(struct page *npage, struct page *opage)
> > > > +{
> > > > + struct page_cgroup *npc, *opc;
> > > > +
> > > > + if (bio_cgroup_disabled())
> > > > + return;
> > > > + npc = lookup_page_cgroup(npage);
> > > > + if (unlikely(!npc))
> > > > + return;
> > > > + opc = lookup_page_cgroup(opage);
> > > > + if (unlikely(!opc))
> > > > + return;
> > > > +
> > > > + /*
> > > > + * Do this without any locks. The reason is the same as
> > > > + * bio_cgroup_reset_owner().
> > > > + */
> > > > + npc->bio_cgroup_id = opc->bio_cgroup_id;
> > >
> > > What protects npc and opc?
> >
> > As the same reason mentioned above, bio_cgroup_id can be updated
> > without any locks, and npc and opc always point to page_cgroups.
> > An integer variable can be set a new value at once on a system which
> > can use RCU lock.
>
> mmmh... I'm not sure about this. Actually you read opc->bio_cgroup_id
> first and then write to npc->bio_cgroup_id, so it is not atomic at all.
> So, you can read or set a wrong ID, but at least it should be always
> consistent (the single read or write itself is atomic).
Quick concern here, how long does it take for the data to become
consistent? Can we have a group misuse the bandwidth during that time?
What about conditions where you have a wrong ID, but the group
associated with the wrong ID is gone?
--
Balbir
--
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