On Fri, Jun 04, 2021 at 11:53:02AM -0400, Tejun Heo wrote: > On Thu, Jun 03, 2021 at 06:31:53PM -0700, Roman Gushchin wrote: > > To solve the problem inodes should be eventually detached from the > > corresponding writeback structure. It's inefficient to do it after > > every writeback completion. Instead it can be done whenever the > > original memory cgroup is offlined and writeback structure is getting > > killed. Scanning over a (potentially long) list of inodes and detach > > them from the writeback structure can take quite some time. To avoid > > scanning all inodes, attached inodes are kept on a new list (b_attached). > > To make it less noticeable to a user, the scanning and switching is performed > > from a work context. > > Sorry for chiming in late but the series looks great to me and the only > comment I have is the migration target on the last patch, which isn't a > critical issue. Please feel free to add > > Acked-by: Tejun Heo <tj@xxxxxxxxxx> Thank you for taking a look and for acking the series! I agree that switching to the nearest ancestor makes sense. If I remember correctly, I was doing this in v1 (or at least planned to do), but then switched to zeroing the pointer and then to bdi's wb. I fixed it in v8 and pushed it here: https://github.com/rgushchin/linux/tree/cgwb.8 . I'll wait a bit for Jan's and others feedback and will post v8 on Monday. Hopefully, it will be the final version. Btw, how are such patches usually routed? Through Jens's tree? Thanks!