Received: by 10.223.164.202 with SMTP id h10csp86745wrb; Mon, 13 Nov 2017 03:10:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMYQydw8ptZ6DTUc3Y4LevR5agsCw6lTLmvzexj7lFA6HpN5aA0YA/baEmiuMshLs7xF48NF X-Received: by 10.101.91.137 with SMTP id i9mr2952470pgr.313.1510571403184; Mon, 13 Nov 2017 03:10:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510571403; cv=none; d=google.com; s=arc-20160816; b=TI52Y2TKkD2aiALBYIUTIiBj9zvEAxW328043jdkzMQr5hKKWK8VZugYGadc8TutZG cgwScwW3xqOUDougwJr7Aje3BGFXU+qG0sMYRmmWnI/kX1x03HBymk4gdLKsw2k4z+2b eUnHp0VidaOE1cjr/robIn2XnvlPN2IuMrhTmU7AsPx4oW123TEIYseEM5tolt7tx6s/ BjJtUBM5pAmnOZdu8X40Xu+pUhK6gVVkuXxgZfOaQfAqezpQ/FrkHFg07oGBwdW4s8QL aq4BAbUr8MGib1WampqrKjOBP47GL1aE/Tf5MrCkx0oj/ZfvFRl1YMTNZXCjNOOMCebl cUKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Vh/99tHgL5oX5jRNfWspIV2TC4OD0JXunGtKXtdOIo4=; b=GMyxHHl7ugFJuBJd12YmEBD7KOJ1PC5dw+IyC2EDNAjUvwVmiRSIFvjxfvlfW8tLa9 4VUYOKKI9t12DbX5vhfTjZNA/X7FtuOIBQd5MQC9NtSxKUdWczcTmWvYvyF0Z8SK2B/8 pLu27+NXnQeE7tGa2InRcvwfx8WvzHtJ/8Fi6qqJCZwFqYeLckd6/MGR9mbfyLRwm3TV tS7/TVIkdTWRj7tDJKEPyrbx40ntBHMjmaa/ISmnAOQAVr159hFN/ZE9tsqXTqbdagoo ULMBpV4w2K5SZ1N9TBDgGcJQr42vXO9zGs/MlCJjCCNT2gbmaWIhy2s0umLAtcGoXZBZ uAVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sWQjddwW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si13500995pgf.680.2017.11.13.03.09.49; Mon, 13 Nov 2017 03:10:03 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sWQjddwW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752366AbdKMLJM (ORCPT + 95 others); Mon, 13 Nov 2017 06:09:12 -0500 Received: from mail-ot0-f193.google.com ([74.125.82.193]:49026 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbdKMLJK (ORCPT ); Mon, 13 Nov 2017 06:09:10 -0500 Received: by mail-ot0-f193.google.com with SMTP id b49so9936292otj.5; Mon, 13 Nov 2017 03:09:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Vh/99tHgL5oX5jRNfWspIV2TC4OD0JXunGtKXtdOIo4=; b=sWQjddwWVcbry40cKT5LwlRxadEMcGgtTXyTtUWfqcGJwH/MQqhv28IXH9lYZcb2Pw c30ZqaCR1Yin9KckJSQjbn9E+BR/Txq3LIEvKY9NriDRaCetBKUnYjqHag1t59yKxwB8 FhYxROMQc4cK8afYe7wR+4fgrAKuSU1aR1uOpkWq0ziVFqxfGABywoq80IPUFY/VHpFS 6gcaEUxBYLFT7L6Lzr/EeOxx/WLmxIstHnZZwwm8wQ730a3FW68prqFLSc7Ksijlivqo eG5SzO6v4iClP7K4eSLtc+bnvTZW6zTzvel+NIY6hugdjGF4dHhroq42pWqT+SlV+F6U AE1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Vh/99tHgL5oX5jRNfWspIV2TC4OD0JXunGtKXtdOIo4=; b=r0WctT16Pv1PHws2k7cmu92ZsIUE0LYfgZUSKjXr8/84Iv3aUNj+XseOwc/rSEzUcd zqPdQG8iiZUoKlnIvdoRQiJ65v1FqNBwzLyVYfMKFepwiuXgOyrzqaA/W+yH5PGMlzpI G2dUKDe+Af69dVPECLLazI9Um1RLYWRvERar50s617+mcV/GAUmudbQnTrgOX9RF/bSw Fsdq9k4JX7TRJWyA8dyOSayGe7VRUPrQ1kdu4JMjLdD8F8SkIDQvzBvpnbHUX0t6elCo L9ert7U0vBwHv5R+ZfP580/bTHv3HOrRE7MFCPjGGrCAI8q9jg5FOvsGNbVCHRiJrDbb h3nw== X-Gm-Message-State: AJaThX605b8reehAtOy6ApzemvNXEV5HhewuoFCRkPpvbXWq7GB1m4ML jyBTqFWJd/rqSujvkr8v+Ea1ZnXCWMjtCCxcfbg= X-Received: by 10.157.52.239 with SMTP id t44mr1785917otd.435.1510571349777; Mon, 13 Nov 2017 03:09:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.74.53.27 with HTTP; Mon, 13 Nov 2017 03:09:09 -0800 (PST) In-Reply-To: <07fac696-e3d4-8f35-8f3d-764d7ab41204@suse.com> References: <1510567565-5118-1-git-send-email-quan.xu0@gmail.com> <1510567565-5118-2-git-send-email-quan.xu0@gmail.com> <07fac696-e3d4-8f35-8f3d-764d7ab41204@suse.com> From: Wanpeng Li Date: Mon, 13 Nov 2017 19:09:09 +0800 Message-ID: Subject: Re: [PATCH RFC v3 1/6] x86/paravirt: Add pv_idle_ops to paravirt ops To: Juergen Gross Cc: Quan Xu , kvm , linux-doc@vger.kernel.org, "open list:FILESYSTEMS (VFS and infrastructure)" , "linux-kernel@vger.kernel.org" , virtualization@lists.linux-foundation.org, "the arch/x86 maintainers" , xen-devel , Quan Xu , Yang Zhang , Alok Kataria , Rusty Russell , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-13 18:53 GMT+08:00 Juergen Gross : > On 13/11/17 11:06, Quan Xu wrote: >> From: Quan Xu >> >> So far, pv_idle_ops.poll is the only ops for pv_idle. .poll is called >> in idle path which will poll for a while before we enter the real idle >> state. >> >> In virtualization, idle path includes several heavy operations >> includes timer access(LAPIC timer or TSC deadline timer) which will >> hurt performance especially for latency intensive workload like message >> passing task. The cost is mainly from the vmexit which is a hardware >> context switch between virtual machine and hypervisor. Our solution is >> to poll for a while and do not enter real idle path if we can get the >> schedule event during polling. >> >> Poll may cause the CPU waste so we adopt a smart polling mechanism to >> reduce the useless poll. >> >> Signed-off-by: Yang Zhang >> Signed-off-by: Quan Xu >> Cc: Juergen Gross >> Cc: Alok Kataria >> Cc: Rusty Russell >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: "H. Peter Anvin" >> Cc: x86@kernel.org >> Cc: virtualization@lists.linux-foundation.org >> Cc: linux-kernel@vger.kernel.org >> Cc: xen-devel@lists.xenproject.org > > Hmm, is the idle entry path really so critical to performance that a new > pvops function is necessary? Wouldn't a function pointer, maybe guarded > by a static key, be enough? A further advantage would be that this would > work on other architectures, too. There is a "Adaptive halt-polling" which are merged to upstream more than two years ago avoids to thread the critical path and has already been ported to other architectures. https://lkml.org/lkml/2015/9/3/615 Regards, Wanpeng Li From 1583947963447418004@xxx Mon Nov 13 10:54:51 +0000 2017 X-GM-THRID: 1583947963447418004 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread