Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6903331rdb; Fri, 15 Dec 2023 11:19:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuag9RsngYpp9QW/+LsOgOfrctEJXS/9IRBIxCjxUe5Wv/53QurTIPrGlKJvZGWYbAx1rA X-Received: by 2002:a05:6a00:1487:b0:6ce:6265:fc0d with SMTP id v7-20020a056a00148700b006ce6265fc0dmr8920666pfu.6.1702667949941; Fri, 15 Dec 2023 11:19:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702667949; cv=none; d=google.com; s=arc-20160816; b=I3t7W3KbWy0NWpiUT+gV/pJfD4QCJjEElOT6RkrRN3Ve/zEQdtfK2uBP3pcFe9Y/R0 IB1S89vvJSjiQW7F3jCBZ2TI/Qaivx42LQGiLF/nKPFc6ji8fed9eEalf/jpSZ3AB7BL lSfQWT0UNR/C96oTNjrNx/kCLOSFMw8gHE+r0rLJoE7F6MUF37qam4ZXyrjkzOzzks3T B6XBfElck5zaOpxYW1ZOog0WUYEaZ84gHVWE5chi+sagtB/gdDDk5gKcunlYZDzsXwmL Fqdg9emWi922n5VeQh8LYEgACC8HPaY6SQprQrl35FBhCI/dhw9SnJO9Gp5fDfAIHfA2 qCbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=LUQt64cxTRekczJujRwSGMZNUaofXXGwCuQbCkI4cV0=; fh=of7o24Li/hTzKjeBHbBM93VBOxwbV8MS8AxLlHMsnGU=; b=EanX7mAsQRHIN7ot1PFJv0s67sG4Mj/rHGZzzWTwgFbs191fGcafSsKiZTLR1OnPuR 6E7oGE1c53YPTesN9O++2tO2fgiPGbclBpS86Ah+pRIlDdVxg9RhxIEqX2OeesjxCXBi ig/molnCgbYjDGglIA/pp8FnZUF37hI+I8RkJvq4vd+v/jQMkk4/KWwjr1kjCK/8Zhs1 NnODG31VDjPStbcFV+QfF2rtdWSEP6AYk5x+3hVQi6GhEHF86c6aLmy7hkObJIHLrYCs a6oyGfH4HnVqNi+GlYdWT/pLRC9mEZU9KCbCDlPaTYIxvkQx9KeegOpjXARRB4qIUgkM lOpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bitbyteword.org header.s=google header.b=sjudvEJG; spf=pass (google.com: domain of linux-kernel+bounces-1554-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1554-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 f13-20020a056a00228d00b006ce6771e835si13913966pfe.43.2023.12.15.11.19.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 11:19:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1554-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=@bitbyteword.org header.s=google header.b=sjudvEJG; spf=pass (google.com: domain of linux-kernel+bounces-1554-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1554-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 35F74288AC7 for ; Fri, 15 Dec 2023 19:10:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B5B03FE37; Fri, 15 Dec 2023 19:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bitbyteword.org header.i=@bitbyteword.org header.b="sjudvEJG" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22E313EA6C for ; Fri, 15 Dec 2023 19:10:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bitbyteword.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bitbyteword.org Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-6d9f8578932so702446a34.2 for ; Fri, 15 Dec 2023 11:10:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bitbyteword.org; s=google; t=1702667418; x=1703272218; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LUQt64cxTRekczJujRwSGMZNUaofXXGwCuQbCkI4cV0=; b=sjudvEJG64A78oWCIDBRX5yRdxPFiilOoyNN2ITLeMpg8zuMt1jw1Z/4QzsmvjAA3e JoRTzEJnvBZtELPW7lGxlS97liB3rOgIJP+jcssttyWS9yVvhkXDHbzi3V+AD4KuAmc3 OpBnS/Q2PGvM0MmshLLLlgrNlErB7SFp6AXGghzL6+3J1MIjiTUiA43xqCiufrY0NAiT g7qiWCsD9Qk5dSeFBx2H9kVBN9EyOwREbJp+KPLaINgPJ5Tkm14HS8sVkW7S/8rTxNxk jizt1EjIOTKRHtsrm+jn0uqSP48msvEH4ZHG49Mq+iK4T2I10TdJsYotvuIk9KyRrB3G k75Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702667418; x=1703272218; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LUQt64cxTRekczJujRwSGMZNUaofXXGwCuQbCkI4cV0=; b=aOADY85BkNFwdjWtQKQQKYZqIatn7KV+AsfRGF/jyN1Q+/JW7UGih2FXSFFMgLmkKU NvUYZ9l/Fy7uh9SPEmUGP1BQVlj2z2QnCVxhmfUMxtW7KGNtdoXEUVbuDgbVG0Vw5NcT OblgV4hPA29oVJOMiP4z8ffo6v0ZjKcKAP3/2g6DdeXND+AECopIzVdnQvqpSc3pvzt1 do1qJ3ECcc5clqjjntRsHSDsS96gPKOY/vFgCwWFkhhOYSBwrfjSfA2k1GzC0S3wu6jf jcJTJTtV2ydk5p8pdSGKJ5D3Fplx4mDZJizwR+/2MCa7wRXiKQJQrXBJw/ATKlJAAQvA Zc8Q== X-Gm-Message-State: AOJu0YxjVV1uGz7nHnBJvKPWSOTHJgy09gfwDOau6j/1ascd7qTmU9Ja SbFg1TOL7jqLwo1g2NVzZe4VDjVg4SBjUWDuE6zxVg== X-Received: by 2002:a9d:6187:0:b0:6d9:e32e:fb0d with SMTP id g7-20020a9d6187000000b006d9e32efb0dmr11579063otk.20.1702667418223; Fri, 15 Dec 2023 11:10:18 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231214024727.3503870-1-vineeth@bitbyteword.org> In-Reply-To: From: Vineeth Remanan Pillai Date: Fri, 15 Dec 2023 14:10:06 -0500 Message-ID: Subject: Re: [RFC PATCH 0/8] Dynamic vcpu priority management in kvm To: Sean Christopherson Cc: Ben Segall , Borislav Petkov , Daniel Bristot de Oliveira , Dave Hansen , Dietmar Eggemann , "H . Peter Anvin" , Ingo Molnar , Juri Lelli , Mel Gorman , Paolo Bonzini , Andy Lutomirski , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot , Vitaly Kuznetsov , Wanpeng Li , Suleiman Souhlal , Masami Hiramatsu , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Tejun Heo , Josh Don , Barret Rhoden , David Vernet , Joel Fernandes Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 15, 2023 at 12:54=E2=80=AFPM Sean Christopherson wrote: > > On Fri, Dec 15, 2023, Vineeth Remanan Pillai wrote: > > > You are basically proposing that KVM bounce-buffer data between guest= and host. > > > I'm saying there's no _technical_ reason to use a bounce-buffer, just= do zero copy. > > > > > I was also meaning zero copy only. The help required from the kvm side = is: > > - Pass the address of the shared memory to bpf programs/scheduler once > > the guest sets it up. > > - Invoke scheduler registered callbacks on events like VMEXIT, > > VEMENTRY, interrupt injection etc. Its the job of guest and host > > paravirt scheduler to interpret the shared memory contents and take > > actions. > > > > I admit current RFC doesn't strictly implement hooks and callbacks - > > it calls sched_setscheduler in place of all callbacks that I mentioned > > above. I guess this was your strongest objection. > > Ya, more or less. > > > As you mentioned in the reply to Joel, if it is fine for kvm to allow > > hooks into events (VMEXIT, VMENTRY, interrupt injection etc) then, it > > makes it easier to develop the ABI I was mentioning and have the hooks > > implemented by a paravirt scheduler. We shall re-design the > > architecture based on this for v2. > > Instead of going straight to a full blown re-design, can you instead post= slightly > more incremental RFCs? E.g. flesh out enough code to get a BPF program a= ttached > and receiving information, but do NOT wait until you have fully working s= etup > before posting the next RFC. > Sure, makes sense. > There are essentially four-ish things to sort out: > > 1. Where to insert/modify hooks in KVM > 2. How KVM exposes KVM-internal information through said hooks > 3. How a BPF program can influence the host scheduler > 4. The guest/host ABI > > #1 and #2 are largely KVM-only, and I think/hope we can get a rough idea = of how > to address them before moving onto #3 and #4 (assuming #3 isn't already a= solved > problem). Agreed. Will start with the kvm side and keep you posted on the progress. Thanks, Vineeth