Received: by 10.223.176.5 with SMTP id f5csp517209wra; Sat, 27 Jan 2018 04:38:33 -0800 (PST) X-Google-Smtp-Source: AH8x226DfCT3G4DUp1yVWYW2/NKZtufqaIaDrrSJm51CFZkQzzCIM1+W56x2ejYc96cc207hUufa X-Received: by 2002:a17:902:8497:: with SMTP id c23-v6mr7041978plo.357.1517056713326; Sat, 27 Jan 2018 04:38:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517056713; cv=none; d=google.com; s=arc-20160816; b=ICHU/M/crOQqGosEKspwH34qY5jC+2cn5kzKr+IF/AWIUBB1Uxc7+zDsugxtu4z/Ol SwH72o2P0kjUDsjUx4V1YNH/znK+ipfhZ7y7iuz9UZxYoWobqBetsIOiZjhD1bT7Jj6o QbAEyQy1PtyDpzi9rr0xJdiMG/F8cnJbsOwYwD3INJ+7LN5iTg3Ap8f0lVqMrrr+4Tu4 HMTGP3+CHCXjsaYszIWCHdjsSVLA+nuySrzLYtegzefQjpFdsOWAX6DGRlErno4kT5yj Oygv7nxYn9taMAtrfhFGGDwqCgFMVde/+kjOyjRBWIKT4FsUkUnK7/KO6qgnx7NiPmQ0 pa+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=U3MwrtlFQlTqcGNzvsMupdJt/jdA+VaTzEKjMQk88Io=; b=vbwhZQAQNdLdvS/ifOr5RiOAP3Fjb4+jTpgxU8Lvaft44DsNl5JG4ncwmf9+bRziwN LdLMCME1hoG8M1w3Xf8TWtkyOTwMQX2jTKG6UKZA4Wyrv0LItHtkBtCHp4s94jQZq2+Z G0HsvyGL++KtvHftMerl38ZTW4lJPZ7cg0mNd/7enVY7eHuUg/KU0utcvnLjiPFURh+q ZGi92peQZchVGNCK/eqgmEeMAKOXsLt5xYmdofj8qWEBg/R3rY75ICfCqN6tBRtsDfws AKhebvOlQ17mzf57Ty8ZBufwHiIE4Tlg+OA8CisQqF6fa2PZdeIBo/A+Vyuc/w77m/2G Gh/Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1-v6si5340280plo.170.2018.01.27.04.38.19; Sat, 27 Jan 2018 04:38:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752707AbeA0Mhy convert rfc822-to-8bit (ORCPT + 99 others); Sat, 27 Jan 2018 07:37:54 -0500 Received: from mout.gmx.net ([212.227.15.19]:60235 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751641AbeA0Mhw (ORCPT ); Sat, 27 Jan 2018 07:37:52 -0500 Received: from homer.simpson.net ([185.191.217.115]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LnxxQ-1fGwLn3KYa-00g1DP; Sat, 27 Jan 2018 13:37:27 +0100 Message-ID: <1517056644.6501.27.camel@gmx.de> Subject: Re: [RFC PATCH V5 5/5] workqueue: introduce a way to set workqueue's scheduler From: Mike Galbraith To: Wen Yang , tj@kernel.org Cc: zhong.weidong@zte.com.cn, Jiang Biao , Tan Hu , Lai Jiangshan , kernel test robot , linux-kernel@vger.kernel.org Date: Sat, 27 Jan 2018 13:37:24 +0100 In-Reply-To: <1517045504.15811.18.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> <1517045504.15811.18.camel@gmx.de> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K0:HwO83cbJg6TJRsr7Yl9+rt3OX87wdwwgQppZESdptYcXYjBZpdt lROFYQ89XBwIFiyhQ/g0fH1bhvxqTPO/ckSJgeDcH759d0XmSyAxUFmxpiev7pQSqn1oSwe J4jjzSMv28cNPeFP09g5tWzM8e8OdkqJJSb77Adeqd+g4NzhQwP569wyJS+Y68t5WH0bYoK r8wyc3WD0mYkmDNB/nqDg== X-UI-Out-Filterresults: notjunk:1;V01:K0:OiDyO0yxuzw=:hQmoab/c0N7IsRaphW1exp CIjzaCxtL3FuULpBEVFy88YP25QPFGLKD17kEmdxPiKTFUJ3d1Y3PdtVnoozcu99Ws9LC/fxS nv6cGItnGqCp7WPK0QVRXDWNNJOM9du63sAUVnPqRyDA5AyYiXXtZMo4qxkpyn9wzvblQO4Dv gpUl/FSrLiWZPmNR8Sxk2xzejml6ZYaB0urZsp4jGKPRCaz9c7FY82iOqdevWFBJgPCGcBdtw O63OW+sXgVa0k6kUTF0CPXsMHXcaPWTtciJ1brsTqQr79F54EOaXBaAjk1IdFST4bOoMW+yio 7soA3MojLIgazi7RAA6EwIIPXXFWV/vdqstjPhSVCCZPtDFZ1ewSREAOIQXHsgGJZROyUdWSd fbPT22QzS1jz+yid2d8c20mYwFAWTVH0Wlr7rrfYM9VcYcm0sOiemIQZPxxJY5TrMd76nFP/x VHaPPkU1vjfT3RGtjn2/nkF3bYqvO81Jsqlh5vHT9xPm5IV1P5a+c4d3X9ujjcyndmzY+M2kJ xrcWKXL7tnPaTy1NNw4iC0gv3dp071cQslepEbZTRUQ1zq8I8TgD4gKNzXp+xBrBqdEgbyrX2 7Y4LORquxEJLqaCd2teaR4y39qNLZalRxhEvJnM1PrNy5vvEdyoll5QWOVnrEi2K8XogJ9krz XyNMv5W3MY/UOT5T2RkZFGej5nmxwZL3MnHfxbXy6eDOiLqIl3IIZTNdxRW+B8ktbWWKKyceI +RXbEGhb4YeN8rDLO3y+TSMz8sgsi2xU6ip70Smi7jRgBGxaJ+nRMAEzbF3FiqueSoloDuLzU LGkNDNln4I7Z0cWrNFnLLGzcMxny5QzbAHCT2molnRcJtkvBGwUsApB7JyOaOJl5cxNMyZhlI tlXxQEEnK+gaL+wxqr33p0n1ZRWZHG4/T8mLHTrgEbR3Z/aMcd3xdnvdi6n9GldinzY0zqqIn 2yEw0sbp8XA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2018-01-27 at 10:31 +0100, Mike Galbraith wrote: > On Sat, 2018-01-27 at 13:15 +0800, Wen Yang wrote: > > When pinning RT threads to specific cores using CPU affinity, the > > kworkers on the same CPU would starve, which may lead to some kind > > of priority inversion. In that case, the RT threads would also > > suffer high performance impact. > > ... > > > This patch introduces a way to set the scheduler(policy and priority) > > of percpu worker_pool, in that way, user could set proper scheduler > > policy and priority of the worker_pool as needed, which could apply > > to all the WORK_CPU_BOUND workers on the same CPU. > > What happens when a new kworker needs to be spawned? ?What guarantees > that kthreadd can run? ?Not to mention other kthreads that can be > starved, resulting in severe self inflicted injury. ?An interface to > configure workqueues is very nice, but it's only part of the problem. P.S. You can also meet inversion expressly due to having excluded unbound kworkers. ?Just yesterday, I was tracing dbench, and both varieties of kworker were involved in the chain. ?An RT task doing anything at all involving unbound kworkers meets an inversion the instant an unbound kworker doing work on its behalf has to wait for a SCHED_OTHER task, if that wait can in any way affect RT progress. -Mike