<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/inode.c, branch v3.3-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>vfs: remove printk from set_nlink()</title>
<updated>2012-01-17T21:39:47+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2012-01-12T11:41:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=424a5334a5235c2fbb80090b18a065eeceb51d64'/>
<id>424a5334a5235c2fbb80090b18a065eeceb51d64</id>
<content type='text'>
Don't log a message for set_nlink(0).

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't log a message for set_nlink(0).

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mm: account reaped page cache on inode cache pruning</title>
<updated>2012-01-11T00:30:42+00:00</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@openvz.org</email>
</author>
<published>2012-01-10T23:07:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5f8aefd44e64ed2f6950a1dcc77309b7dd9979f4'/>
<id>5f8aefd44e64ed2f6950a1dcc77309b7dd9979f4</id>
<content type='text'>
Inode cache pruning indirectly reclaims page-cache by invalidating mapping
pages.  Let's account them into reclaim-state to notice this progress in
memory reclaimer.

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@openvz.org&gt;
Cc: Dave Chinner &lt;david@fromorbit.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inode cache pruning indirectly reclaims page-cache by invalidating mapping
pages.  Let's account them into reclaim-state to notice this progress in
memory reclaimer.

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@openvz.org&gt;
Cc: Dave Chinner &lt;david@fromorbit.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: count unlinked inodes</title>
<updated>2012-01-07T04:20:12+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2011-11-21T11:11:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7ada4db88634429f4da690ad1c4eb73c93085f0c'/>
<id>7ada4db88634429f4da690ad1c4eb73c93085f0c</id>
<content type='text'>
Add a new counter to the superblock that keeps track of unlinked but
not yet deleted inodes.

Do not WARN_ON if set_nlink is called with zero count, just do a
ratelimited printk.  This happens on xfs and probably other
filesystems after an unclean shutdown when the filesystem reads inodes
which already have zero i_nlink.  Reported by Christoph Hellwig.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Tested-by: Toshiyuki Okajima &lt;toshi.okajima@jp.fujitsu.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new counter to the superblock that keeps track of unlinked but
not yet deleted inodes.

Do not WARN_ON if set_nlink is called with zero count, just do a
ratelimited printk.  This happens on xfs and probably other
filesystems after an unclean shutdown when the filesystem reads inodes
which already have zero i_nlink.  Reported by Christoph Hellwig.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Tested-by: Toshiyuki Okajima &lt;toshi.okajima@jp.fujitsu.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>switch inode_init_owner() to umode_t</title>
<updated>2012-01-04T03:55:11+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-07-25T03:20:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=62bb109170375f82eb3c51c8080b72954f02dca7'/>
<id>62bb109170375f82eb3c51c8080b72954f02dca7</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: fix the stupidity with i_dentry in inode destructors</title>
<updated>2012-01-04T03:52:40+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-12-12T20:51:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6b520e0565422966cdf1c3759bd73df77b0f248c'/>
<id>6b520e0565422966cdf1c3759bd73df77b0f248c</id>
<content type='text'>
Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
the cost of taking it into inode_init_always() will be negligible for pipes
and sockets and negative for everything else.  Not to mention the removal of
boilerplate code from -&gt;destroy_inode() instances...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
the cost of taking it into inode_init_always() will be negligible for pipes
and sockets and negative for everything else.  Not to mention the removal of
boilerplate code from -&gt;destroy_inode() instances...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: mnt_drop_write_file()</title>
<updated>2012-01-04T03:52:40+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-12-09T13:06:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2a79f17e4a641a2f463cb512cb0ec349844a147b'/>
<id>2a79f17e4a641a2f463cb512cb0ec349844a147b</id>
<content type='text'>
new helper (wrapper around mnt_drop_write()) to be used in pair with
mnt_want_write_file().

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
new helper (wrapper around mnt_drop_write()) to be used in pair with
mnt_want_write_file().

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: protect i_nlink</title>
<updated>2011-11-02T11:53:43+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2011-10-28T12:13:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a78ef704a8dd430225955f0709b22d4a6ba21deb'/>
<id>a78ef704a8dd430225955f0709b22d4a6ba21deb</id>
<content type='text'>
Prevent direct modification of i_nlink by making it const and adding a
non-const __i_nlink alias.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Tested-by: Toshiyuki Okajima &lt;toshi.okajima@jp.fujitsu.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prevent direct modification of i_nlink by making it const and adding a
non-const __i_nlink alias.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Tested-by: Toshiyuki Okajima &lt;toshi.okajima@jp.fujitsu.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: fix spinning prevention in prune_icache_sb</title>
<updated>2011-10-28T12:58:55+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2011-10-28T08:03:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=62a3ddef6181d7d932c565d97552d2f7b9ab4d28'/>
<id>62a3ddef6181d7d932c565d97552d2f7b9ab4d28</id>
<content type='text'>
We need to move the inode to the end of the list to actually make the
spinning prevention explained in the comment above it work.  With a
plain list_move it will simply stay in place as we're always reclaiming
from the head of the list.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need to move the inode to the end of the list to actually make the
spinning prevention explained in the comment above it work.  With a
plain list_move it will simply stay in place as we're always reclaiming
from the head of the list.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lockdep: Add helper function for dir vs file i_mutex annotation</title>
<updated>2011-08-25T17:50:18+00:00</updated>
<author>
<name>Josh Boyer</name>
<email>jwboyer@redhat.com</email>
</author>
<published>2011-08-25T11:48:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e096d0c7e2e4e5893792db865dd065ac73cf1f00'/>
<id>e096d0c7e2e4e5893792db865dd065ac73cf1f00</id>
<content type='text'>
Purely in-memory filesystems do not use the inode hash as the dcache
tells us if an entry already exists.  As a result, they do not call
unlock_new_inode, and thus directory inodes do not get put into a
different lockdep class for i_sem.

