Skip to content

Commit

Permalink
[PATCH] invalidate_bdev() speedup
Browse files Browse the repository at this point in the history
We can immediately bail from invalidate_bdev() if the blockdev has no
pagecache.

This solves the huge IPI storms which hald is causing on the big ia64
machines when it polls CDROM drives.

Acked-by: Jes Sorensen <jes@sgi.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Jul 31, 2006
1 parent a268cef commit 0e1dfc6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,18 @@ __find_get_block_slow(struct block_device *bdev, sector_t block)
pass does the actual I/O. */
void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers)
{
struct address_space *mapping = bdev->bd_inode->i_mapping;

if (mapping->nrpages == 0)
return;

invalidate_bh_lrus();
/*
* FIXME: what about destroy_dirty_buffers?
* We really want to use invalidate_inode_pages2() for
* that, but not until that's cleaned up.
*/
invalidate_inode_pages(bdev->bd_inode->i_mapping);
invalidate_inode_pages(mapping);
}

/*
Expand Down

0 comments on commit 0e1dfc6

Please sign in to comment.