Skip to contentSkip to conversation

Backing device changes for 3.20

GIT PULL Jens Axboe 4 participants 4 messages Feb 12, 2015

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

Hi Linus,

This pull request contains a cleanup of how the backing device is handled, in preparation for a rework of the life time rules. In this part, the most important change is to split the unrelated nommu mmap flags from it, but also removing a backing_dev_info pointer from the address_space (and inode), and a cleanup of other various minor bits.

Christoph did all the work here, I just fixed an oops with pages that have a swap backing. Arnd fixed a missing export, and Oleg killed the lustre backing_dev_info from staging. Last patch was from Al, unexporting parts that are now no longer needed outside.

Please pull!

git://git.kernel.dk/linux-block.git for-3.20/bdi

for you to fetch changes up to 15d0f5ea348b9c4e6d41df294dde38a56a39c7bf:

Make super_blocks and sb_lock static (2015-02-02 10:07:59 -0700)

----------------------------------------------------------------
Al Viro (1):
Make super_blocks and sb_lock static

Arnd Bergmann (1):
mtd: export new mtd_mmap_capabilities

Christoph Hellwig (12):
fs: deduplicate noop_backing_dev_info
fs: kill BDI_CAP_SWAP_BACKED
fs: introduce f_op->mmap_capabilities for nommu mmap support
block_dev: only write bdev inode on close
block_dev: get bdev inode bdi directly from the block device
nilfs2: set up s_bdi like the generic mount_bdev code
fs: export inode_to_bdi and use it in favor of mapping->backing_dev_info
fs: remove mapping->backing_dev_info
ceph: remove call to bdi_unregister
nfs: don't call bdi_unregister
fs: don't reassign dirty inodes to default_backing_dev_info
fs: remove default_backing_dev_info

Jens Axboe (1):
fs: make inode_to_bdi() handle NULL inode

Oleg Drokin (1):
staging/lustre/llite: get rid of backing_dev_info

 Documentation/nommu-mmap.txt                    |   8 +-
 block/blk-core.c                                |   2 +-
 drivers/char/mem.c                              |  64 +++++++-------
 drivers/char/raw.c                              |   4 +-
 drivers/mtd/mtdchar.c                           |  72 +++-------------
 drivers/mtd/mtdconcat.c                         |  10 ---
 drivers/mtd/mtdcore.c                           |  81 +++++-------------
 drivers/mtd/mtdpart.c                           |   1 -
 drivers/staging/lustre/lustre/llite/llite_lib.c |   6 +-
 fs/9p/v9fs.c                                    |   2 +-
 fs/afs/volume.c                                 |   2 +-
 fs/aio.c                                        |  13 ---
 fs/block_dev.c                                  |  37 +++-----
 fs/btrfs/disk-io.c                              |   6 +-
 fs/btrfs/file.c                                 |   2 +-
 fs/btrfs/inode.c                                |   6 --
 fs/ceph/file.c                                  |   2 +-
 fs/ceph/inode.c                                 |   2 -
 fs/ceph/super.c                                 |  20 ++---
 fs/char_dev.c                                   |  24 ------
 fs/cifs/connect.c                               |   2 +-
 fs/cifs/inode.c                                 |   2 -
 fs/coda/inode.c                                 |   2 +-
 fs/configfs/configfs_internal.h                 |   2 -
 fs/configfs/inode.c                             |  17 ----
 fs/configfs/mount.c                             |  11 +--
 fs/ecryptfs/inode.c                             |   1 -
 fs/ecryptfs/main.c                              |   2 +-
 fs/exofs/inode.c                                |   2 -
 fs/exofs/super.c                                |   2 +-
 fs/ext2/ialloc.c                                |   2 +-
 fs/ext4/super.c                                 |   2 +-
 fs/fs-writeback.c                               |  14 +++-
 fs/fuse/file.c                                  |  10 +--
 fs/fuse/inode.c                                 |   1 -
 fs/gfs2/aops.c                                  |   2 +-
 fs/gfs2/glock.c                                 |   1 -
 fs/gfs2/ops_fstype.c                            |   1 -
 fs/gfs2/super.c                                 |   2 +-
 fs/hugetlbfs/inode.c                            |  13 ---
 fs/inode.c                                      |  13 ---
 fs/kernfs/inode.c                               |  13 ---
 fs/kernfs/kernfs-internal.h                     |   1 -
 fs/kernfs/mount.c                               |   1 -
 fs/ncpfs/inode.c                                |   3 +-
 fs/nfs/filelayout/filelayout.c                  |   2 +-
 fs/nfs/inode.c                                  |   1 -
 fs/nfs/internal.h                               |   1 -
 fs/nfs/nfs4super.c                              |   1 -
 fs/nfs/super.c                                  |  24 ++----
 fs/nfs/write.c                                  |   6 +-
 fs/nilfs2/gcinode.c                             |   1 -
 fs/nilfs2/mdt.c                                 |   6 +-
 fs/nilfs2/page.c                                |   4 +-
 fs/nilfs2/page.h                                |   3 +-
 fs/nilfs2/super.c                               |   6 +-
 fs/ntfs/file.c                                  |   3 +-
 fs/ocfs2/dlmfs/dlmfs.c                          |  14 ----
 fs/ocfs2/file.c                                 |   2 +-
 fs/ramfs/file-nommu.c                           |   7 ++
 fs/ramfs/inode.c                                |  21 +----
 fs/romfs/mmap-nommu.c                           |  10 +++
 fs/romfs/super.c                                |   3 -
 fs/super.c                                      |  12 +--
 fs/ubifs/dir.c                                  |   2 -
 fs/ubifs/super.c                                |   5 +-
 fs/xfs/xfs_file.c                               |   2 +-
 include/linux/backing-dev.h                     |  53 ++----------
 include/linux/cdev.h                            |   2 -
 include/linux/fs.h                              |  28 ++++++-
 include/linux/mtd/mtd.h                         |   2 +
 include/trace/events/writeback.h                |  12 ++-
 mm/backing-dev.c                                | 107 ++++++------------------
 mm/fadvise.c                                    |   4 +-
 mm/filemap.c                                    |   4 +-
 mm/filemap_xip.c                                |   3 +-
 mm/madvise.c                                    |  17 ++--
 mm/nommu.c                                      |  69 +++++++--------
 mm/page-writeback.c                             |  29 +++----
 mm/readahead.c                                  |   4 +-
 mm/shmem.c                                      |  24 ++----
 mm/swap.c                                       |   2 -
 mm/swap_state.c                                 |   6 --
 mm/truncate.c                                   |   2 +-
 mm/vmscan.c                                     |   4 +-
 security/security.c                             |  13 ++-
 86 files changed, 304 insertions(+), 703 deletions(-)
