Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp687734pxf; Wed, 7 Apr 2021 09:11:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKdyzmk3U4GSW1Aa3ZyUiSzFQ3MbR8dX1JOgcOc8FCvetFbTSf4AzKPn7kiuYUnrzxteEy X-Received: by 2002:a17:906:600b:: with SMTP id o11mr4645455ejj.345.1617811918777; Wed, 07 Apr 2021 09:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617811918; cv=none; d=google.com; s=arc-20160816; b=yZnqpDtMtwOmlYfBkxdQvaCLHSApAj1vJygdKIyeHO0tgzWYNJ9F0lkOCsJivGbszu g8knTMLK/oLKOm+3O+ufUl9N/f7RCCaEm8cf1e3MHigKWD4i2mgdlhs3Ild3u/hZD1YC 6C4FRfl754uFLc89jp+pvPe2XBj0rzFtEJgBbdfBhESTXbz5S1EzC+JG7G6jACoQR69a 8rtyKuJkHQKNBbg/cpaa5gF/KCubG6Nac2S1Hu8L2WR7UnXdsEqWWLbSOXX70vjkWxlX ubsDFRSu65EZ8okPOr9D1l3MXVEL/HCxJzfrKFTob/2JKVMPhMW1Wnr5CjmAZD0U9QX+ LZWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dmarc-filter:sender:dkim-signature; bh=SMzPWIhKVgVyt+OXV36wrD1CBWot3oCL7BANrZGmW5s=; b=yeMTmYYHlIzV42asizY3ZCwdE7F6e5sEE/y4xiLlk/65/VNOXSbkpbPp8dNhr/LhLL Am9jG0MDhVA5grnWlnoqWNnV04Ijwy4gLqmBOTgShQlPEtut24UO4xAlFXqJMNjLVuWT u6mtAkzFJTg7D5/KHB8pMSKs2JwB8Dm4i7pAsrTd27VWRyCqZxsr8oOxOBn7WgJ0qhfZ yUbPBDXpfdQazGzQsdRMK43Sb+mrc9oVdBEBbd1Zl77h5UQzk5n7QN614S4zkjqi27vW WahnaWXmLPC/T+eb5x87NCMHx6cXwH0J2HbqBj2T48tTHF0bQWU8skYULKWgRsoKZKl4 2gIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ZxHaYdkk; 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 cq25si12942434edb.77.2021.04.07.09.11.33; Wed, 07 Apr 2021 09:11:58 -0700 (PDT) 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=@mg.codeaurora.org header.s=smtp header.b=ZxHaYdkk; 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 S1347776AbhDGBjb (ORCPT + 99 others); Tue, 6 Apr 2021 21:39:31 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:56507 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347747AbhDGBj3 (ORCPT ); Tue, 6 Apr 2021 21:39:29 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1617759560; h=In-Reply-To: Content-Type: MIME-Version: References: Message-ID: Subject: Cc: To: From: Date: Sender; bh=SMzPWIhKVgVyt+OXV36wrD1CBWot3oCL7BANrZGmW5s=; b=ZxHaYdkkPfnuk/RIkf6ZZe0AN9c0D/x4gJWU87Sf+mruz32LVMzT0JQVdaUfF02pbUBYA/Yx yojjYpxr/i3KMBxFDemSMv/Nn1E6QpkIvLFrHhF9JWrkBW5mnMcLebK6Qwwv1QTA/GcW9ObA F6fm/wHJjKJVW98agGih885sGPU= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-west-2.postgun.com with SMTP id 606d0d369a9ff96d95415e7e (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 07 Apr 2021 01:39:02 GMT Sender: pkondeti=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id DF21BC43465; Wed, 7 Apr 2021 01:39:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pkondeti) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0F9AEC433C6; Wed, 7 Apr 2021 01:38:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0F9AEC433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=pkondeti@codeaurora.org Date: Wed, 7 Apr 2021 07:08:56 +0530 From: Pavan Kondeti To: Tejun Heo Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Zefan Li , Johannes Weiner , Quentin Perret , Wei Wang Subject: Re: [PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup Message-ID: <20210407013856.GC21941@codeaurora.org> References: <1617714261-18111-1-git-send-email-pkondeti@codeaurora.org> <20210406152715.GB21941@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 06, 2021 at 12:15:24PM -0400, Tejun Heo wrote: > Hello, > > On Tue, Apr 06, 2021 at 08:57:15PM +0530, Pavan Kondeti wrote: > > Yeah. The workqueue attrs comes in handy to reduce the nice/prio of a > > background workqueue if we identify that it is cpu intensive. However, this > > needs case by case analysis, tweaking etc. If there is no other alternative, > > we might end up chasing the background workers and reduce their nice value. > > There shouldn't be that many workqueues that consume a lot of cpu cycles. > The usual culprit is kswapd, IO related stuff (writeback, encryption), so it > shouldn't be a long list and we want them identified anyway. > Sure. I have not done a complete study on which workers in our system can compete with important tasks in other cgroups. We will have to do that to adjust the workqueue priority so that the impact can be minimized. > > The problem at our hand (which you might be knowing already) is that, lets say > > we have 2 cgroups in our setup and we want to prioritize UX over background. > > IOW, reduce the cpu.shares of background cgroup. This helps in prioritizing > > Task-A and Task-B over Task-X and Task-Y. However, each individual kworker > > can potentially have CPU share equal to the entire UX cgroup. > > > > -kworker/0:0 > > -kworker/1:0 > > - UX > > ----Task-A > > ----Task-B > > - background > > ----Task-X > > ----Task-Y > > Hence we want to move all kernel threads to another cgroup so that this cgroup > > will have CPU share equal to UX. > > > > The patch presented here allows us to create the above setup. Any other > > alternative approaches to achieve the same without impacting any future > > designs/requirements? > > Not quite the same but we already have > /sys/devices/virtual/workqueue/cpumask which affects all unbound workqueues, > so maybe a global default priority knob would help here? > yeah, not exactly what we are looking for. It gives us the abiility to restrict the priority of all unbound workqueues at the expense of not being able to prioritize one workqueue over another workqueue. Thanks, Pavan -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.