Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752638AbcCUH67 (ORCPT ); Mon, 21 Mar 2016 03:58:59 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:56186 "EHLO e06smtp14.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752114AbcCUH6t convert rfc822-to-8bit (ORCPT ); Mon, 21 Mar 2016 03:58:49 -0400 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: rapoport@il.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Message-Id: <201603210758.u2L7wiLT001242@d06av01.portsmouth.uk.ibm.com> X-IBM-Helo: smtp.notes.na.collabserv.com X-IBM-MailFrom: rapoport@il.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org In-Reply-To: <1458339291-4093-1-git-send-email-bsd@redhat.com> To: Bandan Das Cc: tj@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, mst@redhat.com, jiangshanlai@gmail.com Subject: Re: [RFC PATCH 0/4] cgroup aware workqueues From: "Michael Rapoport" Date: Mon, 21 Mar 2016 09:58:39 +0200 References: <1458339291-4093-1-git-send-email-bsd@redhat.com> MIME-Version: 1.0 X-KeepSent: 641D3F07:8A5F875C-C2257F7D:002B1001; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1 October 14, 2013 X-LLNOutbound: False X-Disclaimed: 53627 X-TNEFEvaluated: 1 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="US-ASCII" x-cbid: 16032107-0017-0000-0000-00000893183F X-IBM-ISS-SpamDetectors: Score=0.40962; BY=0; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.40962; ST=0; TS=0; UL=0; ISC= X-IBM-ISS-DetailInfo: BY=3.00005063; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000153; SDB=6.00676430; UDB=6.00309833; UTC=2016-03-21 07:58:40 x-cbparentid: 16032107-0598-0000-0000-0000070298FE X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1685 Lines: 44 Hi Bandan, > From: Bandan Das > > At Linuxcon last year, based on our presentation "vhost: sharing is better" [1], > we had briefly discussed the idea of cgroup aware workqueues with Tejun. The > following patches are a result of the discussion. They are in no way complete in > that the changes are for unbounded workqueues only, but I just wanted to present my > unfinished work as RFC and get some feedback. > > 1/4 and 3/4 are simple cgroup changes and add a helper function. > 2/4 is the main implementation. > 4/4 changes vhost to use workqueues with support for cgroups. > > Example: > vhost creates a worker thread when invoked for a kvm guest. Since, > the guest is a normal process, the kernel thread servicing it should be > attached to the vm process' cgroups. I did some performance evaluation of different threading models in vhost, and in most tests replacing vhost kthread's with workqueues degrades the performance. Moreover, having thread management inside the vhost provides opportunity for optimization, at least for some workloads... That said, I believe that switching vhost to use workqueues is not that good idea after all. > Netperf: > Two guests running netperf in parallel. > Without patches With patches > > TCP_STREAM (10^6 bits/second) 975.45 978.88 > TCP_RR (Trans/second) 20121 18820.82 > UDP_STREAM (10^6 bits/second) 1287.82 1184.5 > UDP_RR (Trans/second) 20766.72 19667.08 > Time a 4G iso download 2m 33 seconds 3m 02 seconds -- Sincerely yours, Mike.