linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [Bug 220321] New: F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn
@ 2025-07-07  7:28 bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-07 11:51 ` [f2fs-dev] [Bug 220321] " bugzilla-daemon--- via Linux-f2fs-devel
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bugzilla-daemon--- via Linux-f2fs-devel @ 2025-07-07  7:28 UTC (permalink / raw)
  To: linux-f2fs-devel

https://bugzilla.kernel.org/show_bug.cgi?id=220321

            Bug ID: 220321
           Summary: F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is
                    flushing !WQ_MEM_RECLAIM
                    events_unbound:quota_release_workfn
           Product: File System
           Version: 2.5
          Hardware: ARM
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: f2fs
          Assignee: filesystem_f2fs@kernel-bugs.kernel.org
          Reporter: hy50.seo@samsung.com
        Regression: No

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/fs/f2fs/super.c?h=v6.12.36

The panic_on_warn occurred using UFS device test app with high probability.

Occurs when putting the 'quota_release_work' into the workqueue.
The 'quota_release_work' uses 'system_unbound_wq', but WQ_MEM_RECLAIM flag is
not used when creating.

Therefore, before adding the 'quota_release_work' to the work queue, check the
previously operated work queue, which seems to have been created using the
WQ_MEM_RECLAIM flag.
Previouse work queue is 'writeback:wb_workfn'.
So occurred below the problem.

When using a work queue, it seems like you should use a work queue with
'WQ_MEM_RECLAIM' instead of system_unbound_wq.


[6:  kworker/u40:2: 7357] ------------[ cut here ]------------
[6:  kworker/u40:2: 7357] workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is
flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn
[6:  kworker/u40:2: 7357] WARNING: CPU: 6 PID: 7357 at kernel/workqueue.c:3721
check_flush_dependency+0x160/0x16c

[6:  kworker/u40:2: 7357] Workqueue: writeback wb_workfn (flush-8:0)
[6:  kworker/u40:2: 7357] pstate: 634020c5 (nZCv daIF +PAN -UAO +TCO +DIT -SSBS
BTYPE=--)
[6:  kworker/u40:2: 7357] pc : check_flush_dependency+0x160/0x16c
[6:  kworker/u40:2: 7357] lr : check_flush_dependency+0x160/0x16c
[6:  kworker/u40:2: 7357] sp : ffffffc0aa746b40
[6:  kworker/u40:2: 7357] x29: ffffffc0aa746b40 x28: 18ffff882b081000 x27:
0000000000000000
[6:  kworker/u40:2: 7357] x26: caffff88280841a0 x25: 3bffff8801860900 x24:
0000000000000000
[6:  kworker/u40:2: 7357] x23: b7ffff880185a000 x22: 84ffff8805128400 x21:
ffffffd01051b04c
[6:  kworker/u40:2: 7357] x20: 83ffff8064571840 x19: beffff8800033400 x18:
ffffffd012b19dc0
[6:  kworker/u40:2: 7357] x17: 454d5f5157212067 x16: 6e696873756c6620 x15:
51572120676e6968
[6:  kworker/u40:2: 7357] x14: 73756c6620736920 x13: 65725f61746f7571 x12:
3a646e756f626e75
[6:  kworker/u40:2: 7357] x11: 000000000000009c x10: ffffffc0aa746ad0 x9 :
9511e74e66c49200
[6:  kworker/u40:2: 7357] x8 : 9511e74e66c49200 x7 : ffffffffffffffff x6 :
ffffffd0117ee30c
[6:  kworker/u40:2: 7357] x5 : 0000000000000000 x4 : 0000000000000001 x3 :
0000000000000000
[6:  kworker/u40:2: 7357] x2 : 0000000000000002 x1 : 00000000000000ff x0 :
ffffffbc0aa746ab
[6:  kworker/u40:2: 7357] Call trace:
[6:  kworker/u40:2: 7357]  check_flush_dependency+0x160/0x16c
[6:  kworker/u40:2: 7357]  __flush_work+0x168/0x738
[6:  kworker/u40:2: 7357]  flush_delayed_work+0x58/0x70
[6:  kworker/u40:2: 7357]  dquot_writeback_dquots+0x90/0x4bc
[6:  kworker/u40:2: 7357]  f2fs_do_quota_sync+0x120/0x284
[6:  kworker/u40:2: 7357]  f2fs_write_checkpoint+0x58c/0xe18
[6:  kworker/u40:2: 7357]  f2fs_gc+0x3e8/0xd78
[6:  kworker/u40:2: 7357]  f2fs_balance_fs+0x204/0x284
[6:  kworker/u40:2: 7357]  f2fs_write_single_data_page+0x700/0xaf0
[6:  kworker/u40:2: 7357]  f2fs_write_data_pages+0xe94/0x15bc
[6:  kworker/u40:2: 7357]  do_writepages+0x170/0x3f8
[6:  kworker/u40:2: 7357]  __writeback_single_inode+0xa0/0x8c4
[6:  kworker/u40:2: 7357]  writeback_sb_inodes+0x2ac/0x708
[6:  kworker/u40:2: 7357]  __writeback_inodes_wb+0xc0/0x118
[6:  kworker/u40:2: 7357]  wb_writeback+0x1f4/0x664
[6:  kworker/u40:2: 7357]  wb_workfn+0x62c/0x900
[6:  kworker/u40:2: 7357]  process_one_work+0x3f8/0x968
[6:  kworker/u40:2: 7357]  worker_thread+0x610/0x794
[6:  kworker/u40:2: 7357]  kthread+0x1c4/0x1e4
[6:  kworker/u40:2: 7357]  ret_from_fork+0x10/0x20
[6:  kworker/u40:2: 7357] Kernel panic - not syncing: kernel: panic_on_warn set
...

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [f2fs-dev] [Bug 220321] F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn
  2025-07-07  7:28 [f2fs-dev] [Bug 220321] New: F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn bugzilla-daemon--- via Linux-f2fs-devel
@ 2025-07-07 11:51 ` bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-08  2:15 ` bugzilla-daemon--- via Linux-f2fs-devel
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon--- via Linux-f2fs-devel @ 2025-07-07 11:51 UTC (permalink / raw)
  To: linux-f2fs-devel

https://bugzilla.kernel.org/show_bug.cgi?id=220321

Chao Yu (chao@kernel.org) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chao@kernel.org

--- Comment #1 from Chao Yu (chao@kernel.org) ---
IIUC, do you mean it needs to create wb_workfn workqueue w/ WQ_MEM_RECLAIM?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [f2fs-dev] [Bug 220321] F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn
  2025-07-07  7:28 [f2fs-dev] [Bug 220321] New: F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-07 11:51 ` [f2fs-dev] [Bug 220321] " bugzilla-daemon--- via Linux-f2fs-devel
