Re: [f2fs-dev] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinamani wrote: > On Thu, Jun 1, 2017 at 5:36 PM, John Stultz wrote: >> On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng wrote: >>> On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann

Re: [f2fs-dev] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread John Stultz
On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng wrote: > On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann wrote: >> On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote: >>> On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani >>>

Re: [f2fs-dev] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Deepa Dinamani
On Thu, Jun 1, 2017 at 5:36 PM, John Stultz wrote: > On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng wrote: >> On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann wrote: >>> On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote:

Re: [f2fs-dev] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann wrote: > On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote: >> On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani >> wrote: > >>> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c >>> index

Re: [f2fs-dev] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann wrote: > On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote: >> On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani >> wrote: > >>> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c >>> index

Re: [f2fs-dev] [PATCH 1/1] f2fs: sanity check size of nat and sit cache

2017-06-01 Thread Jaegeuk Kim
Hi Jin, The patch format is not applicable to be merged. I'll take care of this at this time, so please check it from f2fs/dev-test. Thanks, On 06/01, Jin Qian wrote: > Make sure number of entires doesn't exceed max journal size. > > Cc: sta...@vger.kernel.org > Signed-off-by: Jin Qian

Re: [f2fs-dev] [PATCH v2] f2fs: remove false-positive bug_on

2017-06-01 Thread Jaegeuk Kim
For example, f2fs_create - new_node_page is failed - handle_failed_inode - skip to add it into orphan list, since ni.blk_addr == NULL_ADDR : set_inode_flag(inode, FI_FREE_NID) f2fs_evict_inode - EIO due to fault injection - f2fs_bug_on() is triggered So, we don't need to call

[f2fs-dev] [PATCH 1/1] f2fs: sanity check size of nat and sit cache

2017-06-01 Thread Jin Qian
Make sure number of entires doesn't exceed max journal size. Cc: sta...@vger.kernel.org Signed-off-by: Jin Qian --- fs/f2fs/segment.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index de31030b5041..b07385630150

Re: [f2fs-dev] [Cluster-devel] [PATCH 00/35 v1] pagevec API cleanups

2017-06-01 Thread Jan Kara
On Thu 01-06-17 04:36:04, Christoph Hellwig wrote: > On Thu, Jun 01, 2017 at 11:32:10AM +0200, Jan Kara wrote: > > * Implement ranged variants for pagevec_lookup and find_get_ functions. Lot > > of callers actually want a ranged lookup and we unnecessarily opencode > > this > > in lot of

Re: [f2fs-dev] [Cluster-devel] [PATCH 00/35 v1] pagevec API cleanups

2017-06-01 Thread Christoph Hellwig
On Thu, Jun 01, 2017 at 11:32:10AM +0200, Jan Kara wrote: > * Implement ranged variants for pagevec_lookup and find_get_ functions. Lot > of callers actually want a ranged lookup and we unnecessarily opencode this > in lot of them. How does this compare to Kents page cache iterators:

Re: [f2fs-dev] [PATCH 01/35] fscache: Remove unused ->now_uncached callback

2017-06-01 Thread Jan Kara
On Thu 01-06-17 11:26:08, David Howells wrote: > Jan Kara wrote: > > > The callback doesn't ever get called. Remove it. > > Hmmm... I should perhaps be calling this. I'm not sure why I never did. > > At the moment, it doesn't strictly matter as ops on pages marked with >

Re: [f2fs-dev] [PATCH 01/35] fscache: Remove unused ->now_uncached callback

2017-06-01 Thread David Howells
Jan Kara wrote: > The callback doesn't ever get called. Remove it. Hmmm... I should perhaps be calling this. I'm not sure why I never did. At the moment, it doesn't strictly matter as ops on pages marked with PG_fscache get ignored if the cache has suffered an I/O error or has

Re: [f2fs-dev] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Arnd Bergmann
On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote: > On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani wrote: >> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c >> index 517838b..77204da 100644 >> --- a/drivers/block/rbd.c >> +++

Re: [f2fs-dev] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts()

2017-06-01 Thread Yan, Zheng
On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani wrote: > CURRENT_TIME is not y2038 safe. > The macro will be deleted and all the references to it > will be replaced by ktime_get_* apis. > > struct timespec is also not y2038 safe. > Retain timespec for timestamp

