Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp525554lqo; Fri, 10 May 2024 07:09:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPQWGcZye3kra8rdp+Oq/BtuDKkpMHrC+6EyVwZkJrY8In6iwJ/gtBm4x18gkTC1Rhs/mGvejIJG1TE8dz4rSnPjMzv3Zart+QqBmv2A== X-Google-Smtp-Source: AGHT+IECy9X/craSrPRAbFxB5BFtqeUArQdzRDQnMacn3D/qQ4XSUu0kD589+k1zr8zY9FhAOTtE X-Received: by 2002:a17:902:c947:b0:1eb:60ec:30e0 with SMTP id d9443c01a7336-1ef43f4d044mr31974405ad.46.1715350174574; Fri, 10 May 2024 07:09:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715350174; cv=pass; d=google.com; s=arc-20160816; b=JbEK2sugQX7NXsIpAf4OqbS/qfQbK1GYH1l64ozenwpqT1T0juD1h2booa1NgfvnYE 4ngdvC4pmfvyVxMZtMhEOQAsMiBtR1nAxuV77A5DAYCVy/GhWx0ImEn4WYvof2c6y1kI 3t1KdkL7aMVWy28gDv+KgRtcgs17OfxTO4QFB9YV/vbgqnOruq1GGe8uTxfijcrBQWlK XinZZwcT+aFQbMLHYgvQAezQF5eR+lytToISHb+ZQ8rkWW6fn99cOBjHIq0VjSD8eO2y ehympTlXn6hMSILRl5iJxiOK6lUNww7rl6KY4LxzRqMvaeZjzBpfXyuGfHzRc+jxi7g2 dUtA== ARC-Message-Signature: i=2; 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=GkZxGT0ZfdKB+GEeESf4UtQYxmmTquZLaDxSfhLR3LM=; fh=X5djSopb7X0FXRjzXEYc04R+np7ImqhcG5I/8QXDKc0=; b=AFte+HdD/hSmYzK39AK/b3MIWMfadk7KCL8qlaF6lVTyMBI1kySx3ZfkIuJGNt2ivR W2k4BjnicPon6lzq/psOj4MR2H72RaQabwbUf2LsyMOojah2MsjNQ4W9HYCt3LmlSNXX LK1o7hKQOv4YYoJ6roct+b4W1d50zZBiCb0N2vM/cifDp4+15dvekEHxHhbcIE1vWmmO UCCRM3TLwOIDxctuREtCkxhwsn4L+Kg8r5AAulm5oJfaPG1YZUbVMxiBKTURe0rBZ90o ja9DHjqKehxBXDi5PwvcN6ZHOrvtI3S4UXD7992a9CY6th+qk02cFnM5Ytz0xOuiMMCE bViQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=gOcPuPlZ; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-175865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c26a2c1si36044705ad.584.2024.05.10.07.09.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 07:09:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175865-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=@google.com header.s=20230601 header.b=gOcPuPlZ; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-175865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175865-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C93DA283CF7 for ; Fri, 10 May 2024 14:09:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BA7D172BB2; Fri, 10 May 2024 14:07:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gOcPuPlZ" Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.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 491D1172793 for ; Fri, 10 May 2024 14:07:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715350035; cv=none; b=jUkf5QzoLOdVWlq/UzxI8q3PRtrcBR0M1XYdR3djxRgqdVnUMTNSu+uXdcoyNNh72AXdusrYmtAUz0CGcJCLx1PsoviNZ9HsUS4E9Y6FU7Ik/RG4Bf17Sbb3By4cs6/nr9/kCOOBaJBcVzARs9t9NxkWfkHr/D6R5nthucZB/oA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715350035; c=relaxed/simple; bh=CIb9re05hOwtASAGaBhr5D9oxM0cSwxJ6I2jaSlRch8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Jel3lWqrKD5ovYI0HoIHoXrrD4azguZ+hskegirLTcXB/4u8dwZxlaTwwMsUzTOhd8b9G9IV6v/9NI1ZtDVZIi3fwsRZoI08BuSntAbyxqSKlSZkbtDniaAC5zRe+vPBXNtXz2Aa8QbC1xqSo8WOoOYpiuyzIvWKDO/sWzpMgo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gOcPuPlZ; arc=none smtp.client-ip=209.85.214.201 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-pl1-f201.google.com with SMTP id d9443c01a7336-1edcfcaa2a4so20319405ad.0 for ; Fri, 10 May 2024 07:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715350033; x=1715954833; 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=GkZxGT0ZfdKB+GEeESf4UtQYxmmTquZLaDxSfhLR3LM=; b=gOcPuPlZPoc1rISquCUDrqpuaujYZPHdQ7/E0qPWTtVmRJwwFLK7wEAgIf9ogBlsYL yrDg9iQ89Zlibg88MjGc8uSaqdjXhjz3tfNnhIaPSD+p7qB/VmRaOf7ZoI5DDLpRcTAw sSWEIqlKnFrf3v89ihFOGbs6n8HdanK7qG4sZiYmfPBTz6Il1sDt7hJrb+oAGWGCh9wJ PdHKBrU7EHYw0c07GUsA7x1rFZv/7GDTR+lYUCAPoti2iE9U5o1Vxv3m0M4UaGlKlWmz sNvwhHxZlpM9lBcgLrgeXfWyVuO0pHWJ0JW47wnSBI3X5tZpLKPTEoUtQHV62U1wPeey tl0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715350033; x=1715954833; 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=GkZxGT0ZfdKB+GEeESf4UtQYxmmTquZLaDxSfhLR3LM=; b=AnIF+IojwV9cYwFmO4fFBVsIKpCz5KYtQS4Zy7h4GnHzTb5oORqcDUX4xWSEyd1Fg3 Upa38Yb099SeEDHzYJS1BdOv3VkOmUNltJrLh9SuX9bG5ralQNh41ctLRui9sTPqCX0x M0CHJDXPji0foqgu5KaVOGgoDZB9zgTjJziuSbdzPQQ6ZcNupMJYAvZgbaJOAr+auJyr RjKGjE/7hQGNDk2bYL0tAw/3F03nshdZo+oQkbNIBhUk1Qeh+mzcFoPzdfFUvK8IkzLp qJ4TVKG/21MJb1zkAtliSbM4W2Jgddwg+4+G/uZ8nbDQw0w3x716cUYuquMussRzDNbD ppDQ== X-Forwarded-Encrypted: i=1; AJvYcCUURiCGFibkLHFkuFfe0XFtSCK1rXUwDVL3XGrmIQtGJ+Wlv+iBwNsZbrzaxc4ElWM6N2PlzGQnGdLea08QkSKTi0cCueulatuWnYXR X-Gm-Message-State: AOJu0YyzlNaFrKDiTfaZKayV6/iSEQgaWULEAghmVIRv4InJkuhHdltO 6xr/mFu6G0RfN7WsblS103z1pdiFUtfZdnK1QjTwMAawXQfEmHr+/8+ZFiuo3r/penpw5e1OC2i t1w== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:ce90:b0:1e8:d157:2329 with SMTP id d9443c01a7336-1ef43f4e4b7mr78265ad.9.1715350033435; Fri, 10 May 2024 07:07:13 -0700 (PDT) Date: Fri, 10 May 2024 07:07:12 -0700 In-Reply-To: <20240510111822405PCAy6fW8F_-AfMPoCfT8u@zte.com.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240510111822405PCAy6fW8F_-AfMPoCfT8u@zte.com.cn> Message-ID: Subject: Re: [PATCH] KVM: introduce vm's max_halt_poll_ns to debugfs From: Sean Christopherson To: cheng.lin130@zte.com.cn Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, jiang.yong5@zte.com.cn, wang.liang82@zte.com.cn, jiang.xuexin@zte.com.cn Content-Type: text/plain; charset="us-ascii" On Fri, May 10, 2024, cheng.lin130@zte.com.cn wrote: > > > > From: seanjc > > > > > From: Cheng Lin > > > > > > > > > > Introduce vm's max_halt_poll_ns and override_halt_poll_ns to > > > > > debugfs. Provide a way to check and modify them. > > > > Why? > > > If a vm's max_halt_poll_ns has been set using KVM_CAP_HALT_POLL, > > > the module parameter kvm.halt_poll.ns will no longer indicate the maximum > > > halt pooling interval for that vm. After introducing these two attributes into > > > debugfs, it can be used to check whether the individual configuration of the > > > vm is enabled and the working value. > > But why is max_halt_poll_ns special enough to warrant debugfs entries? There is > > a _lot_ of state in KVM that is configurable per-VM, it simply isn't feasible to > > dump everything into debugfs. > If we want to provide a directly modification interface under /sys for per-vm > max_halt_poll_ns, like module parameter /sys/module/kvm/parameters/halt_poll_ns, > using debugfs may be worth. Yes, but _why_? I know _what_ a debugs knob allows, but you have yet to explain why this General speaking, functionality of any kind should not be routed through debugfs, it really is meant for debug. E.g. it's typically root-only, is not guaranteed to exist, its population is best-effort, etc. > Further, if the override_halt_poll_ns under debugfs is set to be writable, it can even > achieve the setting of per-vm max_halt_poll_ns, as the KVM_CAP_HALL_POLL interface > does. > > I do think it would be reasonable to capture the max allowed polling time in > > the existing tracepoint though, e.g. > Yes, I agree it. > It is sufficient to get per-vm max_halt_poll_ns through tracepoint if KVP_CAP_HALL_POLL > is used as the unique setting interface. > > Do you consider it is worth to provide a setting interface other than KVP_CAP_HALL_POLL?