Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1153349pxu; Wed, 2 Dec 2020 12:25:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLwISRsCRu4IqLK+VjUnMwQHWJIm3RBY31+IufyxPK38wwJcAcbjCdSIVGhu0b6OSTB7r8 X-Received: by 2002:a17:906:b003:: with SMTP id v3mr1487384ejy.290.1606940724960; Wed, 02 Dec 2020 12:25:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606940724; cv=none; d=google.com; s=arc-20160816; b=bK6z8SOF7hn4VPeQxfVmTwtqTbFSddfSbVN07JWSsTIwMbW6LeEOMtdVm1TkTM1Sfc Q2MunLSyLvxK+DGtxo8nRtiSvgWIFGqeX+o8GwTK43LOa+ymtrVKGwDTqK2PZMCxw2zY O570NMdd40JkXgrt8hfu+UrZznRbrR3/g6TcIoJwJ0ZpTrc9ZWhIT44cZFuHM6DjUkq6 Mq93pliazUb2s/AEEVhNhALKPfnzl8oy12R4IpHYBBXIyLxOO6XNHeMda0MFOMYUQXlo LD/SbtC/xyKZ6icUyeN+hvG7r7FIaPj1VnFEblLQraAUl/njwi3ezkT9yQiaa58H+CO9 rZxw== 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 :message-id:subject:cc:to:from:date:sender:dkim-signature; bh=aj7zikfociwcKr6VGphiYIZ8rc665LBf4u7f617m8kE=; b=FlDMMN9+ZTbvjKvLEnuoTPRTSUulvWOZdznUPT/+x2yF0t3+kb0TCL96hXkYCfP0Ky tWm1ejDCQXCghaveTlEPC/atemSk5QIe3qfaQ/UTyy1B/jKSevKfeY5cNRaQGMC3MF9N jsvk8F60fmD07U4Fh5cvml9Do4cnBnEBfQgNqBDoipbUUMUiXz3sRmtlhbovhhvQi/wC 3iyw2JaesrcAGqauqGvxbR25c67OjxwwQc0yTnx6SDHR/awxG8jZQmkfBZDXSEJ9Et3K w+MHHNFxrnGqZ3J+7krf0Z39iwME+7+i9ccSZH/YU15zhouuLdwVHFI1hpDtTgNtQNs4 B6ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="n/zZJtm7"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si607993ejf.192.2020.12.02.12.25.00; Wed, 02 Dec 2020 12:25: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=@gmail.com header.s=20161025 header.b="n/zZJtm7"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728263AbgLBUVe (ORCPT + 99 others); Wed, 2 Dec 2020 15:21:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727003AbgLBUVe (ORCPT ); Wed, 2 Dec 2020 15:21:34 -0500 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C62F1C0613D6 for ; Wed, 2 Dec 2020 12:20:53 -0800 (PST) Received: by mail-qv1-xf34.google.com with SMTP id g19so1365295qvy.2 for ; Wed, 02 Dec 2020 12:20:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mime-version :content-disposition:in-reply-to; bh=aj7zikfociwcKr6VGphiYIZ8rc665LBf4u7f617m8kE=; b=n/zZJtm7n5sa6dwUDkqyAEHqr/PViZlkWneUEVRRE9J7qlT6SEGJmJvmqUdDW+JR+T s+cD1eXzNCyKAoElzdabttMfDbV7qG8GcwMTm12kwHRGuTHsWtZ+mia3KD1Tg534QKyT OopetEiPDs0dU8/pSCwxnWUxa5s3RmsH6gP97z/3GeGmfwq0RM8i7l4NuzKcVVNuRxMM +z3ovi+Ukh56I3ih9IYGzuMW6byxrQbgKjfjg1GfPeAG/xmpWIPQzuZldmWuCqOjXrZ9 /fxLSzgdoIgG1XKR9V6TpIocayT5u6dLnhhixywPtHfOLAzOQqxKrEURZQ6/zQqHN5eB Ezrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mime-version:content-disposition:in-reply-to; bh=aj7zikfociwcKr6VGphiYIZ8rc665LBf4u7f617m8kE=; b=WWJWPbb75JqZJsBpEcDBQeULoOsFa3awCDju7bt2IL6hz4ywQvEruJ71Cgqn3CeOaW 5Cprrj+8Rap+PSx5tVHA/R/WA3r+E9qx8Z+ez4VynBc/j90AhvKKuvmvVnksSVmXysKK gZ3lB9Eozbv7K02OqTqVAKooWPsjnlG2Q5Iac+EmcqHr6CdrFtCSQIs8xRqBu6tJlyUW UEtj7+7AUTcvfvR5NT2GVK5kspGFxuXVZMTTQeqdeND1Vw8tdpZy+flk6EKv5PqLSRvA RABK6E+UdlxIBgji/I9vuUSfMdl6Ui0/oXAdJ7PPxiJwQuCjshnNNmvyBCtr2dS0iPlH J50w== X-Gm-Message-State: AOAM531TVkzeV2r3d9nqeVbVTPKa0rjrWEgqyC0Gy8Smd8nDKTWR0gfa CqcmPQAnRFGJvPXKgQnXQVA= X-Received: by 2002:a0c:a992:: with SMTP id a18mr4320506qvb.21.1606940452966; Wed, 02 Dec 2020 12:20:52 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:8dbd]) by smtp.gmail.com with ESMTPSA id v15sm2739138qti.92.2020.12.02.12.20.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 12:20:52 -0800 (PST) Sender: Tejun Heo Date: Wed, 2 Dec 2020 15:20:24 -0500 From: "tj@kernel.org" To: NeilBrown Cc: Hillf Danton , Trond Myklebust , "peterz@infradead.org" , "linux-kernel@vger.kernel.org" , Lai Jiangshan Subject: Re: [PATCH rfc] workqueue: honour cond_resched() more effectively. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ima1ndwz.fsf@notabene.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Neil. (cc'ing Lai) On Fri, Nov 20, 2020 at 10:07:56AM +1100, NeilBrown wrote: > If the workqueue maintainers are unmovable in the position that a > CM-workitem must not use excessive CPU ever, and so must not call > cond_resched(), then I can take that back to the NFS maintainers and Oh, that's not my position at all. I'm completely movable and am pretty sure Lai would be too. > negotiate different workqueue settings. But as I've said, I think this > is requiring the decision to be made in a place that is not well > positioned to make it. Very true. A lot of the current workqueue code is a result of gradual evolution and has a lot of historical cruft. Things like CPU_INTENSIVE or long_wq were introduced partly to facilitate existing users to CM workqueue and definitely are silly interfaces as you mentioned in another reply. I can see two directions: 1. Keeping things mostly as-is - leave the selection of the specific workqueue type to users. We can improve things by adding debug / sanity checks to surfaces issues more proactively, adding more documentation and cleaning up old cruft. 2. Make things properly dynamic. By default, let workqueue core decide what type of execution constraints are gonna be applied and dynamically adjust according to the behavior of specific workqueues or work items. e.g. it can start most work items CM per-cpu by default and then release them as unbound when its cpu consumption exceeds certain threshold. #1 is easier. #2 is definitely more attractive long term but would need a lot of careful work. I was suggesting towards #1 mostly because it's a safer / easier direction but if you wanna explore #2, please be my guest. Thank you. -- tejun