Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6851799rdb; Fri, 15 Dec 2023 09:55:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IETOfmUCDnVQKA3/z45bM6m2gpIw3SvRYEWj3VYLD73W1KNqiPK4ePbMqXOrh2qYGdvouvW X-Received: by 2002:a17:906:b389:b0:a19:a19b:4266 with SMTP id uh9-20020a170906b38900b00a19a19b4266mr3493185ejc.209.1702662900274; Fri, 15 Dec 2023 09:55:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702662900; cv=none; d=google.com; s=arc-20160816; b=Jg9GiBte4+QYHMqFlO+fn8FXzBRMRTiQuCBfOc/dxAbShwgPxXuPM+HMK1bjBh+SoC szFN+QEyVjK91rvS62mhyXF45jb8GHWSI0tiG2yhB3ulUQ6UebzPNajP/D9D8HNfnnjJ Kx2YA89aRLMrPA6co51TtUqNS/9X0xtxBTZN5IVqfkRkbRq+qzi8uYhVItRTrbLuzk4V N2hehU5Ey3ED3t4R4bdKnVN9XDhE99k+Q2KbZa+Y0DCc7OMJLkBcfXlsnK3JmhvdcHFd qtcbxNYLe6FtVgPBQaxpVKBb7ILOi6KuBkswu9GTgRNhHaDuF6ax69rxFeY6NtPLRffn JS3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=DqL/+PQxtD2SuJ+ds8ijf5c1eBZNUOinrnvlGfUp2Vk=; fh=Raf0IPL6E/1BXp97sLX8liieEw2b3tFFhf0jaJu5rrU=; b=Bv8ocuT2WLdrdtmwkw6gSxPXktA4nbzuSeH/zDK6/wWoTK3kRKDgECIv8iYj/63qa2 K975W6+kdLtb21V6LPuoNAzvlx3VxGPp5Omwe+0KQdbHC9+qtOGiv4weqyML0ilIYh1O cqXMaY0XEzm29yYcXlraNPGaUnrM0NPmzOFoiY+ZcYF3espM8fCGDP4XdD1dQubOqblK v2rmtyDQhcZG07+vABNPtAOItYQTUtxc1tg6oaT64lY2jdHQMhn0H19DBc7xCAhhIdKw fakOvpFr94T+oRp/qX1XX3Q3dahu11yFuZcds7MsxPLofr4iKEzX1veytYpEJ15lU5WA OSSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ScvxSPRt; spf=pass (google.com: domain of linux-kernel+bounces-1475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1475-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x20-20020a170906135400b00a1e25d3070csi7467234ejb.1053.2023.12.15.09.55.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 09:55:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ScvxSPRt; spf=pass (google.com: domain of linux-kernel+bounces-1475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1475-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 06BF41F24457 for ; Fri, 15 Dec 2023 17:55:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8B8D3011E; Fri, 15 Dec 2023 17:54:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ScvxSPRt" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 CB6CF30104 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 Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-5e33a2f0cacso15279577b3.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=BN+rwdgs+Jfbc2W+g3vPzkjo0/YARFN7I14JISBho6E0IJuP+TBuSeAlgMoAU8Jnj3 mE/eqRFffgEKCB4iaizwYjB0Ke/ft2NwqEnvkxAH953VSRtp6txXz5yif/sx/Zz/NyE7 zb68CMqXQ3Xy/2cWpacIYiqSqjyoys0GwoiwOd+IknrXhQX9glxJHZprC43hGQtx99pd q0Qs9YapWbmf6+fmCXM0LcA1zAtDGEmthZefRjuxpaA7f2GOrtjRZEiw770OYAX5AzlN D+mW9JUjVsewP0gf41mHH0c0KP5XYdrnIbeIZHxmhXq31Rsli/Hy0dE+rSV9TxyU0mkh fsuw== X-Gm-Message-State: AOJu0Yz9NBkTno2246DjtUJqCLV2TtxDSrZS5p17xH2cQTiTtYH1PuO4 Esg2PYp7/p3onlrrNT6mvq47HNLP7KA= 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: linux-kernel@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).