lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150327214613.GF638@htj.duckdns.org>
Date:	Fri, 27 Mar 2015 17:46:13 -0400
From:	Tejun Heo <tj@...nel.org>
To:	Vivek Goyal <vgoyal@...hat.com>
Cc:	axboe@...nel.dk, linux-kernel@...r.kernel.org, jack@...e.cz,
	hch@...radead.org, hannes@...xchg.org,
	linux-fsdevel@...r.kernel.org, lizefan@...wei.com,
	cgroups@...r.kernel.org, linux-mm@...ck.org, mhocko@...e.cz,
	clm@...com, fengguang.wu@...el.com, david@...morbit.com,
	gthelen@...gle.com
Subject: Re: [PATCH 28/48] writeback: implement and use mapping_congested()

Hello, Vivek.

On Fri, Mar 27, 2015 at 02:06:26PM -0400, Vivek Goyal wrote:
...
> > +int mapping_congested(struct address_space *mapping,
> > +		      struct task_struct *task, int cong_bits)
> > +{
> > +	struct inode *inode = mapping->host;
> > +	struct backing_dev_info *bdi = inode_to_bdi(inode);
> > +	struct bdi_writeback *wb;
> > +	int ret = 0;
> > +
> > +	if (!inode || !inode_cgwb_enabled(inode))
> > +		return wb_congested(&bdi->wb, cong_bits);
> > +
> > +	rcu_read_lock();
> > +	wb = wb_find_current(bdi);
> 
> I am wondering that why do we lookup bdi_writeback using blkcg of
> task and why not use the bdi_writeback associated with inode?
> 
> IIUC, whole idea is to attach an inode to bdi_writeback (and
> change it later if need be) and that writeback is used for
> controlling IO to that inode. And blkcg associated with the
> writeback will be put in bio which in turn will be used
> by block layer.
> 
> IOW, blkcg of a bio gets decided by the bdi_writeback
> attached to inode and current writer does not seem to
> matter. So I am not sure why mapping_congested() should
> take task's blkcg into consideration instead of just
> taking bdi_writeback from inode and see if it is congested
> or not.

Yeap, I agree that attributing to the inode's blkcg makes more sense.
I need to think more about it but will prolly change it to use
inode->i_wb instead.

Thanks.

-- 
tejun
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