Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729093

Re: [PATCH 3/3] block/loop: make loop cgroup aware

From Shaohua Li <shli@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] block/loop: make loop cgroup aware
Date 2017-09-08 19:10 +0200
Message-ID <unuX0-1th-13@gated-at.bofh.it> (permalink)
References <umUqt-1Kg-3@gated-at.bofh.it> <umUqu-1Kg-7@gated-at.bofh.it> <unsLx-8nP-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Sep 08, 2017 at 07:48:09AM -0700, Tejun Heo wrote:
> Hello,
> 
> On Wed, Sep 06, 2017 at 07:00:53PM -0700, Shaohua Li wrote:
> > diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> > index 9d4545f..9850b27 100644
> > --- a/drivers/block/loop.c
> > +++ b/drivers/block/loop.c
> > @@ -482,6 +482,8 @@ static void lo_rw_aio_complete(struct kiocb *iocb, long ret, long ret2)
> >  {
> >  	struct loop_cmd *cmd = container_of(iocb, struct loop_cmd, iocb);
> >  
> > +	if (cmd->css)
> > +		css_put(cmd->css);
> >  	cmd->ret = ret > 0 ? 0 : ret;
> >  	lo_rw_aio_do_completion(cmd);
> 
> The fact that we're forwarding explicitly in loop still bothers me a
> bit.  Can you please elaborate why we don't want to do this
> generically through aio?

I think we must forward in loop, because each cmd could come from different
cgroup, so we must explicitly forward for each cmd.

The main reason not to do the forward in aio is complexity. We at least have 3
different implementations for dio:
- __blockdev_direct_IO for ext4 and btrfs
- iomap dio for xfs
- blockdev dio implementation

Forwarding in dio means hooking the cgroup association for each bio dispatched
in the implementations, which is a little messy. I'd like to avoid this if
there is no strong reason to do it.

Thanks,
Shaohua

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] block: make loop block device cgroup aware Shaohua Li <shli@kernel.org> - 2017-09-07 04:10 +0200
  [PATCH 3/3] block/loop: make loop cgroup aware Shaohua Li <shli@kernel.org> - 2017-09-07 04:10 +0200
    Re: [PATCH 3/3] block/loop: make loop cgroup aware Tejun Heo <tj@kernel.org> - 2017-09-08 16:50 +0200
      Re: [PATCH 3/3] block/loop: make loop cgroup aware Shaohua Li <shli@kernel.org> - 2017-09-08 19:10 +0200
        Re: [PATCH 3/3] block/loop: make loop cgroup aware Tejun Heo <tj@kernel.org> - 2017-09-08 20:00 +0200

csiph-web