Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7138246ybi; Thu, 13 Jun 2019 10:12:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzOGwqXw9RZfvHYkQAlGSB04ZdVKgFAQ4k7WFqP30/PDDSVGoTTZLrThXT4nUWWwitbyqs X-Received: by 2002:a65:5c88:: with SMTP id a8mr30975046pgt.388.1560445932384; Thu, 13 Jun 2019 10:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560445932; cv=none; d=google.com; s=arc-20160816; b=GsQ3hInD01KYRg9sHL6Q4krHTHVAJbLQSy4EOSbEOJH0Sos1V/35chd/N8dK33nH4z YkejStNxgp2DzwE8b9lTjawbW9QOa3GB9QGAxSg3Iaz3V/xSD6HQMocgRpwHGY5KmbN6 G0c8FHf5BVnAJxZa+lsPS33TtyBHYgIjz6xM01nnZXVaGdTZH917tUpQcybuFs1M3t2V LJ07JO3l4PJG/zlzgdZbS2HCbgnJQTfY3IJ+LWnDvlV8xm1X0gQ5xXZHYdG6Muqz4goF teqJkAXS0DeQFy6/6BBzjULb8obgK1zT1aSuF4iBpw8YKeeHIHmdmfzAStJpCfOnt7Ku pmHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SOIVm550t2juiTj4vnRQ5BaJ/KWVoCF7DZnOrZI0vno=; b=KMJs2auYre6LFFRqgTbuFDzID1mg718Gjlre7m/m+F0EvOqPsvcDSkWQn50Y53Gosu 4tH5L59DegSHAsesbgvvVmM9k+kEN1tMiF4TlK1j69r5ZaD8hCjRTjAnHeJgW9XMaxyF jfMmpyuZcOwsMXxfg/bhVWzt4FgikzI7bI7PIkMXMO+HyASZxxxb1y8EY/Ta5LqmEfdJ gxLLorlrxGqbtx2pdW/UOQhb/U1wzeza8CD7W5mapZubbJlbJqSM4ub7+QHvIaqBXo29 rFc7ClIbYsZGrceye1HJSpSNDyxgmbb1iSzKjQQ2U8w7ZBQzYgBClsrKPW18aYL5dtnI 0nlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=lhk5qU4z; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si153538plf.87.2019.06.13.10.11.57; Thu, 13 Jun 2019 10:12:12 -0700 (PDT) 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=@oracle.com header.s=corp-2018-07-02 header.b=lhk5qU4z; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729260AbfFMRKz (ORCPT + 99 others); Thu, 13 Jun 2019 13:10:55 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:38324 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729204AbfFLWdJ (ORCPT ); Wed, 12 Jun 2019 18:33:09 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5CMTs85064050; Wed, 12 Jun 2019 22:31:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=SOIVm550t2juiTj4vnRQ5BaJ/KWVoCF7DZnOrZI0vno=; b=lhk5qU4z4GwfZqTKR5mbk79cDQzaoJ563ewToos4HaKC4mOW42ZuJj4rIKQuuXEL39VM tp4ZtszcjEpWB2WzalUsZvkf7EoQ4QcnxIQ2Qft1s6ZYSRtjhbym4uydGIVYMvhQvAHw fRHwYoG8GoVcSmHkzJ6QvWx2AS/Jpc3PwZV8EssJZG84yCzFBaQYH11ADbuo9e/H9WzV gBEoPFk2imAOKNWZH8Ol5/pQ2PTjvdP/f1tgifVJKX2HZGYVJYPuqPyaHLVwju+kvqVN 3IYSt5eHrO4z++6UFpnrsjBUDs0k5Ev4rGF32Mx66rhmqD9/GhvxdpAvARzyeKXqVnkG 1A== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2t04etx9bj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Jun 2019 22:31:48 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5CMSCmx113818; Wed, 12 Jun 2019 22:29:47 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2t0p9s3x41-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Jun 2019 22:29:47 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x5CMTW3r019311; Wed, 12 Jun 2019 22:29:39 GMT Received: from ca-dmjordan1.us.oracle.com (/10.211.9.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 12 Jun 2019 15:29:32 -0700 Date: Wed, 12 Jun 2019 18:29:34 -0400 From: Daniel Jordan To: Tejun Heo Cc: Daniel Jordan , hannes@cmpxchg.org, jiangshanlai@gmail.com, lizefan@huawei.com, bsd@redhat.com, dan.j.williams@intel.com, dave.hansen@intel.com, juri.lelli@redhat.com, mhocko@kernel.org, peterz@infradead.org, steven.sistare@oracle.com, tglx@linutronix.de, tom.hromatka@oracle.com, vdavydov.dev@gmail.com, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, shakeelb@google.com Subject: Re: [RFC v2 0/5] cgroup-aware unbound workqueues Message-ID: <20190612222934.y74wxy3aju6eqs4r@ca-dmjordan1.us.oracle.com> References: <20190605133650.28545-1-daniel.m.jordan@oracle.com> <20190605135319.GK374014@devbig004.ftw2.facebook.com> <20190605153229.nvxr6j7tdzffwkgj@ca-dmjordan1.us.oracle.com> <20190611195549.GL3341036@devbig004.ftw2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190611195549.GL3341036@devbig004.ftw2.facebook.com> User-Agent: NeoMutt/20180323-268-5a959c X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9286 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906120157 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9286 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906120157 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 11, 2019 at 12:55:49PM -0700, Tejun Heo wrote: > > > CPU doesn't have a backcharging mechanism yet and depending on the use > > > case, we *might* need to put kthreads in different cgroups. However, > > > such use cases might not be that abundant and there may be gotaches > > > which require them to be force-executed and back-charged (e.g. fs > > > compression from global reclaim). > > > > The CPU-intensiveness of these works is one of the reasons for actually putting > > the workers through the migration path. I don't know of a way to get the > > workers to respect the cpu controller (and even cpuset for that matter) without > > doing that. > > So, I still think it'd likely be better to go back-charging route than > actually putting kworkers in non-root cgroups. That's gonna be way > cheaper, simpler and makes avoiding inadvertent priority inversions > trivial. Ok, I'll experiment with backcharging in the cpu controller. Initial plan is to smooth out resource usage by backcharging after each chunk of work that each helper thread does rather than do one giant backcharge after the multithreaded job is over. May turn out better performance-wise to do it less often than this. I'll also experiment with getting workqueue workers to respect cpuset without migrating. Seems to make sense to use the intersection of an unbound worker's cpumask and the cpuset's cpumask, and make some compromises if the result is empty. Daniel