[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNsoNeQNMmdplmtp@dschatzberg-fedora-PC0Y6AEN>
Date: Tue, 29 Jun 2021 10:03:33 -0400
From: Dan Schatzberg <schatzberg.dan@...il.com>
To: Michal Koutný <mkoutny@...e.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
"open list:BLOCK LAYER" <linux-block@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:CONTROL GROUP (CGROUP)" <cgroups@...r.kernel.org>,
"open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>,
Johannes Weiner <hannes@...xchg.org>,
Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH 3/3] loop: Charge i/o to mem and blk cg
> Non-inlining in the loop module doesn't seem like a big trouble. OTOH,
> other callers may be more sensitive and would need to rely on inlining.
Yes, this is my concern as well.
> I can't currently think of a nice way to have both the exported and the
> exlicitly inlined variant at once. It seems it's either API or perf
> craft in the end but both are uncertain, so I guess the current approach
> is fine in the end.
>
> > Yes it is intentional. All requests (not just aio) go through the loop
> > worker which grabs the blkcg reference in loop_queue_work() on
> > construction. So I believe grabbing a reference per request is
> > unnecessary.
>
> Isn't there a window without the reference between loop_queue_rq and
> loop_queue_work?
Hmm, perhaps I'm not understanding how the reference counting works,
but my understanding is that we enter loop_queue_rq with presumably
some code earlier holding a reference to the blkcg, we only need to
acquire a reference sometime before returning from loop_queue_rq. The
"window" between loop_queue_rq and loop_queue_work is all
straight-line code so there's no possibility for the earlier code to
get control back and drop the reference.
> I don't know, you seem to know better, so I'd suggest
> dropping a comment line into the code explaining this.
I wouldn't be so sure that I know any better here :D - I'm fairly
inexperienced in this domain.
Where would you suggest putting such a comment? The change in question
removed a particular case where we explicitly grab a reference to the
blkcg because now we do it uniformly in one place. Would you like a
comment explaining why we acquire a reference for all loop workers or
one explaining specifically why we don't need to acquire one for aio?
Powered by blists - more mailing lists