Received: by 10.223.176.5 with SMTP id f5csp2506303wra; Sun, 28 Jan 2018 22:34:23 -0800 (PST) X-Google-Smtp-Source: AH8x22488m1DBqWtupPU0UEBOa47x34FTS94EUwcE0+oX3sCll4ZPADUg4ZTezNFxHLdEEyu1Z00 X-Received: by 10.99.97.208 with SMTP id v199mr20119884pgb.387.1517207663053; Sun, 28 Jan 2018 22:34:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517207663; cv=none; d=google.com; s=arc-20160816; b=VfjmOFcBjng7MDBpsiAxczAE6LvDDosNatSEP5DTOjxpLwyeHNGgQkf+VL38QXoktb KJTxxPE/XN/DoPaAmxJhVgtnuaFMm42VY0TfOKPMlBUs/2qMruWuzMiVARGYVO34SCQM kVasJkCGzelqP3wGOcvyuig69AOvGG2fyDSixLLLyya61buKUVh8w0tXVOag9sjVhp89 k1BOQhxJ/TRvwSf2K/XL917DKEp8AfzuWQ6478GHgpr9IckbdpmfEFdY7Cm+0XzBwfMe NOmJ2u4nQBTFkQ8No/AE6TG7F6LDHV0F/bh2SmzvNUaPfL1YHu8oeF6ph5CodboNZVgo tsmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=8KonF1qbqbiJwpIyK5SXZCp7K0VCq+1G7HKh4As1Ihg=; b=Vs9McFvOQhzgsvjHmNqf4aQcnHMGymBGIvxl4TDmDhmBkmy6NiFoJ3nD2fmoe3hJcA 9j2pue4nqkEqDzfpyyLpTwXw1QujW+9pz24Kf0v050+hMMuLbIZc1/jqGyw21nq3OOat i5fAakLao/E9d+ihdHNsVCyqzZiMD4KYv2Rk673bdFW3W2c11nYt0d/kN8yyOnkT3pbN LxknOZj7BK+w2TBq391YoLyvGZJKQA+IhoHrGHgLbnLrT1Q0UiFnPt0E2kKhIsL1ANOs xJITGunK8tWCz51Reph5fLkrgm4+yNZXjm3WGeb21kYHoQnsghi+BaiC0F1rxm6aSUrH wCVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nz35Gain; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si6913859pgn.439.2018.01.28.22.34.08; Sun, 28 Jan 2018 22:34:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nz35Gain; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751349AbeA2Gdp (ORCPT + 99 others); Mon, 29 Jan 2018 01:33:45 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:36872 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032AbeA2Gdo (ORCPT ); Mon, 29 Jan 2018 01:33:44 -0500 Received: by mail-it0-f65.google.com with SMTP id h129so1778972ita.2 for ; Sun, 28 Jan 2018 22:33:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8KonF1qbqbiJwpIyK5SXZCp7K0VCq+1G7HKh4As1Ihg=; b=nz35Gain5ziBPCHehntIDAySMSH+1gTojiLuDlk8YbBhXVZ/Ck/aScpZSuZT0OWjiy pAnC1lNT8avgmNMYBoKI31Va3+Tnn5TV0lR8TOsibqzPeN/jHDN2gRmR6KSnYhjiUpJG q+cKgJu2y1fvJCu1gBobrnr1FUby0zRr/HdlEaEgNwjjGfINhMfAx+55toM9PCSEa4xL 7C4ayzqTpIrfcoyA7wARHwnCBhGOByR5GLNqFKhjZsb49t0urnxAYhJEYkKox4TZPgSU 6I7yeqJdgCQCrdvd4A9AnbWSdWa02G+styrYzZgmwzxw114B1GeX72u2lzr4mCBHFhCu 5A6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8KonF1qbqbiJwpIyK5SXZCp7K0VCq+1G7HKh4As1Ihg=; b=B9jgOhuR35VHDwyf98dgLdVVpfVWVFO8C0aYftpN9v3C4uWjqvBNVqUwzO30yNXjdm 91gj0ZelIafd8WieeCKWvE7c1FlyTTbMvdyKLMrV0V14km+aCRZ1926S6+RxQfXBPggV M4Os/dttnajWKfXFGIBxSgra/oElfxzk24QGtS6KzbH23iiDXATX7cgN0zVAmtIXfPth dibyrud4hQ0NeFSL2TmUswKhGPY0ecDbNqsHni9RLD19hgb1YttS+xTP7jea9ZQyvgad ZHR9G/L9JAgESbbtyX3bVoaLpZ54Kwjm9JMGOzUm46VnrgtLTax/7rYgieOvojH2KAU9 vqSA== X-Gm-Message-State: AKwxytf6WPRKlXVjCyQE0KBUohT/WXJE+I9AyNzP5W0t15qPhHIzd0TD 6ZJyHkZuGBLjb5cOMVBjEPOmaXoY2FNiAS88g+Qh5lra X-Received: by 10.36.125.205 with SMTP id b196mr26080358itc.128.1517207624093; Sun, 28 Jan 2018 22:33:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.214.23 with HTTP; Sun, 28 Jan 2018 22:33:43 -0800 (PST) In-Reply-To: <1517200880.10151.15.camel@gmx.de> References: <1517030127-21391-1-git-send-email-wen.yang99@zte.com.cn> <1517030127-21391-5-git-send-email-wen.yang99@zte.com.cn> <1517200880.10151.15.camel@gmx.de> From: Lai Jiangshan Date: Mon, 29 Jan 2018 14:33:43 +0800 Message-ID: Subject: Re: [RFC PATCH V5 5/5] workqueue: introduce a way to set workqueue's scheduler To: Mike Galbraith Cc: Wen Yang , Tejun Heo , zhong.weidong@zte.com.cn, Jiang Biao , Tan Hu , kernel test robot , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 29, 2018 at 12:41 PM, Mike Galbraith wrote: > On Mon, 2018-01-29 at 12:15 +0800, Lai Jiangshan wrote: >> I think adding priority boost to workqueue(flush_work()) is the best >> way to fix the problem. > > I disagree, priority boosting is needlessly invasive, takes control out > of user hands. The kernel wanting to run a workqueue does not justify > perturbing the user's critical task. The kworkers doesn't belong to any user, it is really needlessly invasive if we give the ability to any user to control the priority of the kworkers. If the user's critical task calls flush_work(). the critical task should boost one responsible kworker. (the kwoker scheduled for the work item, or the first idle kworker or the manager kworker, the kwoker for the later two cases is changing, need to migrate the boosting to a new kworker when needed) The boosted work items need to be moved to a prio list in the pool too for the boosted kworker to pick it up. > > I think "give userspace rope" is always the best option, how rope is > used is none of our business. Giving the user a means to draw a simple > line in the sand, above which they run only critical stuff, below > which, they can do whatever they want, sane in our opinions or not, > lets users do whatever craziness they want/need to do, and puts the > responsibility for consequences squarely on the right set of shoulders. > > -Mike