[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190807183151.GM136335@devbig004.ftw2.facebook.com>
Date: Wed, 7 Aug 2019 11:31:51 -0700
From: Tejun Heo <tj@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: axboe@...nel.dk, jack@...e.cz, hannes@...xchg.org,
mhocko@...nel.org, vdavydov.dev@...il.com, cgroups@...r.kernel.org,
linux-mm@...ck.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-team@...com, guro@...com
Subject: Re: [PATCH 2/4] bdi: Add bdi->id
Hello,
On Tue, Aug 06, 2019 at 04:01:02PM -0700, Andrew Morton wrote:
> On Sat, 3 Aug 2019 07:01:53 -0700 Tejun Heo <tj@...nel.org> wrote:
> > There currently is no way to universally identify and lookup a bdi
> > without holding a reference and pointer to it. This patch adds an
> > non-recycling bdi->id and implements bdi_get_by_id() which looks up
> > bdis by their ids. This will be used by memcg foreign inode flushing.
>
> Why is the id non-recycling? Presumably to address some
> lifetime/lookup issues, but what are they?
The ID by itself is used to point to the bdi from cgroup and idr
recycles really aggressively. Combined with, for example, loop device
based containers, stale pointing can become pretty common. We're
having similar issues with cgroup IDs.
> Why was the IDR code not used?
Because of the rapid recycling. In the longer term, I think we want
IDR to be able to support non-recycling IDs, or at least less
agressive recycling.
> > +struct backing_dev_info *bdi_get_by_id(u64 id)
> > +{
> > + struct backing_dev_info *bdi = NULL;
> > + struct rb_node **p;
> > +
> > + spin_lock_irq(&bdi_lock);
>
> Why irq-safe? Everywhere else uses spin_lock_bh(&bdi_lock).
By mistake, I'll change them to bh.
Thanks.
--
tejun
Powered by blists - more mailing lists