From: Andrew Morton <akpm@linux-foundation.org>
To: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christoph Hellwig <hch@infradead.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH vfs 1/2] lib: implement ptrset
Date: Tue, 18 Nov 2014 12:46:24 -0800 [thread overview]
Message-ID: <20141118124624.ff0b3140068a090b2860f202@linux-foundation.org> (raw)
In-Reply-To: <20141114131202.GB21209@htj.dyndns.org>
On Fri, 14 Nov 2014 08:12:02 -0500 Tejun Heo <tj@kernel.org> wrote:
> Hello, Andrew.
>
> On Thu, Nov 13, 2014 at 02:40:41PM -0800, Andrew Morton wrote:
> > In that case tjpointer_add() would need to do a kmalloc() for each inode
> > which is added to the bdev/cdev, just as ptrset_add() is doing.
> >
> > That might require a nasty preload thing. But really, for just two
> > known callers it would be better to require the caller to create the
> > storage.
> >
> >
> > struct tjpointer *new_tpj;
> >
> > new_tpj = kmalloc(...);
> > lock();
> > tjpointer_add(&my_tjp_list, new_tjp, my_pointer);
> > unlock();
> >
> > Basically what I'm saying is nuke the rbtree and use lists.
>
> Hah? Then, each removal would be O(N) where N is the number of total
> block devices and there are cases where massive number of block
> devices exist and many are added / removed back-to-back. I don't
> think making those operations O(N^2) is a good idea.
>
bdev_evict_inode() walks all the inodes attached to the bdev and
unlinks them from the bdev. That can be done with
list_for_each_safe(), just as it is (effectively) in current mainline.
IOW, all we need to do is to remove the list_head from struct inode and
create a new, separately allocated { struct list_head l; void *inode }
to point at the inode. IOW, simply convert the intrusive list to a
nonintrusive list.
This is proving a painful way of extracting a changelog :( Perhaps I'm
still not getting it and you should have another go, this time
explaining the reasoning behind the design choices.
next prev parent reply other threads:[~2014-11-18 20:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 22:09 Tejun Heo
2014-11-13 22:11 ` [PATCH vfs 2/2] {block|char}_dev: remove inode->i_devices Tejun Heo
2014-11-18 12:10 ` Boaz Harrosh
2014-11-18 12:30 ` Tejun Heo
2014-11-20 10:42 ` Boaz Harrosh
2014-11-20 11:50 ` Tejun Heo
2014-11-20 12:36 ` Boaz Harrosh
2014-11-20 13:11 ` Tejun Heo
2014-11-20 13:39 ` Tejun Heo
2014-11-20 14:14 ` Boaz Harrosh
2014-11-20 14:19 ` Tejun Heo
2014-11-13 22:23 ` [PATCH vfs 1/2] lib: implement ptrset Andrew Morton
2014-11-13 22:27 ` Tejun Heo
2014-11-13 22:40 ` Andrew Morton
2014-11-14 13:12 ` Tejun Heo
2014-11-18 20:46 ` Andrew Morton [this message]
2014-11-18 9:19 ` Lai Jiangshan
2014-11-18 11:55 ` Tejun Heo
2014-11-19 1:41 ` Lai Jiangshan
2014-11-18 15:56 ` Azat Khuzhin
2014-11-18 17:16 ` Tejun Heo
2014-11-18 17:49 ` [PATCH vfs v2 " Tejun Heo
2014-11-25 16:37 ` [PATCH vfs " Jan Kara
2014-12-02 18:15 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141118124624.ff0b3140068a090b2860f202@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®