Signature · 1 line
Jens Axboe
#1 lore raw
Quoted 6 lines · Jens Axboe

This pull request contains a cleanup of how the backing device is handled, in preparation for a rework of the life time rules. In this part, the most important change is to split the unrelated nommu mmap flags from it, but also removing a backing_dev_info pointer from the address_space (and inode), and a cleanup of other various minor bits.

Ugh, so this has a semantic conflict with the NFS client, that has this particular code:

        if (!cinfo->dreq) {
                inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
-               inc_bdi_stat(page_file_mapping(req->wb_page)->backing_dev_info,
+
inc_bdi_stat(inode_to_bdi(page_file_mapping(req->wb_page)->host),
                             BDI_RECLAIMABLE);
                __mark_inode_dirty(req->wb_context->dentry->d_inode,
                                   I_DIRTY_DATASYNC);
        }

duplicated several times, and now one more time in the new fs/nfs/flexfilelayout/flexfilelayout.c file.

I fixed it the same way it was fixed everywhere else, but while fixing and looking at the cases, I *really* feel like the nfs code needs some cleaning up.

That insane complicated and unexplained code exists three times: in filelayout/filelayout.c, flexfilelayout/flexfilelayout.c and in write.c.

The "reverse" case (which does the decrements, and doesn't mark the inode dirty) exists a few more times.

Could we make that a helper function, with a few comments. For example, looking at it, I wonder if

- page_file_mapping(req->wb_page)->host
- req->wb_context->dentry->d_inode

are the same inode?

Hmm?

Linus

#2 lore raw

Hi All,

Quoted 17 lines · On Thu, 12 Feb 2015 14:05:00 -0800 Linus Torvalds…
Quoted 6 lines · Jens Axboe

This pull request contains a cleanup of how the backing device is handled, in preparation for a rework of the life time rules. In this part, the most important change is to split the unrelated nommu mmap flags from it, but also removing a backing_dev_info pointer from the address_space (and inode), and a cleanup of other various minor bits.

Ugh, so this has a semantic conflict with the NFS client, that has this particular code:

        if (!cinfo->dreq) {
                inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
(quoted diff) +1 -1
-               inc_bdi_stat(page_file_mapping(req->wb_page)->backing_dev_info,
+

inc_bdi_stat(inode_to_bdi(page_file_mapping(req->wb_page)->host),

Quoted 7 lines
                             BDI_RECLAIMABLE);
                __mark_inode_dirty(req->wb_context->dentry->d_inode,
                                   I_DIRTY_DATASYNC);
        }

duplicated several times, and now one more time in the new fs/nfs/flexfilelayout/flexfilelayout.c file.

Sometime I wonder why I bother pointing these things out in linux-next :-( Ah, well.

(Trond did mention it in his pull request, but it wasn't a problem then.)

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#3 lore raw
In reply to Linus Torvalds
Quoted 28 lines · Linus Torvalds
Quoted 6 lines · Jens Axboe

This pull request contains a cleanup of how the backing device is handled, in preparation for a rework of the life time rules. In this part, the most important change is to split the unrelated nommu mmap flags from it, but also removing a backing_dev_info pointer from the address_space (and inode), and a cleanup of other various minor bits.

Ugh, so this has a semantic conflict with the NFS client, that has this particular code:

        if (!cinfo->dreq) {
                inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
(quoted diff) +1 -1
-               inc_bdi_stat(page_file_mapping(req->wb_page)->backing_dev_info,
+

inc_bdi_stat(inode_to_bdi(page_file_mapping(req->wb_page)->host),

                             BDI_RECLAIMABLE);
                __mark_inode_dirty(req->wb_context->dentry->d_inode,
                                   I_DIRTY_DATASYNC);
        }

duplicated several times, and now one more time in the new fs/nfs/flexfilelayout/flexfilelayout.c file.

I fixed it the same way it was fixed everywhere else, but while fixing and looking at the cases, I *really* feel like the nfs code needs some cleaning up.

Quoted 8 lines

That insane complicated and unexplained code exists three times: in filelayout/filelayout.c, flexfilelayout/flexfilelayout.c and in write.c.

The "reverse" case (which does the decrements, and doesn't mark the inode dirty) exists a few more times.

Could we make that a helper function, with a few comments.

Yes, I'll make a helper function.

And for the "reverse" case, the second instance can actually call nfs_clear_page_commit().

Quoted 6 lines

For example, looking at it, I wonder if

- page_file_mapping(req->wb_page)->host
- req->wb_context->dentry->d_inode

are the same inode?

Will resolve...

Quoted 8 lines

Hmm?

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html