lkml.org 
[lkml]   [2020]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH rfc] workqueue: honour cond_resched() more effectively.
    Hello,

    On Mon, Nov 09, 2020 at 01:50:40PM +0000, Trond Myklebust wrote:
    > > I'm thinking the real problem is that you're abusing workqueues. Just
    > > don't stuff so much work into it that this becomes a problem. Or
    > > rather,
    > > if you do, don't lie to it about it.
    >
    > If we can't use workqueues to call iput_final() on an inode, then what
    > is the point of having them at all?
    >
    > Neil's use case is simply a file that has managed to accumulate a
    > seriously large page cache, and is therefore taking a long time to
    > complete the call to truncate_inode_pages_final(). Are you saying we
    > have to allocate a dedicated thread for every case where this happens?

    I think the right thing to do here is setting CPU_INTENSIVE or using an
    unbound workqueue. Concurrency controlled per-cpu workqueue is unlikely to
    be a good fit if the work can run long enough to need cond_resched(). Better
    to let the scheduler handle it. Making workqueue warn against long-running
    concurrency managed per-cpu work items would be great. I'll put that on my
    todo list but if anyone is interested please be my guest.

    Thanks.

    --
    tejun

    \
     
     \ /
      Last update: 2020-11-09 15:02    [W:2.663 / U:0.760 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site