We need the different lockdep classes, because the locking order for
i_mutex is different for directory inodes and regular inodes.  Directory
inodes can do "readdir()", which takes i_mutex *before* possibly taking
mm-&gt;mmap_sem (due to a page fault while copying the directory entry to
user space).

In contrast, regular inodes can be mmap'ed, which takes mm-&gt;mmap_sem
before accessing i_mutex.

The two cases can never happen for the same inode, so no real deadlock
can occur, but without the different lockdep classes, lockdep cannot
understand that.  As a result, if CONFIG_DEBUG_LOCK_ALLOC is set, this
can lead to false positives from lockdep like below:

    find/645 is trying to acquire lock:
     (&amp;mm-&gt;mmap_sem){++++++}, at: [&lt;ffffffff81109514&gt;] might_fault+0x5c/0xac

    but task is already holding lock:
     (&amp;sb-&gt;s_type-&gt;i_mutex_key#15){+.+.+.}, at: [&lt;ffffffff81149f34&gt;]
    vfs_readdir+0x5b/0xb4

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -&gt; #1 (&amp;sb-&gt;s_type-&gt;i_mutex_key#15){+.+.+.}:
          [&lt;ffffffff8108ac26&gt;] lock_acquire+0xbf/0x103
          [&lt;ffffffff814db822&gt;] __mutex_lock_common+0x4c/0x361
          [&lt;ffffffff814dbc46&gt;] mutex_lock_nested+0x40/0x45
          [&lt;ffffffff811daa87&gt;] hugetlbfs_file_mmap+0x82/0x110
          [&lt;ffffffff81111557&gt;] mmap_region+0x258/0x432
          [&lt;ffffffff811119dd&gt;] do_mmap_pgoff+0x2ac/0x306
          [&lt;ffffffff81111b4f&gt;] sys_mmap_pgoff+0x118/0x16a
          [&lt;ffffffff8100c858&gt;] sys_mmap+0x22/0x24
          [&lt;ffffffff814e3ec2&gt;] system_call_fastpath+0x16/0x1b

    -&gt; #0 (&amp;mm-&gt;mmap_sem){++++++}:
          [&lt;ffffffff8108a4bc&gt;] __lock_acquire+0xa1a/0xcf7
          [&lt;ffffffff8108ac26&gt;] lock_acquire+0xbf/0x103
          [&lt;ffffffff81109541&gt;] might_fault+0x89/0xac
          [&lt;ffffffff81149cff&gt;] filldir+0x6f/0xc7
          [&lt;ffffffff811586ea&gt;] dcache_readdir+0x67/0x205
          [&lt;ffffffff81149f54&gt;] vfs_readdir+0x7b/0xb4
          [&lt;ffffffff8114a073&gt;] sys_getdents+0x7e/0xd1
          [&lt;ffffffff814e3ec2&gt;] system_call_fastpath+0x16/0x1b

This patch moves the directory vs file lockdep annotation into a helper
function that can be called by in-memory filesystems and has hugetlbfs
call it.

Signed-off-by: Josh Boyer &lt;jwboyer@redhat.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purely in-memory filesystems do not use the inode hash as the dcache
tells us if an entry already exists.  As a result, they do not call
unlock_new_inode, and thus directory inodes do not get put into a
different lockdep class for i_sem.

We need the different lockdep classes, because the locking order for
i_mutex is different for directory inodes and regular inodes.  Directory
inodes can do "readdir()", which takes i_mutex *before* possibly taking
mm-&gt;mmap_sem (due to a page fault while copying the directory entry to
user space).

In contrast, regular inodes can be mmap'ed, which takes mm-&gt;mmap_sem
before accessing i_mutex.

The two cases can never happen for the same inode, so no real deadlock
can occur, but without the different lockdep classes, lockdep cannot
understand that.  As a result, if CONFIG_DEBUG_LOCK_ALLOC is set, this
can lead to false positives from lockdep like below:

    find/645 is trying to acquire lock:
     (&amp;mm-&gt;mmap_sem){++++++}, at: [&lt;ffffffff81109514&gt;] might_fault+0x5c/0xac

    but task is already holding lock:
     (&amp;sb-&gt;s_type-&gt;i_mutex_key#15){+.+.+.}, at: [&lt;ffffffff81149f34&gt;]
    vfs_readdir+0x5b/0xb4

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -&gt; #1 (&amp;sb-&gt;s_type-&gt;i_mutex_key#15){+.+.+.}:
          [&lt;ffffffff8108ac26&gt;] lock_acquire+0xbf/0x103
          [&lt;ffffffff814db822&gt;] __mutex_lock_common+0x4c/0x361
          [&lt;ffffffff814dbc46&gt;] mutex_lock_nested+0x40/0x45
          [&lt;ffffffff811daa87&gt;] hugetlbfs_file_mmap+0x82/0x110
          [&lt;ffffffff81111557&gt;] mmap_region+0x258/0x432
          [&lt;ffffffff811119dd&gt;] do_mmap_pgoff+0x2ac/0x306
          [&lt;ffffffff81111b4f&gt;] sys_mmap_pgoff+0x118/0x16a
          [&lt;ffffffff8100c858&gt;] sys_mmap+0x22/0x24
          [&lt;ffffffff814e3ec2&gt;] system_call_fastpath+0x16/0x1b

    -&gt; #0 (&amp;mm-&gt;mmap_sem){++++++}:
          [&lt;ffffffff8108a4bc&gt;] __lock_acquire+0xa1a/0xcf7
          [&lt;ffffffff8108ac26&gt;] lock_acquire+0xbf/0x103
          [&lt;ffffffff81109541&gt;] might_fault+0x89/0xac
          [&lt;ffffffff81149cff&gt;] filldir+0x6f/0xc7
          [&lt;ffffffff811586ea&gt;] dcache_readdir+0x67/0x205
          [&lt;ffffffff81149f54&gt;] vfs_readdir+0x7b/0xb4
          [&lt;ffffffff8114a073&gt;] sys_getdents+0x7e/0xd1
          [&lt;ffffffff814e3ec2&gt;] system_call_fastpath+0x16/0x1b

This patch moves the directory vs file lockdep annotation into a helper
function that can be called by in-memory filesystems and has hugetlbfs
call it.

Signed-off-by: Josh Boyer &lt;jwboyer@redhat.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfs: optimize inode cache access patterns</title>
<updated>2011-08-07T05:53:23+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-08-07T05:45:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3ddcd0569cd68f00f3beae9a7959b72918bb91f4'/>
<id>3ddcd0569cd68f00f3beae9a7959b72918bb91f4</id>
<content type='text'>
The inode structure layout is largely random, and some of the vfs paths
really do care.  The path lookup in particular is already quite D$
intensive, and profiles show that accessing the 'inode-&gt;i_op-&gt;xyz'
fields is quite costly.

We already optimized the dcache to not unnecessarily load the d_op
structure for members that are often NULL using the DCACHE_OP_xyz bits
in dentry-&gt;d_flags, and this does something very similar for the inode
ops that are used during pathname lookup.

It also re-orders the fields so that the fields accessed by 'stat' are
together at the beginning of the inode structure, and roughly in the
order accessed.

The effect of this seems to be in the 1-2% range for an empty kernel
"make -j" run (which is fairly kernel-intensive, mostly in filename
lookup), so it's visible.  The numbers are fairly noisy, though, and
likely depend a lot on exact microarchitecture.  So there's more tuning
to be done.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The inode structure layout is largely random, and some of the vfs paths
really do care.  The path lookup in particular is already quite D$
intensive, and profiles show that accessing the 'inode-&gt;i_op-&gt;xyz'
fields is quite costly.

We already optimized the dcache to not unnecessarily load the d_op
structure for members that are often NULL using the DCACHE_OP_xyz bits
in dentry-&gt;d_flags, and this does something very similar for the inode
ops that are used during pathname lookup.

It also re-orders the fields so that the fields accessed by 'stat' are
together at the beginning of the inode structure, and roughly in the
order accessed.

The effect of this seems to be in the 1-2% range for an empty kernel
"make -j" run (which is fairly kernel-intensive, mostly in filename
lookup), so it's visible.  The numbers are fairly noisy, though, and
likely depend a lot on exact microarchitecture.  So there's more tuning
to be done.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