@ 2025-07-08  2:15 ` bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-18  7:22 ` bugzilla-daemon--- via Linux-f2fs-devel
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon--- via Linux-f2fs-devel @ 2025-07-08  2:15 UTC (permalink / raw)
  To: linux-f2fs-devel

https://bugzilla.kernel.org/show_bug.cgi?id=220321

--- Comment #2 from SEO HOYOUNG (hy50.seo@samsung.com) ---
Yes.
A problem occurred when quota_release_work used a workqueue without
WQ_MEM_RECLAIM flag.
So I think we should use workqueue with WQ_MEM_RECLAIM flag.
The WQ_MEM_RECLAIM flag cannot be added to system_unbound_wq, so how about you
to create a new workqueue for dquot?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [f2fs-dev] [Bug 220321] F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn
  2025-07-07  7:28 [f2fs-dev] [Bug 220321] New: F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-07 11:51 ` [f2fs-dev] [Bug 220321] " bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-08  2:15 ` bugzilla-daemon--- via Linux-f2fs-devel
@ 2025-07-18  7:22 ` bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-18  9:12 ` bugzilla-daemon--- via Linux-f2fs-devel
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon--- via Linux-f2fs-devel @ 2025-07-18  7:22 UTC (permalink / raw)
  To: linux-f2fs-devel

https://bugzilla.kernel.org/show_bug.cgi?id=220321

--- Comment #3 from SEO HOYOUNG (hy50.seo@samsung.com) ---
Our development system occurred this problem again.
It seems that write data to f2fs using write back option.

The wb_wrokfn function use writeback workqueue.
And the writeback workqueue created using WQ_MEM_RECLAIM option.

 static int __init default_bdi_init(void)
 {
         bdi_wq = alloc_workqueue("writeback", WQ_MEM_RECLAIM | WQ_UNBOUND |
                                  WQ_SYSFS, 0);
         if (!bdi_wq)
                 return -ENOMEM;
         return 0;
 }

