Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3241694pxb; Mon, 9 Nov 2020 06:23:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5yvsAXlur+2Wx28Wv1OM44pomuupiZXMxi+WNh5N15fg2+ee9JY2jxa6RrgwI+n8cgvni X-Received: by 2002:a17:906:12cf:: with SMTP id l15mr16103361ejb.540.1604931804198; Mon, 09 Nov 2020 06:23:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604931804; cv=none; d=google.com; s=arc-20160816; b=AmSNYXvrg+7XaZUwCFG6J/0etm6yfb2D4x28HdFsF3GYDb9GcAazn/ik/9bwdN4BmL 5tL2bC4jmUbm+6Vfq8u1kl1vup+lCSrrXPC5KtXNS7rvIV9jgJW3dAQMYazWgpEDqAR1 2QdKRIe/HhKUi3zfXZ7R1xLH8LCv+5+nUC5zD8EjdMyuU6v23GWzKOBYr5JrzCFjiB/H zIrDk0qgl0KWNjM+eenRJq2dn2UWENfc3hYzXAYbnLan5yQ18fMyHfpiELkzWssytEaD Mhp1t3G7kjNPm21fuThYTEsQHVpAHSNYajJLY6SH7S3CxA3FilknPcJXuA0cFUcbkTtg GCZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ifTPoe6YK4JOieCL61op/fn3W2iVxY1lQd2pBgg8rZo=; b=FfztZzJ2SlkYvnaas5paRSYSS6OVSZ7DmRtqIR0/DiYOAgBZhg5JFlj2TFdvLl9vKC JgcnlBHK8RRvZq9GPr+RZyfUacNauVIgeDCqoJYCm8124zXUpyFHKzvRTKTy0ooZ+nTC Fu6K15KNBCk5EAd4o6azAN6DjYb8MJfura2ie/ax9NmaHeYEopwB2Qb3npJ3xQRbg3C0 V+A9XXU9yeFodhT2Dpd4ZejuIJHFLTAmygaUyFTekxoRteGzvOB0VPuIqYTHtOB8S4De mzC71dv8Av+43MWLp+Lv2oSgjoOIvoRzFxH4PzcLojPKQ5mJPlZ39Wi52g5BHdca27wo qllg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b="bO/oWgDY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si9268706edr.134.2020.11.09.06.23.00; Mon, 09 Nov 2020 06:23:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b="bO/oWgDY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730951AbgKIOU1 (ORCPT + 99 others); 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.