Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1271138lqm; Thu, 2 May 2024 09:38:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWuqRNkwdD/X6+V79HUoqP0wiZRTF1TDqtOtPaUUSJHNmWXsxb81jCdNCaKThzg0nQx+feYQKG04rz6A0BTADQKDECdSQoQ1QDwcdFpng== X-Google-Smtp-Source: AGHT+IFHt2ClR1nwUQZKE0sxddnX/MKLCrzTHRFQ1CCtTGpMEKlqidCpOcfIr0LFH7L2xf4OOTNH X-Received: by 2002:a17:902:e548:b0:1ec:c6ba:f2c3 with SMTP id n8-20020a170902e54800b001ecc6baf2c3mr365170plf.2.1714667798629; Thu, 02 May 2024 09:36:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714667798; cv=pass; d=google.com; s=arc-20160816; b=Uro6QvMGgsu52iDBppsTgYUP7YXigc7BIc7WVAcjqT08CLCsG8Tmn5zLkbCVjAkr3M ojVw6pvEQJHpbmU8Gj+MEqi55cQczZa/PsnSIN7PjliCFDQMdh+W8Mi6TwV3CMv1KrJr zAzZmJlsvWNTHW7nRPMYkPbBCgvRDiWYiM75CMHYuXDDzZXyZrqPLnQjv8UxoIr9dV5p +213tI70CzX5pQzPpacYl0vDeC8JiCMcRw0rWJ1NOcwqfh5pF6L3BYRNbeTcPop6Ptgu m2+n2gdbE+J4b0MeThOrwT9Cpy12suDbPmDR/DfPbkiGayOKjr9hE6HmheAuZvbz+Am0 5KBg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zdfrErG2WKK57Kqg0tDJeJKezf1hsqRf679zsJ01Sx8=; fh=FsftUmHKGlE5DUHOtAJ4qYWsslsSEq6gj1apBJv7FHY=; b=yDoIXzFKc27nZk/Y2Q9/btgWC/gnBXvcbkbDzuXEZG4pwzyp3GoZIt6D4WTJ3PUwLw OB5Q7g7/6qrA5q09Tziqz1moKpa0oHfu1IEpzYrGM905A+RJFOwwUdbIBLSFrXkUY6CI knfH/sZWuQqk/6mCYtfCRspm9B3cFsHYT83Hh3+SvolqMCDKIzk9ydi+BrM8hpjZFAYv CSvtB6mdUkB9dgQsVj3JURLWAiOfQO4gbexR0Luev9wtQw/It3V63krP/J6OkUET5AXl mTgouopx/BMKvLpSvSfmzsmVUyOanEsaV6SX4j/323Sh6meBK6zg31dQV7RllhzT/d2u iw4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VlFbWNta; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-166192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166192-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x5-20020a170902ec8500b001e813d8b0c0si1321256plg.124.2024.05.02.09.36.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 09:36:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VlFbWNta; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-166192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166192-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4BD28281CE4 for ; Thu, 2 May 2024 09:16:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCA8253E05; Thu, 2 May 2024 09:16:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="VlFbWNta" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52364524D4; Thu, 2 May 2024 09:16:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714641387; cv=none; b=UVIl49wCeM72CAUPVSD5cJwdz3T01f8mwdmO2r+c/U606WIHP8GEh2vJa6r4/Ij3g9K/qQ/UMvs/e9nQbghhf7lG6Bm3jlg442dOLaRBMcXI/SUC5mwVZ8VG95vw0DmeSDoTIQhqjmOCVV/eqOdS5LllRVKVvYKdH7AFEI/55RQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714641387; c=relaxed/simple; bh=XpgtUboWUY4K6D8ln7r4Kd9Dv08JhYX+E7YkIpI3eo4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oyt4LOdExWE8Avd3+POYrvR/y0GPC41Z3W2GKnpRx7elJRued7kdvymIH7Stm/BTpVxMK4/wC5vDe/lCQyb4eM9dX1cv6wXNxvkoWq6zNETorC5GgVsIa552EqPiQJyBN3rhsfMohRXOFo69hCi7e4z11/92ieJQmCg70T8H18E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=VlFbWNta; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zdfrErG2WKK57Kqg0tDJeJKezf1hsqRf679zsJ01Sx8=; b=VlFbWNta+BWffxnbEWRjYv+8ar 0mSAZEi/5K7GE5WmbbDT+r4ARA9iQeFFKkzCACPe/gwvSf/LmUcAlJNX/ZoW8bwgnYR9QDAGNKCRl LzUKo6XjLhjBfyI4SmA0ITYpIXJydjEMOIR5DsW+FpCgValTn4WKP1/mCF21xbM9WHcwZgrRyRpU3 FiEPtEuWLxgIvsZuc6BZmNuqB9C27xGU6sZ+HHCefx17Ax1NXRdpTkAdW+Lul7YwDGf4y9Ll5M8Pf tKmEV2OKo3OjFdHTXGjEEinxeVzjqku1MmncoJ0aeBuJXe50y5tEKJEF/VvmaENEvgQqxyQgc0DNI 6DxwtawA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2SY5-00000001KYe-3aFr; Thu, 02 May 2024 09:16:18 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 82B8B30057A; Thu, 2 May 2024 11:16:17 +0200 (CEST) Date: Thu, 2 May 2024 11:16:17 +0200 From: Peter Zijlstra To: "Michael S. Tsirkin" Cc: Tobias Huschle , Luis Machado , Jason Wang , Abel Wu , Linux Kernel , kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, nd , borntraeger@linux.ibm.com, Ingo Molnar , Mike Galbraith Subject: Re: EEVDF/vhost regression (bisected to 86bfbb7ce4f6 sched/fair: Add lag based placement) Message-ID: <20240502091617.GZ30852@noisy.programming.kicks-ass.net> References: <73123.124031407552500165@us-mta-156.us.mimecast.lan> <20240314110649-mutt-send-email-mst@kernel.org> <84704.124031504335801509@us-mta-515.us.mimecast.lan> <20240315062839-mutt-send-email-mst@kernel.org> <20240319042829-mutt-send-email-mst@kernel.org> <4808eab5fc5c85f12fe7d923de697a78@linux.ibm.com> <20240501105151.GG40213@noisy.programming.kicks-ass.net> <20240501112830-mutt-send-email-mst@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240501112830-mutt-send-email-mst@kernel.org> On Wed, May 01, 2024 at 11:31:02AM -0400, Michael S. Tsirkin wrote: > On Wed, May 01, 2024 at 12:51:51PM +0200, Peter Zijlstra wrote: > > I'm still wondering why exactly it is imperative for t2 to preempt t1. > > Is there some unexpressed serialization / spin-waiting ? > > > I am not sure but I think the point is that t2 is a kworker. It is > much cheaper to run it right now when we are already in the kernel > than return to userspace, let it run for a bit then interrupt it > and then run t2. > Right, Tobias? So that is fundamentally a consequence of using a kworker. So I tried to have a quick peek at vhost to figure out why you're using kworkers... but no luck :/ Also, when I look at drivers/vhost/ it seems to implement it's own worker and not use normal workqueues or even kthread_worker. Did we really need yet another copy of all that? Anyway, I tried to have a quick look at the code, but I can't seem to get a handle on what and why it's doing things.