linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 0/4 v3] fs: Remove i_devices from struct inode
Date: Tue, 4 Nov 2014 11:52:22 -0800	[thread overview]
Message-ID: <CALCETrViY8biMs=D9XKAJx-9m5iEEUCbpzmOR2QFVyxcdoczxQ@mail.gmail.com> (raw)
In-Reply-To: <54592D49.4070704@amacapital.net>

On Tue, Nov 4, 2014 at 11:47 AM, Andy Lutomirski <luto@amacapital.net> wrote:
> On 11/04/2014 07:39 AM, Al Viro wrote:
>> On Tue, Nov 04, 2014 at 11:27:27AM +0100, Jan Kara wrote:
>>>   Hello,
>>>
>>>   this patch set removes use of i_devices from block and character device
>>> code and thus we can remove the list head from struct inode thus saving two
>>> pointers in it. As Christoph has reviewed the series, can you please merge
>>> it Al? Thanks!
>>>
>>> Since v2 I've added reviewed-by tags from Christoph and changed one variable
>>> name in cdev_forget().
>>>
>>> Since v1 I have split the patches and properly handled character devices (I
>>> broke them last time as Christoph pointed out).
>>
>> My problem with that is in buggered module refcounts (which was the reason
>> for doing those non-counting references back then).  Suppose you open
>> /dev/some_char_device and close it; having the module pinned down until
>> the inode of that sucker gets evicted by dcache/icache memory pressure
>> would be wrong - it _isn't_ in use, and there's no way short of forcing
>> the full eviction of VFS caches to get it possible to unload...
>>
>
> At the risk of asking what may be a rather dumb question...
>
> Why do device node inodes need to be cached at all?  In other words,
> when you try open a device node, can't the kernel materialize the inode
> from just information that's in the dentry without touching the
> filesystem at all?  If that's true, couldn't all device inodes be
> dropped from icache as soon as they're unreferenced?
>
> (Yes, there's mtime, but I never understood why tracking mtime on device
> nodes made any sense in the first place.)

On further reflection, this is indeed a dumb question.  i_rdev is in
the inode, so of course the inode is useful.

Let me try again, though: what if a chardev inode replaced i_cdev with
NULL and dropped its kobj reference in iput_final?  This would add a
bit over overhead to things that repeatedly open and close the same
device node, but I doubt this matters much.

--Andy

  reply	other threads:[~2014-11-04 19:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 10:27 [PATCH 0/4 v3] fs: Remove i_devices from struct inode Jan Kara
2014-11-04 10:27 ` [PATCH 1/4] blockdev: Don't use i_devices inode field Jan Kara
2014-11-04 10:27 ` [PATCH 2/4] chardev: Increment cdev reference count when i_cdev references it Jan Kara
2014-11-04 10:27 ` [PATCH 3/4] chardev: Don't use i_devices inode field Jan Kara
2014-11-04 10:27 ` [PATCH 4/4] fs: Remove i_devices list head Jan Kara
2014-11-04 15:39 ` [PATCH 0/4 v3] fs: Remove i_devices from struct inode Al Viro
2014-11-04 19:47   ` Andy Lutomirski
2014-11-04 19:52     ` Andy Lutomirski [this message]
2014-11-04 20:16       ` Al Viro
2014-11-04 20:24         ` Andy Lutomirski
2014-11-04 19:55     ` Jan Kara
2014-11-04 20:14       ` Andy Lutomirski
2014-11-04 20:20         ` Al Viro
2014-11-04 20:25           ` Andy Lutomirski

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='CALCETrViY8biMs=D9XKAJx-9m5iEEUCbpzmOR2QFVyxcdoczxQ@mail.gmail.com' \
    --to=luto@amacapital.net \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --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).