From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C55DC388F7 for ; Mon, 9 Nov 2020 14:20:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 060972076E for ; Mon, 9 Nov 2020 14:20:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="bO/oWgDY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731014AbgKIOU1 (ORCPT ); Mon, 9 Nov 2020 09:20:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729776AbgKIOU0 (ORCPT ); Mon, 9 Nov 2020 09:20:26 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A903C0613CF for ; Mon, 9 Nov 2020 06:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ifTPoe6YK4JOieCL61op/fn3W2iVxY1lQd2pBgg8rZo=; b=bO/oWgDYiBTIrBWklsM0YNltIH gWiIyxPpAoOnLa/2CJQN4lTdylN7CnRGSkYV5zdkXQ7FW2l03RggJuRg8AbiiGUn3GzBMcZGeODW0 zQ9z/ZY79kDiCp5u/fAgXIKUSU5jIr4MZIc22pDkno7xt+NwzDtmP5wjlZ3f56R8A/ECfYt4O3Puy THiAu9Z6RQbdToGuMbmuDJJvbaXZGqiyT+GIVfFOLjxQk8+VhHIzCyPyXZh7U8t4BCjQR8hGl+eQI wERjVBEFPzIdUO76juiILCTwvmSGoalz9IzKtiL/fIPaQpX5VvFdwbk6z0ngx5IHAedr5jM9aw32P 5O2+wBIg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kc81q-00041U-8l; Mon, 09 Nov 2020 14:20:18 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 773D4300455; Mon, 9 Nov 2020 15:20:16 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6AF4C2BDD057E; Mon, 9 Nov 2020 15:20:16 +0100 (CET) Date: Mon, 9 Nov 2020 15:20:16 +0100 From: Peter Zijlstra To: Trond Myklebust Cc: "neilb@suse.de" , "juri.lelli@redhat.com" , "mingo@redhat.com" , "jiangshanlai@gmail.com" , "tj@kernel.org" , "mhocko@suse.com" , "linux-kernel@vger.kernel.org" , "vincent.guittot@linaro.org" Subject: Re: [PATCH rfc] workqueue: honour cond_resched() more effectively. Message-ID: <20201109142016.GK2611@hirez.programming.kicks-ass.net> References: <87v9efp7cs.fsf@notabene.neil.brown.name> <20201109080038.GY2594@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 09, 2020 at 01:50:40PM +0000, Trond Myklebust wrote: > On Mon, 2020-11-09 at 09:00 +0100, Peter Zijlstra 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? Running short stuff, apparently. > 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'm not saying anything, but you're trying to wreck the scheduler because of a workqueue 'feature'. The 'new' workqueues limit concurrency by design, if you're then relying on concurrency for things, you're using it wrong. I really don't know what the right answer is here, but I thoroughly hate the one proposed.