2015-02-12 20:38:37

by Jens Axboe

[permalink] [raw]
Subject: [GIT PULL] Backing device changes for 3.20

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(-)

--
Jens Axboe


2015-02-12 22:05:04

by Linus Torvalds

[permalink] [raw]
Subject: Re: [GIT PULL] Backing device changes for 3.20

On Thu, Feb 12, 2015 at 12:38 PM, Jens Axboe <[email protected]> wrote:
>
> 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

2015-02-12 22:37:55

by Stephen Rothwell

[permalink] [raw]
Subject: Re: [GIT PULL] Backing device changes for 3.20

Hi All,

On Thu, 12 Feb 2015 14:05:00 -0800 Linus Torvalds <[email protected]> wrote:
>
> On Thu, Feb 12, 2015 at 12:38 PM, Jens Axboe <[email protected]> wrote:
> >
> > 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.

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.)

--
Cheers,
Stephen Rothwell [email protected]


Attachments:
(No filename) (819.00 B)
OpenPGP digital signature

2015-02-12 23:54:01

by Thomas Haynes

[permalink] [raw]
Subject: Re: [GIT PULL] Backing device changes for 3.20

On Thu, Feb 12, 2015 at 02:05:00PM -0800, Linus Torvalds wrote:
> On Thu, Feb 12, 2015 at 12:38 PM, Jens Axboe <[email protected]> wrote:
> >
> > 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.

Yes, I'll make a helper function.

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

> 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...

>
> 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