Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4130712pxb; Mon, 27 Sep 2021 10:01:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQm4p2jZ/Z7LQEb5vUPLZNAIzFUE699Cqx0AXXzHXOuN6Wvke9qQznoQvpNp/O5SjVGQKx X-Received: by 2002:a17:906:707:: with SMTP id y7mr1235860ejb.148.1632762086613; Mon, 27 Sep 2021 10:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632762086; cv=none; d=google.com; s=arc-20160816; b=TbiKMXgQAbsodC+oC/AgVs7QYBz15YsisyU0SbOQxgDAHOTbbx5J6872lQa0ewXrGS jgrJY3Aafaba7NALpW2mhsVbRJs7cktQp4XcgMBA4BrrskDhXuCl/D0OX5UoqnONGdfC P3W05Wjijec8ALu878kwCxF2lLdBH9MpCAIOgv8/2n8pm+OKf40uI3UQjRP9hBZ7y+aq vjxFaLWXM2LgYS48UMetI1EvxB3zjOzZbfac3vOFRbjjIrhyjEo59l18KMWE71BZjZpq 5wV3vK3UsAakr47uMFGBcfTiv8Vl1fAudKdFHPqdt5qsCHfp2cVnrdKhh+/ToTHpb1f4 uETg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=boyhOy7c3Zv3+YHD3yPMRV9jTZZHINKXKipnorJKcwg=; b=OdlY8L6P9GJC2MRrY1oOc9jEeSJzhaRMtJOxedaCRfwb0xwQe0KrOtQs2ZWoQiPkRj 906rMHRusSbkgegcF5FAv1e3T43aLCIhR9LF0lsyA6md2nSVH+daVtmIVEpN62ok0Iah qzyrytN5FlwV9mnL4GfW99tYAxaRWx8js9pd4684b7JmerYLvsgPgFk57w35LqJsTflm ZX1GxGgDJbzXK6BSHWbSN/RsEVERDMQrVqrJoYGdMRduee0IRVkWF85vp+OlUBl7NwLL 7xbQZFP6ufTVmfI+fNrPR8sL5N8pp8UNe2C67L9YENtXhLaYeNUhj8DFqGifj7EUKLqL eGtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EFsgbbFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k27si19706647eji.724.2021.09.27.10.00.54; Mon, 27 Sep 2021 10:01:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EFsgbbFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235505AbhI0RA7 (ORCPT + 99 others); Mon, 27 Sep 2021 13:00:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235421AbhI0RA6 (ORCPT ); Mon, 27 Sep 2021 13:00:58 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10992C061714 for ; Mon, 27 Sep 2021 09:59:20 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id z24so81255815lfu.13 for ; Mon, 27 Sep 2021 09:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=boyhOy7c3Zv3+YHD3yPMRV9jTZZHINKXKipnorJKcwg=; b=EFsgbbFE2kAt7wByLaFcasmCsfVIgNxk/m8G/nDr+HQQCPZquhtvMBtAa+Duc5+kXQ UtY1CeMLlZTD94anpjzQv4K2YgUm9xVsItVLuyYt7PzuN+o60dJjWiO6ZURLbhkP7mzD l/1wphgAzzIFt+bnAvBUh1vmO0XgUCFQbkR5nyhNqwPHp4lRcD3QYQpAbbn7KH5W/ysv OQmlCYcjYrF8BVfGjUkclx0OrNnd/IdHMhsMfPOv7/HS8Qxd6WyABtIhI1iDB0FR5uaE W0Ua9w0Kzy0A9r7i69bL0pt1y0fFyfV6OwYtL3O/7ZJwWx+dXki0Z+PUBsXBMwLQP/I9 ShZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=boyhOy7c3Zv3+YHD3yPMRV9jTZZHINKXKipnorJKcwg=; b=F4QxrpQ7i5BrSd4/A4gqAdT6lOQKNdShknNWcAaj6XuHtlDR+FT+2nlJF7kFXQBHeE OdnK9LGvITSUc06Cbq8s/AXpCuTuYLG1npovNkmEPLmefv/09GS/QMHpUvVw6uvwrmfI UClWCSOVEeOSQRSlD+eOka64GMWPyofDV73vs5XQiaRPi3A5zhQGmHHaX5EljrivJdBY aDf8bncVbvY2TUwqNHVpHLXD8PV42WchWRbUDosZcGwhZuUe719sfwMeeb/b50zZ4Gis DDGXezfjk4t8rFAraiYVIKtELs05Mh1s8lXg7QmCNrW/f9zJ/U0RLet7L0Y8DrCM6zNK lyAg== X-Gm-Message-State: AOAM531VWqvxIZStoptqEvb+i55iVnSVnmr1e1usXRlKdl4SYHhEC4xB U9DSTXjiuJQRdvNWZJGzLcTetbZ6Fv6uteO+fxrVoQ== X-Received: by 2002:a19:c349:: with SMTP id t70mr843112lff.102.1632761958145; Mon, 27 Sep 2021 09:59:18 -0700 (PDT) MIME-Version: 1.0 References: <20210925005528.1145584-1-seanjc@google.com> <03f2f5ab-e809-2ba5-bd98-3393c3b843d2@de.ibm.com> <43e42f5c-9d9f-9e8b-3a61-9a053a818250@de.ibm.com> In-Reply-To: <43e42f5c-9d9f-9e8b-3a61-9a053a818250@de.ibm.com> From: David Matlack Date: Mon, 27 Sep 2021 09:58:51 -0700 Message-ID: Subject: Re: disabling halt polling broken? (was Re: [PATCH 00/14] KVM: Halt-polling fixes, cleanups and a new stat) To: Christian Borntraeger Cc: Paolo Bonzini , Sean Christopherson , Jon Cargille , Jim Mattson , James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel , linux-arm-kernel@lists.infradead.org, KVMARM , LinuxMIPS , kvm list , KVMPPC , LKML , Jing Zhang , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Janosch Frank Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 8:17 AM Christian Borntraeger wrote: > > > > Am 27.09.21 um 17:03 schrieb Paolo Bonzini: > > On 27/09/21 16:59, Sean Christopherson wrote: > >>> commit acd05785e48c01edb2c4f4d014d28478b5f19fb5 > >>> Author: David Matlack > >>> AuthorDate: Fri Apr 17 15:14:46 2020 -0700 > >>> Commit: Paolo Bonzini > >>> CommitDate: Fri Apr 24 12:53:17 2020 -0400 > >>> > >>> kvm: add capability for halt polling > >>> > >>> broke the possibility for an admin to disable halt polling for already running KVM guests. > >>> In past times doing > >>> echo 0 > /sys/module/kvm/parameters/halt_poll_ns > >>> > >>> stopped polling system wide. > >>> Now all KVM guests will use the halt_poll_ns value that was active during > >>> startup - even those that do not use KVM_CAP_HALT_POLL. > >>> > >>> I guess this was not intended? > > > > No, but... > > > >> I would go so far as to say that halt_poll_ns should be a hard limit on > >> the capability > > > > ... this would not be a good idea I think. Anything that wants to do a lot of polling can just do "for (;;)". I agree. It would also be a maintenance burden and subtle "gotcha" to have to increase halt_poll_ns anytime one wants to increase KVM_CAP_HALT_POLL. > > > > So I think there are two possibilities that makes sense: > > > > * track what is using KVM_CAP_HALT_POLL, and make writes to halt_poll_ns follow that > > what about using halt_poll_ns for those VMs that did not uses KVM_CAP_HALT_POLL and the private number for those that did. None of these options would cover Christian's original use-case though. (Write to module to disable halt-polling system-wide.) What about adding a writable "enable_halt_polling" module parameter that affects all VMs? Once that is in place we could also consider getting rid of halt_poll_ns entirely. > > > > * just make halt_poll_ns read-only. > > > > Paolo > >