From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0F00C433FE for ; Mon, 27 Sep 2021 16:59:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8424460F58 for ; Mon, 27 Sep 2021 16:59:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235516AbhI0RBA (ORCPT ); Mon, 27 Sep 2021 13:01:00 -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-Google-Smtp-Source: ABdhPJyvrc2iIXbcC8YaiVkzYO41Psj9zevIrEPYYOmLf26TIPB4wujR7R6xkm6OJn238QJWJUKaISQGVYiRf4/ylng= 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 > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D02B2C433EF for ; Mon, 27 Sep 2021 17:00:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A162360F3A for ; Mon, 27 Sep 2021 17:00:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A162360F3A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Yy7bkZ2Liy7DC4fx4JPm1SOU2Vhp27533lKnDf7g7Kw=; b=lm8tfRTVQLQG5+ M2J4Fsihr/VZprcmb4JZ7/nq5ttlfN5vLmwinpa++mMbObm0/+mxxxXKelfpzao8y/Ld6JSICIDxg AOHJ1i2SwEmZvsT43qogqlfiFhbGQQQjPxcujEC+Kh8+XFqY33O8hhwRjWovEC3gz+tlzgthgS2A4 lnamGjZmVW/4VQdEAOyQ+vtJ33pS7emWtI7NFUkC7bjMrzppJfU9pT7bt0WoiqkVJetpfcf9D1ooS I/tgZeifOK16c0MhC7E7UkCWg82dr1ViGatoz+IGcC3H8TA3W2P+PcL3nNcFNWXZfx8DdgZH7XSRP GvzSGkFqqyBlCYuJMADA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUtyP-003Sl8-Il; Mon, 27 Sep 2021 16:59:25 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUtyM-003Sjr-14 for linux-arm-kernel@lists.infradead.org; Mon, 27 Sep 2021 16:59:23 +0000 Received: by mail-lf1-x12f.google.com with SMTP id i25so80803052lfg.6 for ; Mon, 27 Sep 2021 09:59:20 -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=rPPBEkfpfOiluV9SMf99TerF71JzIfnI/yBYEHVhwoiQK75t1uJpzgIYhlmQcJ0sBs hCvhoRJaQifHQQgkJqvRuo9PJxKaJcUQBCLNvMAs3TGUU6ugdKeshbHvhXFs1hnWO2+X nseYOd6yVxyw7tC7NAPtp5tiqsBbOzHmq+qcqzArLIEugR1H3IpZfmAbR8uygRKJ9YQd zZzWma3V6f6LtXijvVXhdpTlmdBNKd7ENJlGGnvhgx0NSiQ0fRbCShu3toMVAED9fqmU VbYAgvEMoLt7jkXi63cRcf5DEklyQ7D0n1GMgsI+pm+Nrc4y5Bh/PRc6kAtFUOMj1eqd sMiw== X-Gm-Message-State: AOAM533tnKFeT86VuGiaWBS+xNgMLnvowZObcWO18Qx/TDBzZqhNtjY2 RZrbUe2hJODFs3PFhIzTukG1JUC4ShNE8TsL2twWhQ== X-Google-Smtp-Source: ABdhPJyvrc2iIXbcC8YaiVkzYO41Psj9zevIrEPYYOmLf26TIPB4wujR7R6xkm6OJn238QJWJUKaISQGVYiRf4/ylng= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210927_095922_096689_45A6461B X-CRM114-Status: GOOD ( 18.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78E75C433EF for ; Mon, 27 Sep 2021 18:02:52 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id E581060F4F for ; Mon, 27 Sep 2021 18:02:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E581060F4F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 560C54B0C5; Mon, 27 Sep 2021 14:02:51 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KD9JhfVqbZQa; Mon, 27 Sep 2021 14:02:50 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 363304B0A0; Mon, 27 Sep 2021 14:02:50 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id ED88440C88 for ; Mon, 27 Sep 2021 12:59:20 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3HtaPCEudci5 for ; Mon, 27 Sep 2021 12:59:19 -0400 (EDT) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id BCA874086F for ; Mon, 27 Sep 2021 12:59:19 -0400 (EDT) Received: by mail-lf1-f49.google.com with SMTP id u8so79267333lff.9 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=uA2naR7OsIE/Hy8lYn3aObkmZymJ9p5JfnnIjumZjL+DCxUucLn2s9G7Onqo/mzlvQ JCRIZxHdGvaTfzbkUeCPGU85gLVLd1MSHqzwJysHyRSGIMnTjtudwNOw6HUq52ZjoL0v gmb+fwcmgfhmtjOQOiRIhEMR53t5RI3K+XdiY/Px0IArJsPaVA10jg+snoNUyiGJrVa9 6pDlMPdwQIazz7cb6NRLb+AsrEFYkQFDBr5VT/khoJKkgvb98wE5QfDiS7FPiq6/8TCm y1xJiKak0dI7HN54xtoS1j/4vOKeEYdZwx9gSXyZqn+OPJcYsmdbTnxhilo9kSl4LMzk p3VQ== X-Gm-Message-State: AOAM533txBJElSvIwz+FWk8lJqIpzFhkhHlvs0KN+ceSiGhq01PYnBpp KUPPcXJa6vV2t7LOWKOXgS8d3x3EQoHS7i5ibel4Uw== X-Google-Smtp-Source: ABdhPJyvrc2iIXbcC8YaiVkzYO41Psj9zevIrEPYYOmLf26TIPB4wujR7R6xkm6OJn238QJWJUKaISQGVYiRf4/ylng= 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 X-Mailman-Approved-At: Mon, 27 Sep 2021 14:02:49 -0400 Cc: Wanpeng Li , kvm list , David Hildenbrand , LKML , Paul Mackerras , Claudio Imbrenda , KVMARM , Janosch Frank , Marc Zyngier , Joerg Roedel , Huacai Chen , Aleksandar Markovic , Jon Cargille , KVMPPC , linux-arm-kernel@lists.infradead.org, Jim Mattson , Cornelia Huck , LinuxMIPS , Paolo Bonzini , Vitaly Kuznetsov X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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 > > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Matlack Date: Mon, 27 Sep 2021 16:58:51 +0000 Subject: Re: disabling halt polling broken? (was Re: [PATCH 00/14] KVM: Halt-polling fixes, cleanups and a ne Message-Id: List-Id: 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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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 > >