So it occurred kernel panic when insert quota_release_work to system_unbound_wq
during wb_workfn working.
But it seems that could not add WQ_MEM_RECLAIM to system_unbound_wq.
Therefore, it would be better to remove the WQ_MEM_RECLAIM flag from the bdi_wq
workcue.
Is it possible?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [f2fs-dev] [Bug 220321] F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn
  2025-07-07  7:28 [f2fs-dev] [Bug 220321] New: F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn bugzilla-daemon--- via Linux-f2fs-devel
                   ` (2 preceding siblings ...)
  2025-07-18  7:22 ` bugzilla-daemon--- via Linux-f2fs-devel
@ 2025-07-18  9:12 ` bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-21  6:50 ` bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-29  1:57 ` bugzilla-daemon--- via Linux-f2fs-devel
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon--- via Linux-f2fs-devel @ 2025-07-18  9:12 UTC (permalink / raw)
  To: linux-f2fs-devel

https://bugzilla.kernel.org/show_bug.cgi?id=220321

--- Comment #4 from Chao Yu (chao@kernel.org) ---
Sorry for the delay.

The workqueue is not allocated by f2fs, not sure this is a f2fs bug...

Can you please report this issue to fsdevel mailing list:
linux-fsdevel@vger.kernel.org?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [f2fs-dev] [Bug 220321] F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn
  2025-07-07  7:28 [f2fs-dev] [Bug 220321] New: F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn bugzilla-daemon--- via Linux-f2fs-devel
                   ` (3 preceding siblings ...)
  2025-07-18  9:12 ` bugzilla-daemon--- via Linux-f2fs-devel
@ 2025-07-21  6:50 ` bugzilla-daemon--- via Linux-f2fs-devel
  2025-07-29  1:57 ` bugzilla-daemon--- via Linux-f2fs-devel
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon--- via Linux-f2fs-devel @ 2025-07-21  6:50 UTC (permalink / raw)
  To: linux-f2fs-devel

https://bugzilla.kernel.org/show_bug.cgi?id=220321

--- Comment #5 from SEO HOYOUNG (hy50.seo@samsung.com) ---
Hi, I uploaded to mainline fix patch.
But I do not know it is right.
https://lore.kernel.org/linux-scsi/20250721064024.113841-1-hy50.seo@samsung.com/T/#u


I thought of another way, how about below it?

How about it to change "flush_delayed_work" to "cancel_work_sync" or
"cancel_delayed_work_sync".
Then it will be wait until writeback workqueue done.
And "quota_release_work" function will queueing to events_unbound.
Because if "cancel_work_sync" is called, the second argument of "__flsuh work"
is called as true, and "check_flush_dependency" will be return normally, so it
is unlikely that there will be a problem.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [f2fs-dev] [Bug 220321] F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn
  2025-07-07  7:28 [f2fs-dev] [Bug 220321] New: F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn bugzilla-daemon--- via Linux-f2fs-devel
                   ` (4 preceding siblings ...)
  2025-07-21  6:50 ` bugzilla-daemon--- via Linux-f2fs-devel
@ 2025-07-29  1:57 ` bugzilla-daemon--- via Linux-f2fs-devel
  5 siblings, 0 replies; 7+ messages in thread
From: bugzilla-daemon--- via Linux-f2fs-devel @ 2025-07-29  1:57 UTC (permalink / raw)
  To: linux-f2fs-devel

https://bugzilla.kernel.org/show_bug.cgi?id=220321

SEO HOYOUNG (hy50.seo@samsung.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|f2fs                        |devfs

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-29  1:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07  7:28 [f2fs-dev] [Bug 220321] New: F2FS: workqueue: WQ_MEM_RECLAIM writeback:wb_workfn is flushing !WQ_MEM_RECLAIM events_unbound:quota_release_workfn bugzilla-daemon--- via Linux-f2fs-devel
2025-07-07 11:51 ` [f2fs-dev] [Bug 220321] " bugzilla-daemon--- via Linux-f2fs-devel
2025-07-08  2:15 ` bugzilla-daemon--- via Linux-f2fs-devel
2025-07-18  7:22 ` bugzilla-daemon--- via Linux-f2fs-devel
2025-07-18  9:12 ` bugzilla-daemon--- via Linux-f2fs-devel
2025-07-21  6:50 ` bugzilla-daemon--- via Linux-f2fs-devel
2025-07-29  1:57 ` bugzilla-daemon--- via Linux-f2fs-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).