Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1687745 > unrolled thread
| Started by | Jaegeuk Kim <jaegeuk@kernel.org> |
|---|---|
| First post | 2017-07-15 03:30 +0200 |
| Last post | 2017-07-18 03:50 +0200 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] f2fs: avoid cpu lockup Jaegeuk Kim <jaegeuk@kernel.org> - 2017-07-15 03:30 +0200
Re: [PATCH v2] f2fs: avoid cpu lockup Jaegeuk Kim <jaegeuk@kernel.org> - 2017-07-16 03:10 +0200
Re: [f2fs-dev] [PATCH v2] f2fs: avoid cpu lockup Chao Yu <chao@kernel.org> - 2017-07-17 16:40 +0200
Re: [f2fs-dev] [PATCH v2] f2fs: avoid cpu lockup Jaegeuk Kim <jaegeuk@kernel.org> - 2017-07-18 00:40 +0200
Re: [f2fs-dev] [PATCH v2] f2fs: avoid cpu lockup Chao Yu <yuchao0@huawei.com> - 2017-07-18 03:50 +0200
| From | Jaegeuk Kim <jaegeuk@kernel.org> |
|---|---|
| Date | 2017-07-15 03:30 +0200 |
| Subject | [PATCH] f2fs: avoid cpu lockup |
| Message-ID | <u3k4a-3a5-19@gated-at.bofh.it> |
Before retrying to flush data or dentry pages, we need to release cpu in order to prevent watchdog. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> --- fs/f2fs/checkpoint.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 56bbf592e487..c96913c56f6c 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -909,8 +909,11 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type) * wribacking dentry pages in the freeing inode. */ f2fs_submit_merged_write(sbi, DATA); - cond_resched(); } + /* We need to give a chance to get cpu for user file writers. */ + if (!is_dir) + congestion_wait(BLK_RW_ASYNC, HZ/50); + cond_resched(); goto retry; } -- 2.13.0.rc1.294.g07d810a77f-goog
[toc] | [next] | [standalone]
| From | Jaegeuk Kim <jaegeuk@kernel.org> |
|---|---|
| Date | 2017-07-16 03:10 +0200 |
| Subject | Re: [PATCH v2] f2fs: avoid cpu lockup |
| Message-ID | <u3Gel-nJ-3@gated-at.bofh.it> |
| In reply to | #1687745 |
Before retrying to flush data or dentry pages, we need to release cpu in order
to prevent watchdog.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
Change log from v1:
- timeout more specifically
fs/f2fs/checkpoint.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 56bbf592e487..5b876f6d3f6b 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -879,6 +879,7 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
struct inode *inode;
struct f2fs_inode_info *fi;
bool is_dir = (type == DIR_INODE);
+ unsigned long ino = 0;
trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir,
get_pages(sbi, is_dir ?
@@ -901,8 +902,17 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
inode = igrab(&fi->vfs_inode);
spin_unlock(&sbi->inode_lock[type]);
if (inode) {
+ unsigned long cur_ino = inode->i_ino;
+
filemap_fdatawrite(inode->i_mapping);
iput(inode);
+ /* We need to give cpu to another writers. */
+ if (ino == cur_ino) {
+ congestion_wait(BLK_RW_ASYNC, HZ/50);
+ cond_resched();
+ } else {
+ ino = cur_ino;
+ }
} else {
/*
* We should submit bio, since it exists several
--
2.13.0.rc1.294.g07d810a77f-goog
[toc] | [prev] | [next] | [standalone]
| From | Chao Yu <chao@kernel.org> |
|---|---|
| Date | 2017-07-17 16:40 +0200 |
| Subject | Re: [f2fs-dev] [PATCH v2] f2fs: avoid cpu lockup |
| Message-ID | <u4flN-6ht-43@gated-at.bofh.it> |
| In reply to | #1688027 |
On 2017/7/16 9:04, Jaegeuk Kim wrote:
> Before retrying to flush data or dentry pages, we need to release cpu in order
> to prevent watchdog.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
> ---
> Change log from v1:
> - timeout more specifically
>
> fs/f2fs/checkpoint.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 56bbf592e487..5b876f6d3f6b 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -879,6 +879,7 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
> struct inode *inode;
> struct f2fs_inode_info *fi;
> bool is_dir = (type == DIR_INODE);
> + unsigned long ino = 0;
>
> trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir,
> get_pages(sbi, is_dir ?
> @@ -901,8 +902,17 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
> inode = igrab(&fi->vfs_inode);
> spin_unlock(&sbi->inode_lock[type]);
> if (inode) {
> + unsigned long cur_ino = inode->i_ino;
> +
> filemap_fdatawrite(inode->i_mapping);
> iput(inode);
> + /* We need to give cpu to another writers. */
> + if (ino == cur_ino) {
We failed to flush dirty pages of inode due to encountering -EAGAIN of writepage?
Thanks,
> + congestion_wait(BLK_RW_ASYNC, HZ/50);
> + cond_resched();
> + } else {
> + ino = cur_ino;
> + }
> } else {
> /*
> * We should submit bio, since it exists several
>
[toc] | [prev] | [next] | [standalone]
| From | Jaegeuk Kim <jaegeuk@kernel.org> |
|---|---|
| Date | 2017-07-18 00:40 +0200 |
| Subject | Re: [f2fs-dev] [PATCH v2] f2fs: avoid cpu lockup |
| Message-ID | <u4mQh-2yQ-13@gated-at.bofh.it> |
| In reply to | #1689122 |
On 07/17, Chao Yu wrote:
> On 2017/7/16 9:04, Jaegeuk Kim wrote:
> > Before retrying to flush data or dentry pages, we need to release cpu in order
> > to prevent watchdog.
> >
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>
> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>
> > ---
> > Change log from v1:
> > - timeout more specifically
> >
> > fs/f2fs/checkpoint.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> > index 56bbf592e487..5b876f6d3f6b 100644
> > --- a/fs/f2fs/checkpoint.c
> > +++ b/fs/f2fs/checkpoint.c
> > @@ -879,6 +879,7 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
> > struct inode *inode;
> > struct f2fs_inode_info *fi;
> > bool is_dir = (type == DIR_INODE);
> > + unsigned long ino = 0;
> >
> > trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir,
> > get_pages(sbi, is_dir ?
> > @@ -901,8 +902,17 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
> > inode = igrab(&fi->vfs_inode);
> > spin_unlock(&sbi->inode_lock[type]);
> > if (inode) {
> > + unsigned long cur_ino = inode->i_ino;
> > +
> > filemap_fdatawrite(inode->i_mapping);
> > iput(inode);
> > + /* We need to give cpu to another writers. */
> > + if (ino == cur_ino) {
>
> We failed to flush dirty pages of inode due to encountering -EAGAIN of writepage?
Actually, I found this from a bug case in experimental patches which just skips
it accidently. I think WB_SYNC_ALL doesn't return EAGAIN.
Thanks,
>
> Thanks,
>
> > + congestion_wait(BLK_RW_ASYNC, HZ/50);
> > + cond_resched();
> > + } else {
> > + ino = cur_ino;
> > + }
> > } else {
> > /*
> > * We should submit bio, since it exists several
> >
[toc] | [prev] | [next] | [standalone]
| From | Chao Yu <yuchao0@huawei.com> |
|---|---|
| Date | 2017-07-18 03:50 +0200 |
| Subject | Re: [f2fs-dev] [PATCH v2] f2fs: avoid cpu lockup |
| Message-ID | <u4pO9-4ov-1@gated-at.bofh.it> |
| In reply to | #1689543 |
On 2017/7/18 6:38, Jaegeuk Kim wrote:
> On 07/17, Chao Yu wrote:
>> On 2017/7/16 9:04, Jaegeuk Kim wrote:
>>> Before retrying to flush data or dentry pages, we need to release cpu in order
>>> to prevent watchdog.
>>>
>>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
>>
>> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>>
>>> ---
>>> Change log from v1:
>>> - timeout more specifically
>>>
>>> fs/f2fs/checkpoint.c | 10 ++++++++++
>>> 1 file changed, 10 insertions(+)
>>>
>>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
>>> index 56bbf592e487..5b876f6d3f6b 100644
>>> --- a/fs/f2fs/checkpoint.c
>>> +++ b/fs/f2fs/checkpoint.c
>>> @@ -879,6 +879,7 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
>>> struct inode *inode;
>>> struct f2fs_inode_info *fi;
>>> bool is_dir = (type == DIR_INODE);
>>> + unsigned long ino = 0;
>>>
>>> trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir,
>>> get_pages(sbi, is_dir ?
>>> @@ -901,8 +902,17 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
>>> inode = igrab(&fi->vfs_inode);
>>> spin_unlock(&sbi->inode_lock[type]);
>>> if (inode) {
>>> + unsigned long cur_ino = inode->i_ino;
>>> +
>>> filemap_fdatawrite(inode->i_mapping);
>>> iput(inode);
>>> + /* We need to give cpu to another writers. */
>>> + if (ino == cur_ino) {
>>
>> We failed to flush dirty pages of inode due to encountering -EAGAIN of writepage?
>
> Actually, I found this from a bug case in experimental patches which just skips
> it accidently. I think WB_SYNC_ALL doesn't return EAGAIN.
Alright, thanks for explanation. :)
Thanks,
>
> Thanks,
>
>>
>> Thanks,
>>
>>> + congestion_wait(BLK_RW_ASYNC, HZ/50);
>>> + cond_resched();
>>> + } else {
>>> + ino = cur_ino;
>>> + }
>>> } else {
>>> /*
>>> * We should submit bio, since it exists several
>>>
>
> .
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web