From: Jan Kara <jack@suse.cz>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Jan Kara <jack@suse.cz>,
hch@lst.de, linux-fsdevel@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] chardev: Increment cdev reference count when i_cdev references it
Date: Wed, 5 Nov 2014 17:54:18 +0100 [thread overview]
Message-ID: <20141105165418.GD30558@quack.suse.cz> (raw)
In-Reply-To: <20141104160301.GJ7996@ZenIV.linux.org.uk>
On Tue 04-11-14 16:03:03, Al Viro wrote:
> On Tue, Nov 04, 2014 at 04:55:43PM +0100, Jan Kara wrote:
> > > That consequence looks broken, IMO.
> > Hum, it already behaves for block devices that way (and noone complained
> > - but admittedly block devices tied to strange modules are less common than
> > character devices). Also rmmod isn't that common IMO, but I see your point
> > that it's unintuitive behavior.
>
> Umm... Since when? The last time I looked, bdev module refcounts were
> tied to struct gendisk, not to struct block_device.
Ah, right you are. So how about clearing i_cdev and dropping reference to
it when inode is not open anymore? Doing first open after a cleanup would
be more expensive but it doesn't seem too much. For block devices first
open of it is also more expensive - although there bd_openers is per block
device while for character devices we would have the openers per device
inode. I don't think that's a real difference in practice unless you run
some container service. If you think it would help, we could add some
intermediate structure for character devices with similar rules like struct
block_device for block devices (and character device references would be
handled in the same way as we handle gendisk references for block devices).
However I don't think it's really worth the bother...
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2014-11-05 16:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-22 20:14 [PATCH 0/4 v2] fs: Remove i_devices from struct inode Jan Kara
2014-10-22 20:14 ` [PATCH 1/4] blockdev: Don't use i_devices inode field Jan Kara
2014-11-04 9:42 ` Christoph Hellwig
2014-10-22 20:14 ` [PATCH 2/4] chardev: Increment cdev reference count when i_cdev references it Jan Kara
2014-11-04 9:52 ` Christoph Hellwig
2014-11-04 10:01 ` Jan Kara
2014-11-04 14:46 ` Al Viro
2014-11-04 15:37 ` Jan Kara
2014-11-04 15:40 ` Al Viro
2014-11-04 15:55 ` Jan Kara
2014-11-04 16:03 ` Al Viro
2014-11-05 16:54 ` Jan Kara [this message]
2014-10-22 20:14 ` [PATCH 3/4] chardev: Don't use i_devices inode field Jan Kara
2014-11-04 9:54 ` Christoph Hellwig
2014-10-22 20:14 ` [PATCH 4/4] fs: Remove i_devices list head Jan Kara
2014-11-04 9:55 ` Christoph Hellwig
2014-10-31 9:48 ` [PATCH 0/4 v2] fs: Remove i_devices from struct inode Jan Kara
-- strict thread matches above, loose matches on Subject: below --
2014-11-04 10:27 [PATCH 0/4 v3] " Jan Kara
2014-11-04 10:27 ` [PATCH 2/4] chardev: Increment cdev reference count when i_cdev references it Jan Kara
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=20141105165418.GD30558@quack.suse.cz \
--to=jack@suse.cz \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).