diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 12:21:09 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 12:21:09 -0500 |
| commit | 0d90d638720ba14874e34cbd8766e4dc3f14f458 (patch) | |
| tree | 5080f0335c1454ae6a3ef6b29834af20ae08a952 /include | |
| parent | 1d32bdafaaa8bcc4c39b41ab9f674887d147f188 (diff) | |
| parent | bf39c00a9a7f3cdb5ce7d6695d9f044daf8f0b53 (diff) | |
Merge tag 'for-f2fs-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
Pull f2fs updates from Jaegeuk Kim:
"In this round, a couple of sysfs entries were introduced to tune the
f2fs at runtime.
In addition, f2fs starts to support inline_data and improves the
read/write performance in some workloads by refactoring bio-related
flows.
This patch-set includes the following major enhancement patches.
- support inline_data
- refactor bio operations such as merge operations and rw type
assignment
- enhance the direct IO path
- enhance bio operations
- truncate a node page when it becomes obsolete
- add sysfs entries: small_discards, max_victim_search, and
in-place-update
- add a sysfs entry to control max_victim_search
The other bug fixes are as follows.
- fix a bug in truncate_partial_nodes
- avoid warnings during sparse and build process
- fix error handling flows
- fix potential bit overflows
And, there are a bunch of cleanups"
* tag 'for-f2fs-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (95 commits)
f2fs: drop obsolete node page when it is truncated
f2fs: introduce NODE_MAPPING for code consistency
f2fs: remove the orphan block page array
f2fs: add help function META_MAPPING
f2fs: move a branch for code redability
f2fs: call mark_inode_dirty to flush dirty pages
f2fs: clean checkpatch warnings
f2fs: missing REQ_META and REQ_PRIO when sync_meta_pages(META_FLUSH)
f2fs: avoid f2fs_balance_fs call during pageout
f2fs: add delimiter to seperate name and value in debug phrase
f2fs: use spinlock rather than mutex for better speed
f2fs: move alloc new orphan node out of lock protection region
f2fs: move grabing orphan pages out of protection region
f2fs: remove the needless parameter of f2fs_wait_on_page_writeback
f2fs: update documents and a MAINTAINERS entry
f2fs: add a sysfs entry to control max_victim_search
f2fs: improve write performance under frequent fsync calls
f2fs: avoid to read inline data except first page
f2fs: avoid to left uninitialized data in page when read inline data
f2fs: fix truncate_partial_nodes bug
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/f2fs_fs.h | 7 | ||||
| -rw-r--r-- | include/trace/events/f2fs.h | 107 |
2 files changed, 89 insertions, 25 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index bb942f6d5702..da74d878dc4f 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h | |||
| @@ -153,6 +153,13 @@ struct f2fs_extent { | |||
| 153 | #define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) | 153 | #define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) |
| 154 | 154 | ||
| 155 | #define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ | 155 | #define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ |
| 156 | #define F2FS_INLINE_DATA 0x02 /* file inline data flag */ | ||
| 157 | |||
| 158 | #define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \ | ||
| 159 | F2FS_INLINE_XATTR_ADDRS - 1)) | ||
| 160 | |||
| 161 | #define INLINE_DATA_OFFSET (PAGE_CACHE_SIZE - sizeof(struct node_footer) \ | ||
| 162 | - sizeof(__le32) * (DEF_ADDRS_PER_INODE + 5 - 1)) | ||
| 156 | 163 | ||
| 157 | struct f2fs_inode { | 164 | struct f2fs_inode { |
| 158 | __le16 i_mode; /* file mode */ | 165 | __le16 i_mode; /* file mode */ |
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index e0dc355fa317..3b9f28dfc849 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h | |||
| @@ -16,15 +16,28 @@ | |||
| 16 | { META, "META" }, \ | 16 | { META, "META" }, \ |
| 17 | { META_FLUSH, "META_FLUSH" }) | 17 | { META_FLUSH, "META_FLUSH" }) |
| 18 | 18 | ||
| 19 | #define show_bio_type(type) \ | 19 | #define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA)) |
| 20 | __print_symbolic(type, \ | 20 | #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO)) |
| 21 | { READ, "READ" }, \ | 21 | |
| 22 | { READA, "READAHEAD" }, \ | 22 | #define show_bio_type(type) show_bio_base(type), show_bio_extra(type) |
| 23 | { READ_SYNC, "READ_SYNC" }, \ | 23 | |
| 24 | { WRITE, "WRITE" }, \ | 24 | #define show_bio_base(type) \ |
| 25 | { WRITE_SYNC, "WRITE_SYNC" }, \ | 25 | __print_symbolic(F2FS_BIO_MASK(type), \ |
| 26 | { WRITE_FLUSH, "WRITE_FLUSH" }, \ | 26 | { READ, "READ" }, \ |
| 27 | { WRITE_FUA, "WRITE_FUA" }) | 27 | { READA, "READAHEAD" }, \ |
| 28 | { READ_SYNC, "READ_SYNC" }, \ | ||
| 29 | { WRITE, "WRITE" }, \ | ||
| 30 | { WRITE_SYNC, "WRITE_SYNC" }, \ | ||
| 31 | { WRITE_FLUSH, "WRITE_FLUSH" }, \ | ||
| 32 | { WRITE_FUA, "WRITE_FUA" }, \ | ||
| 33 | { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" }) | ||
| 34 | |||
| 35 | #define show_bio_extra(type) \ | ||
| 36 | __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \ | ||
| 37 | { REQ_META, "(M)" }, \ | ||
| 38 | { REQ_PRIO, "(P)" }, \ | ||
| 39 | { REQ_META | REQ_PRIO, "(MP)" }, \ | ||
| 40 | { 0, " \b" }) | ||
| 28 | 41 | ||
| 29 | #define show_data_type(type) \ | 42 | #define show_data_type(type) \ |
| 30 | __print_symbolic(type, \ | 43 | __print_symbolic(type, \ |
| @@ -421,7 +434,7 @@ TRACE_EVENT(f2fs_truncate_partial_nodes, | |||
| 421 | __entry->err) | 434 | __entry->err) |
| 422 | ); | 435 | ); |
| 423 | 436 | ||
| 424 | TRACE_EVENT_CONDITION(f2fs_readpage, | 437 | TRACE_EVENT_CONDITION(f2fs_submit_page_bio, |
| 425 | 438 | ||
| 426 | TP_PROTO(struct page *page, sector_t blkaddr, int type), | 439 | TP_PROTO(struct page *page, sector_t blkaddr, int type), |
| 427 | 440 | ||
| @@ -446,7 +459,7 @@ TRACE_EVENT_CONDITION(f2fs_readpage, | |||
| 446 | ), | 459 | ), |
| 447 | 460 | ||
| 448 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " | 461 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " |
| 449 | "blkaddr = 0x%llx, bio_type = %s", | 462 | "blkaddr = 0x%llx, bio_type = %s%s", |
| 450 | show_dev_ino(__entry), | 463 | show_dev_ino(__entry), |
| 451 | (unsigned long)__entry->index, | 464 | (unsigned long)__entry->index, |
| 452 | (unsigned long long)__entry->blkaddr, | 465 | (unsigned long long)__entry->blkaddr, |
| @@ -598,36 +611,54 @@ TRACE_EVENT(f2fs_reserve_new_block, | |||
| 598 | __entry->ofs_in_node) | 611 | __entry->ofs_in_node) |
| 599 | ); | 612 | ); |
| 600 | 613 | ||
| 601 | TRACE_EVENT(f2fs_do_submit_bio, | 614 | DECLARE_EVENT_CLASS(f2fs__submit_bio, |
| 602 | 615 | ||
| 603 | TP_PROTO(struct super_block *sb, int btype, bool sync, struct bio *bio), | 616 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), |
| 604 | 617 | ||
| 605 | TP_ARGS(sb, btype, sync, bio), | 618 | TP_ARGS(sb, rw, type, bio), |
| 606 | 619 | ||
| 607 | TP_STRUCT__entry( | 620 | TP_STRUCT__entry( |
| 608 | __field(dev_t, dev) | 621 | __field(dev_t, dev) |
| 609 | __field(int, btype) | 622 | __field(int, rw) |
| 610 | __field(bool, sync) | 623 | __field(int, type) |
| 611 | __field(sector_t, sector) | 624 | __field(sector_t, sector) |
| 612 | __field(unsigned int, size) | 625 | __field(unsigned int, size) |
| 613 | ), | 626 | ), |
| 614 | 627 | ||
| 615 | TP_fast_assign( | 628 | TP_fast_assign( |
| 616 | __entry->dev = sb->s_dev; | 629 | __entry->dev = sb->s_dev; |
| 617 | __entry->btype = btype; | 630 | __entry->rw = rw; |
| 618 | __entry->sync = sync; | 631 | __entry->type = type; |
| 619 | __entry->sector = bio->bi_sector; | 632 | __entry->sector = bio->bi_sector; |
| 620 | __entry->size = bio->bi_size; | 633 | __entry->size = bio->bi_size; |
| 621 | ), | 634 | ), |
| 622 | 635 | ||
| 623 | TP_printk("dev = (%d,%d), type = %s, io = %s, sector = %lld, size = %u", | 636 | TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u", |
| 624 | show_dev(__entry), | 637 | show_dev(__entry), |
| 625 | show_block_type(__entry->btype), | 638 | show_bio_type(__entry->rw), |
| 626 | __entry->sync ? "sync" : "no sync", | 639 | show_block_type(__entry->type), |
| 627 | (unsigned long long)__entry->sector, | 640 | (unsigned long long)__entry->sector, |
| 628 | __entry->size) | 641 | __entry->size) |
| 629 | ); | 642 | ); |
| 630 | 643 | ||
| 644 | DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio, | ||
| 645 | |||
| 646 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), | ||
| 647 | |||
| 648 | TP_ARGS(sb, rw, type, bio), | ||
| 649 | |||
| 650 | TP_CONDITION(bio) | ||
| 651 | ); | ||
| 652 | |||
| 653 | DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio, | ||
| 654 | |||
| 655 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), | ||
| 656 | |||
| 657 | TP_ARGS(sb, rw, type, bio), | ||
| 658 | |||
| 659 | TP_CONDITION(bio) | ||
| 660 | ); | ||
| 661 | |||
| 631 | DECLARE_EVENT_CLASS(f2fs__page, | 662 | DECLARE_EVENT_CLASS(f2fs__page, |
| 632 | 663 | ||
| 633 | TP_PROTO(struct page *page, int type), | 664 | TP_PROTO(struct page *page, int type), |
| @@ -674,15 +705,16 @@ DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite, | |||
| 674 | TP_ARGS(page, type) | 705 | TP_ARGS(page, type) |
| 675 | ); | 706 | ); |
| 676 | 707 | ||
| 677 | TRACE_EVENT(f2fs_submit_write_page, | 708 | TRACE_EVENT(f2fs_submit_page_mbio, |
| 678 | 709 | ||
| 679 | TP_PROTO(struct page *page, block_t blk_addr, int type), | 710 | TP_PROTO(struct page *page, int rw, int type, block_t blk_addr), |
| 680 | 711 | ||
| 681 | TP_ARGS(page, blk_addr, type), | 712 | TP_ARGS(page, rw, type, blk_addr), |
| 682 | 713 | ||
| 683 | TP_STRUCT__entry( | 714 | TP_STRUCT__entry( |
| 684 | __field(dev_t, dev) | 715 | __field(dev_t, dev) |
| 685 | __field(ino_t, ino) | 716 | __field(ino_t, ino) |
| 717 | __field(int, rw) | ||
| 686 | __field(int, type) | 718 | __field(int, type) |
| 687 | __field(pgoff_t, index) | 719 | __field(pgoff_t, index) |
| 688 | __field(block_t, block) | 720 | __field(block_t, block) |
| @@ -691,13 +723,15 @@ TRACE_EVENT(f2fs_submit_write_page, | |||
| 691 | TP_fast_assign( | 723 | TP_fast_assign( |
| 692 | __entry->dev = page->mapping->host->i_sb->s_dev; | 724 | __entry->dev = page->mapping->host->i_sb->s_dev; |
| 693 | __entry->ino = page->mapping->host->i_ino; | 725 | __entry->ino = page->mapping->host->i_ino; |
| 726 | __entry->rw = rw; | ||
| 694 | __entry->type = type; | 727 | __entry->type = type; |
| 695 | __entry->index = page->index; | 728 | __entry->index = page->index; |
| 696 | __entry->block = blk_addr; | 729 | __entry->block = blk_addr; |
| 697 | ), | 730 | ), |
| 698 | 731 | ||
| 699 | TP_printk("dev = (%d,%d), ino = %lu, %s, index = %lu, blkaddr = 0x%llx", | 732 | TP_printk("dev = (%d,%d), ino = %lu, %s%s, %s, index = %lu, blkaddr = 0x%llx", |
| 700 | show_dev_ino(__entry), | 733 | show_dev_ino(__entry), |
| 734 | show_bio_type(__entry->rw), | ||
| 701 | show_block_type(__entry->type), | 735 | show_block_type(__entry->type), |
| 702 | (unsigned long)__entry->index, | 736 | (unsigned long)__entry->index, |
| 703 | (unsigned long long)__entry->block) | 737 | (unsigned long long)__entry->block) |
| @@ -727,6 +761,29 @@ TRACE_EVENT(f2fs_write_checkpoint, | |||
| 727 | __entry->msg) | 761 | __entry->msg) |
| 728 | ); | 762 | ); |
| 729 | 763 | ||
| 764 | TRACE_EVENT(f2fs_issue_discard, | ||
| 765 | |||
| 766 | TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen), | ||
| 767 | |||
| 768 | TP_ARGS(sb, blkstart, blklen), | ||
| 769 | |||
| 770 | TP_STRUCT__entry( | ||
| 771 | __field(dev_t, dev) | ||
| 772 | __field(block_t, blkstart) | ||
| 773 | __field(block_t, blklen) | ||
| 774 | ), | ||
| 775 | |||
| 776 | TP_fast_assign( | ||
| 777 | __entry->dev = sb->s_dev; | ||
| 778 | __entry->blkstart = blkstart; | ||
| 779 | __entry->blklen = blklen; | ||
| 780 | ), | ||
| 781 | |||
| 782 | TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx", | ||
| 783 | show_dev(__entry), | ||
| 784 | (unsigned long long)__entry->blkstart, | ||
| 785 | (unsigned long long)__entry->blklen) | ||
| 786 | ); | ||
| 730 | #endif /* _TRACE_F2FS_H */ | 787 | #endif /* _TRACE_F2FS_H */ |
| 731 | 788 | ||
| 732 | /* This part must be outside protection */ | 789 | /* This part must be outside protection */ |