[f2fs-dev] [PATCH 19/35] f2fs: Simplify page iteration loops

2017-06-01 Thread Jan Kara
In several places we want to iterate over all tagged pages in a mapping. However the code was apparently copied from places that iterate only over a limited range and thus it checks for index <= end, optimizes the case where we are coming close to range end which is all pointless when end ==

[f2fs-dev] [PATCH 34/35] mm: Make find_get_entries_tag() update index

2017-06-01 Thread Jan Kara
Make find_get_entries_tag() update 'start' to index the next page for iteration. Signed-off-by: Jan Kara --- fs/dax.c| 3 +-- include/linux/pagemap.h | 2 +- mm/filemap.c| 8 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git

[f2fs-dev] [PATCH 26/35] afs: Use find_get_pages_range_tag()

2017-06-01 Thread Jan Kara
Use find_get_pages_range_tag() in afs_writepages_region() as we are interested only in pages from given range. Remove unnecessary code after this conversion. CC: David Howells CC: linux-...@lists.infradead.org Signed-off-by: Jan Kara --- fs/afs/write.c | 11

[f2fs-dev] [PATCH 07/35] mm: Implement find_get_pages_range()

2017-06-01 Thread Jan Kara
Implement a variant of find_get_pages() that stops iterating at given index. This may be substantial performance gain if the mapping is sparse. See following commit for details. Furthermore lots of users of this function (through pagevec_lookup()) actually want a range lookup and all of them are

[f2fs-dev] [PATCH 25/35] mm: Remove nr_pages argument from pagevec_lookup_{, range}_tag()

2017-06-01 Thread Jan Kara
All users of pagevec_lookup() and pagevec_lookup_range() now pass PAGEVEC_SIZE as a desired number of pages. Just drop the argument. Signed-off-by: Jan Kara --- fs/btrfs/extent_io.c| 6 +++--- fs/ceph/addr.c | 3 +-- fs/ext4/inode.c | 2 +-

[f2fs-dev] [PATCH 21/35] gfs2: Use pagevec_lookup_range_tag()

