Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp697085ybl; Tue, 13 Aug 2019 00:56:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqziy25FmSu9FKUUXZg0JNF2IUgptmWTMN6wsYZQ/0CVMzc61g6t37CGbYScEYNDh+M/KAeM X-Received: by 2002:a62:e515:: with SMTP id n21mr40100200pff.186.1565682995128; Tue, 13 Aug 2019 00:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565682995; cv=none; d=google.com; s=arc-20160816; b=eBsQuKhFFeIKNmUMQoePeXdt8edoGjq7hHtKJUN9DoJ5T7G0t4ggIwtxSIhoM8G871 KAUxs0lyVbDQVAlRLgA+1F/ARivEbyMBEDNvUw/t5Q0xU3IsmFZxaLD0ITAXZcWD7Lxh kcPa7WfarxCp28YGcZICGMUj9GZFZ3iue5yNgLG+zu0U6vCNI4GME+rENEURkS0LUFAw XDNok2SDeanlLpy/5+zw/H+T7TLhckknDxRhuIJ+CuMj2LtI+c9GbGr0WSM0e2IC9YLJ tGobvl8epLlOjX4OiUFjPQFde37Nv5DbL/HId9TY8UtLn51hcUWtYYtD92G+8lWbEuZJ D2Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=bVL/mybMCWMTdXy3Ie2SVHe4c9Hx4KouLy8pC3F5wcA=; b=Ymvi3iBhp/bG8uwiRHnSWuRE/hm9R5U4oVOgInwohlcYPsi93tfFEwRax83q+CVb06 5MuWM7UaNG05wLKL6G259h7CFmrJ2AD1WyWe6MAAjWjdi4PPtBZMs+NmZsdE7Ip747XX QBWKvcA73nEhEEH/CYZEb6SDKmW3895+oWx3gt/637Y7pz03W3eOgrp6F0INQVRjEgnK Qsghfr7tg3GWAPZsL/n3XjjLklP+FP38bwP9I42XEj15syBUk7DzMhjs6wHiDwIvllhU in7L3tLJ7Ndr9226UzW5p0ICL6nrmxcxVoZs4LFO5gR9fxRsPUOizH6s1h6G3xE7vhwX vT8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18si471598pjq.71.2019.08.13.00.56.19; Tue, 13 Aug 2019 00:56:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727791AbfHMHzW (ORCPT + 99 others); Tue, 13 Aug 2019 03:55:22 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44610 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbfHMHzW (ORCPT ); Tue, 13 Aug 2019 03:55:22 -0400 Received: by mail-wr1-f68.google.com with SMTP id p17so106827365wrf.11 for ; Tue, 13 Aug 2019 00:55:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bVL/mybMCWMTdXy3Ie2SVHe4c9Hx4KouLy8pC3F5wcA=; b=hAK7zL821iynuQSb+lAa+e2pDafH8gUxec4qgsp1sVfvHM57dWwOjMG8PFr+GynIdR NRPZs5NKk7nVwsdM+/3IeDKDJbDmW9iYG0W9iaUIfYl2LCCy5MXLvxaD8lbr8gZKEkot CXeNPWmui6S8sYuyd0QmWV4dETeXKsVXdXx9azYngksUHC0Uzx4lnO3AXQJ2ONdh1iHV eXInucOpfqArHdiZoqAfsEfdVbi1k7pBmbllE1bAyScFC3rnF0GA+Vq07JQU8iGid8jr X9mYOF45EFJKN/MvFQb96pMdqjyyNPtpqeNkPGV+hNCDVHIwiITEzWmaldI9neyIlOCh vu8g== X-Gm-Message-State: APjAAAUB31NJoIheabOK7AC098RjtGS5pYNHLrDkvgYCsr/OnSeYKK+O WTC3pYZSyOsAH9iadD7Cgl3lUw== X-Received: by 2002:a5d:62c1:: with SMTP id o1mr44926663wrv.293.1565682920051; Tue, 13 Aug 2019 00:55:20 -0700 (PDT) Received: from [192.168.10.150] ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id c11sm2771923wrs.86.2019.08.13.00.55.18 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 13 Aug 2019 00:55:19 -0700 (PDT) Subject: Re: [PATCH] cpuidle-haltpoll: Enable kvm guest polling when dedicated physical CPUs are available To: Wanpeng Li , Marcelo Tosatti Cc: "Rafael J. Wysocki" , LKML , kvm , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Linux PM References: <1564643196-7797-1-git-send-email-wanpengli@tencent.com> <7b1e3025-f513-7068-32ac-4830d67b65ac@intel.com> <20190803202058.GA9316@amt.cnet> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: Date: Tue, 13 Aug 2019 09:55:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/08/19 02:55, Wanpeng Li wrote: >> I think KVM_HINTS_REALTIME is being abused somewhat. >> It has no clear meaning and used in different locations >> for different purposes. > > Now it disables pv queued spinlock, pv tlb shootdown, pv sched yield > which are not expected present in vCPUs are never preempted for an > unlimited time scenario. Guest side polling definitely matches the purpose of KVM_HINTS_REALTIME. While host-side polling is conditional on single_task_running, this is obviously not true of guest-side polling. The alternative would be to enable it only if KVM_FEATURE_POLL_CONTROL is available, but I prefer Wanpeng's patch. Paolo >> For example, i think that using pv queued spinlocks and >> haltpoll is a desired scenario, which the patch below disallows. > > So even if dedicated pCPU is available, pv queued spinlocks should > still be chose if something like vhost-kthreads are used instead of > DPDK/vhost-user. kvm adaptive halt-polling will compete with > vhost-kthreads, however, poll in guest unaware other runnable tasks in > the host which will defeat vhost-kthreads. > > Regards, > Wanpeng Li >