From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 CE08930106 for ; Fri, 15 Dec 2023 17:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ScvxSPRt" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dbcc5e43ba4so1673965276.0 for ; Fri, 15 Dec 2023 09:54:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702662887; x=1703267687; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DqL/+PQxtD2SuJ+ds8ijf5c1eBZNUOinrnvlGfUp2Vk=; b=ScvxSPRteBjmpxbBCeUZL5vXVqxbLl8VVbZyN3DZAIsIBv9PhxumpUgpnlFv7jn8oj zbeEFpQkaAD0aNhjAAX69CLcajUEaxuWHTcBNodCYKyx0XZ4Swrxv6L+PcIbBJlxu8AZ XaUJsi4qacPBP1ho5ia1sfaFBXqfqk2H4L83WUhOjTyJ83dLPA3H857Uj0UJu7LHrtEp n4oEMtHJbCUJjGe1uBa7NjZs8TP/5BJXCtE0TR+muhBw7YQ0QRxBE/upV+sbxqUWzg9E CBr9caDHwa3V5WMVwHo8cHcHGwIQJhxi2H4IbbSfccmFIDcgNFXgCMmf1Ly923pfnU79 rSUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702662887; x=1703267687; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DqL/+PQxtD2SuJ+ds8ijf5c1eBZNUOinrnvlGfUp2Vk=; b=Eb1+zOUzMJ2XxVkzwZpjesxTGq8xaGMbTTJkKxzT+kkvbeZn/5X4uRt7OMQYG46KyV wypWvE8RRmFDnc7HF1aHOsde8dQqdMLdHO4BlZcElEOXFcy/D3Wprko/FnzEub9zpFle 83gvW19hohn+ESOuhdOEAdS13UregaCwmZSgIn3UhlG79FKZGzX6Y6R8eR/KIv+t+B0W uA2iyJ2/5CXt1XD0LyV7L55Weog8wzNMgjJdOnBkOE657Cew9Yn0MsgT7IcLdK6iltoS e+NoFNFFDWCuRa0JYy3ewGndvrW5uOPf8xdEQyXeYiuUkr29dra+aLlQeLKNOag4NceF 7XXA== X-Gm-Message-State: AOJu0YyrWOuSHdvEdWkBGWa0CllbXdDyuRaSLmwERh8QztgmT1HQ2Wy0 hPvqiZpVRC4rZqmlRH91FJNf4ydXddg= X-Google-Smtp-Source: AGHT+IFWBObteEun2vkoo/efmhIHBiZy4fw+uEFUgKZqya0QsPH6aHV8LDFaGzsqHS1mFqr8mvF0sx/NXP8= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:14d:b0:db5:3aaf:5207 with SMTP id p13-20020a056902014d00b00db53aaf5207mr212769ybh.3.1702662886829; Fri, 15 Dec 2023 09:54:46 -0800 (PST) Date: Fri, 15 Dec 2023 09:54:45 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20231214024727.3503870-1-vineeth@bitbyteword.org> Message-ID: Subject: Re: [RFC PATCH 0/8] Dynamic vcpu priority management in kvm From: Sean Christopherson To: Vineeth Remanan Pillai 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="us-ascii" 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 attached and receiving information, but do NOT wait until you have fully working setup before posting the next RFC. 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).