2017-06-01 Thread Jan Kara
We want only pages from given range in gfs2_write_cache_jdata(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: Bob Peterson CC: cluster-de...@redhat.com Signed-off-by: Jan Kara --- fs/gfs2/aops.c | 20

[f2fs-dev] [PATCH 35/35] mm: Implement find_get_entries_range_tag()

2017-06-01 Thread Jan Kara
Implement find_get_entries_range_tag() (actually convert find_get_entries_tag() tag to it as the only user of find_get_entries_tag() needs a ranged lookup) and use it in DAX which is the only user of this interface. This is mostly for consistency with other page/entry iteration interfaces.

[f2fs-dev] [PATCH 18/35] f2fs: Use pagevec_lookup_range_tag()

2017-06-01 Thread Jan Kara
We want only pages from given range in f2fs_write_cache_pages(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: Jaegeuk Kim CC: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Jan Kara --- fs/f2fs/data.c |

[f2fs-dev] [PATCH 05/35] mm: Fix THP handling in invalidate_mapping_pages()

2017-06-01 Thread Jan Kara
The condition checking for THP straddling end of invalidated range is wrong - it checks 'index' against 'end' but 'index' has been already advanced to point to the end of THP and thus the condition can never be true. As a result THP straddling 'end' has been fully invalidated. Given the nature of

[f2fs-dev] [PATCH 13/35] mm: Remove nr_pages argument from pagevec_lookup{, _range}()

2017-06-01 Thread Jan Kara
All users of pagevec_lookup() and pagevec_lookup_range() now pass PAGEVEC_SIZE as a desired number of pages. Just drop the argument. Signed-off-by: Jan Kara --- fs/buffer.c | 3 +-- fs/ext4/file.c | 2 +- fs/ext4/inode.c | 5 ++--- fs/fscache/page.c

[f2fs-dev] [PATCH 29/35] mm: Make pagevec_lookup_entries() update index

2017-06-01 Thread Jan Kara
Make pagevec_lookup_entries() (and underlying find_get_entries()) update index to the next page where iteration should continue. This is mostly for consistency with pagevec_lookup() and future pagevec_lookup_entries_range(). Signed-off-by: Jan Kara --- include/linux/pagemap.h | 2

[f2fs-dev] [PATCH 15/35] btrfs: Use pagevec_lookup_range_tag()

2017-06-01 Thread Jan Kara
We want only pages from given range in btree_write_cache_pages() and extent_write_cache_pages(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: linux-bt...@vger.kernel.org CC: David Sterba Signed-off-by: Jan Kara

[f2fs-dev] [PATCH 17/35] ext4: Use pagevec_lookup_range_tag()

2017-06-01 Thread Jan Kara
We want only pages from given range in ext4_writepages(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: "Theodore Ts'o" CC: linux-e...@vger.kernel.org Signed-off-by: Jan Kara --- fs/ext4/inode.c | 14 ++

[f2fs-dev] [PATCH 11/35] hugetlbfs: Use pagevec_lookup_range() in remove_inode_hugepages()

2017-06-01 Thread Jan Kara
We want only pages from given range in remove_inode_hugepages(). Use pagevec_lookup_range() instead of pagevec_lookup(). CC: Nadia Yvette Chambers Signed-off-by: Jan Kara --- fs/hugetlbfs/inode.c | 18 ++ 1 file changed, 2 insertions(+), 16

[f2fs-dev] [PATCH 10/35] ext4: Use pagevec_lookup_range() in writeback code

2017-06-01 Thread Jan Kara
Both occurences of pagevec_lookup() actually want only pages from a given range. Use pagevec_lookup_range() for the lookup. CC: "Theodore Ts'o" CC: linux-e...@vger.kernel.org Signed-off-by: Jan Kara --- fs/ext4/inode.c | 12 +--- 1 file changed, 5

[f2fs-dev] [PATCH 08/35] fs: Fix performance regression in clean_bdev_aliases()

2017-06-01 Thread Jan Kara
Commit e64855c6cfaa "fs: Add helper to clean bdev aliases under a bh and use it" added a wrapper for clean_bdev_aliases() that invalidates bdev aliases underlying a single buffer head. However this has caused a performance regression for bonnie++ benchmark on ext4 filesystem when delayed

[f2fs-dev] [PATCH 20/35] f2fs: Use find_get_pages_tag() for looking up single page

2017-06-01 Thread Jan Kara
__get_first_dirty_index() wants to lookup only the first dirty page after given index. There's no point in using pagevec_lookup_tag() for that. Just use find_get_pages_tag() directly. CC: Jaegeuk Kim CC: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Jan Kara

[f2fs-dev] [PATCH 22/35] nilfs2: Use pagevec_lookup_range_tag()

2017-06-01 Thread Jan Kara
We want only pages from given range in nilfs_lookup_dirty_data_buffers(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: Ryusuke Konishi CC: linux-ni...@vger.kernel.org Signed-off-by: Jan Kara ---

[f2fs-dev] [PATCH 30/35] mm: Implement find_get_entries_range()

2017-06-01 Thread Jan Kara
Implement a variant of find_get_entries() that stops iterating at given index. Some callers want this, so let's provide the interface. Also it makes the interface consistent with find_get_pages(). Signed-off-by: Jan Kara --- include/linux/pagemap.h | 13 ++---

[f2fs-dev] [PATCH 27/35] shmem: Use pagevec_lookup() in shmem_unlock_mapping()

2017-06-01 Thread Jan Kara
The comment about find_get_pages() returning if it finds a row of swap entries seems to be stale. Use pagevec_lookup() in shmem_unlock_mapping() to simplify the code. CC: Hugh Dickins Signed-off-by: Jan Kara --- mm/shmem.c | 14 ++ 1 file changed, 2

[f2fs-dev] [PATCH 33/35] mm: Remove nr_entries argument from pagevec_lookup_entries{, _range}()

2017-06-01 Thread Jan Kara
All users pass PAGEVEC_SIZE as the number of entries now. Remove the argument. Signed-off-by: Jan Kara --- include/linux/pagevec.h | 7 +++ mm/shmem.c | 4 ++-- mm/swap.c | 6 ++ mm/truncate.c | 8 4 files changed, 11

[f2fs-dev] [PATCH 24/35] mm: Use pagevec_lookup_range_tag() in write_cache_pages()

2017-06-01 Thread Jan Kara
Use pagevec_lookup_range_tag() in write_cache_pages() as it is interested only in pages from given range. Remove unnecessary code resulting from this. Signed-off-by: Jan Kara --- mm/page-writeback.c | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff

[f2fs-dev] [PATCH 16/35] ceph: Use pagevec_lookup_range_tag()

2017-06-01 Thread Jan Kara
We want only pages from given range in ceph_writepages_start(). Use pagevec_lookup_range_tag() instead of pagevec_lookup_tag() and remove unnecessary code. CC: Ilya Dryomov CC: "Yan, Zheng" CC: ceph-de...@vger.kernel.org Signed-off-by: Jan Kara

[f2fs-dev] [PATCH 01/35] fscache: Remove unused ->now_uncached callback

2017-06-01 Thread Jan Kara
The callback doesn't ever get called. Remove it. Signed-off-by: Jan Kara --- Documentation/filesystems/caching/netfs-api.txt | 2 -- fs/9p/cache.c | 29 - fs/afs/cache.c | 43

[f2fs-dev] [PATCH 23/35] mm: Use pagevec_lookup_range_tag() in __filemap_fdatawait_range()

2017-06-01 Thread Jan Kara
Use pagevec_lookup_range_tag() in __filemap_fdatawait_range() as it is interested only in pages from given range. Remove unnecessary code resulting from this. Signed-off-by: Jan Kara --- mm/filemap.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git

[f2fs-dev] [PATCH 00/35 v1] pagevec API cleanups

2017-06-01 Thread Jan Kara
Hello, This series cleans up pagevec API. The original motivation for the series is the patch "fs: Fix performance regression in clean_bdev_aliases()" however it has somewhat grown beyond that... The series is pretty large but most of the patches are trivial in nature. What the series does is: *

[f2fs-dev] [PATCH 14/35] mm: Implement find_get_pages_range_tag()

2017-06-01 Thread Jan Kara
Implement a variant of find_get_pages_tag() that stops iterating at given index. Lots of users of this function (through pagevec_lookup()) actually want a range lookup and all of them are currently open-coding this. Also create corresponding pagevec_lookup_range_tag() function. Signed-off-by:

[f2fs-dev] [PATCH 06/35] mm: Make pagevec_lookup() update index

2017-06-01 Thread Jan Kara
Make pagevec_lookup() (and underlying find_get_pages()) update index to the next page where iteration should continue. Most callers want this and also pagevec_lookup_tag() already does this. Signed-off-by: Jan Kara --- fs/buffer.c | 6 ++ fs/ext4/file.c |

[f2fs-dev] [PATCH 02/35] ext4: Fix SEEK_HOLE

2017-06-01 Thread Jan Kara
Currently, SEEK_HOLE implementation in ext4 may both return that there's a hole at some offset although that offset already has data and skip some holes during a search for the next hole. The first problem is demostrated by: xfs_io -c "falloc 0 256k" -c "pwrite 0 56k" -c "seek -h 0" file wrote

[f2fs-dev] [PATCH 03/35] ext4: Fix off-by-in in loop termination in ext4_find_unwritten_pgoff()

2017-06-01 Thread Jan Kara
There is an off-by-one error in loop termination conditions in ext4_find_unwritten_pgoff() since 'end' may index a page beyond end of desired range if 'endoff' is page aligned. It doesn't have any visible effects but still it is good to fix it. Signed-off-by: Jan Kara ---

[f2fs-dev] [PATCH 04/35] dax: Fix inefficiency in dax_writeback_mapping_range()

2017-06-01 Thread Jan Kara
dax_writeback_mapping_range() fails to update iteration index when searching radix tree for entries needing cache flushing. Thus each pagevec worth of entries is searched starting from the start which is inefficient and prone to livelocks. Update index properly. CC: sta...@vger.kernel.org Fixes:

[f2fs-dev] [PATCH 12/35] xfs: Use pagevec_lookup_range() in xfs_find_get_desired_pgoff()

2017-06-01 Thread Jan Kara
We want only pages from given range in xfs_find_get_desired_pgoff(). Use pagevec_lookup_range() instead of pagevec_lookup() and remove unnecessary code. Note that the check for getting less pages than desired can be removed because index gets updated by pagevec_lookup_range(). CC: Darrick J. Wong

[f2fs-dev] [PATCH] f2fs: fix a panic caused by NULL flush_cmd_control

2017-06-01 Thread Yunlei He
Mount fs with option noflush_merge, boot failed for illegal address fcc in function f2fs_issue_flush: if (!test_opt(sbi, FLUSH_MERGE)) { ret = submit_flush_wait(sbi); atomic_inc(>issued_flush); -> Here, fcc illegal return ret; }