Received: by 10.223.164.202 with SMTP id h10csp909327wrb; Fri, 17 Nov 2017 10:36:02 -0800 (PST) X-Google-Smtp-Source: AGs4zMY6O888vIMEQsx0wBkalrxMk/s3AGqcprfy3aSsi0jkNY8FQgfrqQSSsKgbPmwFCaeAFRrs X-Received: by 10.101.82.76 with SMTP id q12mr5948531pgp.140.1510943762294; Fri, 17 Nov 2017 10:36:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510943762; cv=none; d=google.com; s=arc-20160816; b=ZDswhREscvvH7jSxyrKWO4eVr9r2tuwxhzh5eK4rc3hgc85V+LV3bhgOzj8jxg3ZYb vL8LKa+/aOQrhl2DdKA7E/926e8FKlrYfVkzoeDKY24k5Sn1vnLhixovY738tSMjTSw9 BEv0wtCLs7oL+JXHbvARz8vb+m5FOvHVl6z9zVefrviycIMEN8yJQmKXJRGQqiPZEOf9 j1EEYzZmBG8+GUIKKuBOS8nI5LHuXPmd+k/W1OB2gdICGJwd9UsY/vv3LFLIFemXI94k h+uJHmqnRraFpLoR4TxqpjeqpE7icg37/2bzkuG9YQnL30PgJ5BKj80bHE9z15NleEe4 6zzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=8rih94yW9xqUQ2KDtFNIE0UNloujqYBeacEFWm70uFE=; b=omUQ1qPO85PW+eYhP2hbtRgy3+FHj8KkKFUjoa1ZUjhO58dEXxr8y9YMpyx3MUouwS IcW4HAot7QlFsdueTRGf/AahkOCpPR85IvJuMzS+xFnwyTHEr9vPQSm61ranK18A4hak zPsR0f++kiwLf6kUqF2q/EeLn9XymldSbwRLZNk0yPuoRa4Y1B/4uiWjJ5sYNzh5AiO7 iRc8uMPxzvuGxhvjcw8tBpIS05VwYQSf3u3QXm9ArscTIg1GDE4/B338RbRBEKw1SKye Vsf/hyEFBzss/DREOMM/+Hs2ThbOnithsjdTn5C4wZesQ4k0sPvBGFH2xPLG68im4OL7 efXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T6gmxklE; 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 w33si3187906plb.89.2017.11.17.10.35.49; Fri, 17 Nov 2017 10:36:02 -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=T6gmxklE; 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 S932836AbdKQMWL (ORCPT + 93 others); Fri, 17 Nov 2017 07:22:11 -0500 Received: from mail-oi0-f67.google.com ([209.85.218.67]:41518 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932122AbdKQMVy (ORCPT ); Fri, 17 Nov 2017 07:21:54 -0500 Received: by mail-oi0-f67.google.com with SMTP id h81so1499660oib.8; Fri, 17 Nov 2017 04:21:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=8rih94yW9xqUQ2KDtFNIE0UNloujqYBeacEFWm70uFE=; b=T6gmxklEycZm8TzAQ+4Qk2PuBhi8AuLyDDyvGrml7Vd+gwTGt69zQsCxynzMt0BHOz iaEoTrFKcpjHoaXUK/+lRjdx/ZcdGLc0k1+/cXAvS/UCwY5geO7DNNhDD+Z+rYMfB9cq 9RRSvdmYvIESj0E1q3R3axfPoazl38G4Kpj3FKHTP+frrWMt+YQag9VahdSXG2lyCmXJ lW7z/Edn4UBm5G7QwGPy8mccnYS3wmKDQTeshSryteM49xGXarCc4HyIZ73cxkRfRzCT AD8Cf52YE2OR3iSIuqaabwWnjDlnVSuXeGQEhLllQxIff4jGr1isssyEXq7W1gJq6ABN XmHA== 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:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=8rih94yW9xqUQ2KDtFNIE0UNloujqYBeacEFWm70uFE=; b=cfKX0yCMrq19g/SMQsxVyTuiL7Ct/VbC7fYdrl74YikLwoUwXsz7IRZ7FO0HAvFed5 v6iSigudaq92/VgWLNJQpSvgr9g7Hohe+Vx2DAps7b6VRYc+3AS+KOZ/ZD4n9ZSwawsx fst11/bomMFOLK1Hp8E2P9W3Vqi38s0VqC9bmTmZH59cVv3rGDGxgOggyji0h5JzACQg nDdblAoyoYX8i8nZ5qv0n2kdSNPPhYHFYYCb+jZGjyjWh+oNCT577Vc6PrzkPyUUq7aq bmwUh4v9VsJguiaocf0xRogLLsLba/r3SWDsbzMYnvKDi9HdGsoMC1+Et70DNzE6SBlL x25g== X-Gm-Message-State: AJaThX72xaz1zoZY1V7iVo5fR/tiQimaQRgru7EzVk/ugpwS2CBcypfo q1pVfFziy18M2afXSWYBjiU= X-Received: by 10.202.117.13 with SMTP id q13mr1033985oic.52.1510921314174; Fri, 17 Nov 2017 04:21:54 -0800 (PST) Received: from [0.0.0.0] ([47.89.242.186]) by smtp.gmail.com with ESMTPSA id m53sm1599356otb.47.2017.11.17.04.21.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 04:21:53 -0800 (PST) Subject: Re: [PATCH RFC v3 3/6] sched/idle: Add a generic poll before enter real idle path To: Thomas Gleixner Cc: Peter Zijlstra , Quan Xu , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, LKML , virtualization@lists.linux-foundation.org, x86@kernel.org, xen-devel@lists.xenproject.org, Yang Zhang , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Kyle Huey , Len Brown , Andy Lutomirski , Tom Lendacky , Tobias Klauser , Daniel Lezcano References: <1510567565-5118-1-git-send-email-quan.xu0@gmail.com> <1510567565-5118-4-git-send-email-quan.xu0@gmail.com> <20171115121152.gqug5wzerlo3eimd@hirez.programming.kicks-ass.net> <46086489-5a01-16e1-9314-70ae53c01952@gmail.com> <564b8a6e-8ddd-4e3d-c670-10f1697e6c06@gmail.com> From: Quan Xu Message-ID: Date: Fri, 17 Nov 2017 20:21:42 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-11-17 19:36, Thomas Gleixner wrote: > On Fri, 17 Nov 2017, Quan Xu wrote: >> On 2017-11-16 17:53, Thomas Gleixner wrote: >>> That's just plain wrong. We don't want to see any of this PARAVIRT crap in >>> anything outside the architecture/hypervisor interfacing code which really >>> needs it. >>> >>> The problem can and must be solved at the generic level in the first place >>> to gather the data which can be used to make such decisions. >>> >>> How that information is used might be either completely generic or requires >>> system specific variants. But as long as we don't have any information at >>> all we cannot discuss that. >>> >>> Please sit down and write up which data needs to be considered to make >>> decisions about probabilistic polling. Then we need to compare and contrast >>> that with the data which is necessary to make power/idle state decisions. >>> >>> I would be very surprised if this data would not overlap by at least 90%. >>> >> 1. which data needs to considerd to make decisions about probabilistic polling >> >> I really need to write up which data needs to considerd to make >> decisions about probabilistic polling. At last several months, >> I always focused on the data _from idle to reschedule_, then to bypass >> the idle loops. unfortunately, this makes me touch scheduler/idle/nohz >> code inevitably. >> >> with tglx's suggestion, the data which is necessary to make power/idle >> state decisions, is the last idle state's residency time. IIUC this data >> is duration from idle to wakeup, which maybe by reschedule irq or other irq. > That's part of the picture, but not complete. tglx, could you share more? I am very curious about it.. >> I also test that the reschedule irq overlap by more than 90% (trace the >> need_resched status after cpuidle_idle_call), when I run ctxsw/netperf for >> one minute. >> >> as the overlap, I think I can input the last idle state's residency time >> to make decisions about probabilistic polling, as @dev->last_residency does. >> it is much easier to get data. > That's only true for your particular use case. > >> 2. do a HV specific idle driver (function) >> >> so far, power management is not exposed to guest.. idle is simple for KVM >> guest, >> calling "sti" / "hlt"(cpuidle_idle_call() --> default_idle_call()).. >> thanks Xen guys, who has implemented the paravirt framework. I can implement >> it >> as easy as following: >> >> ������������ --- a/arch/x86/kernel/kvm.c > Your email client is using a very strange formatting. my bad, I insert space to highlight these code. > This is definitely better than what you proposed so far and implementing it > as a prove of concept seems to be worthwhile. > > But I doubt that this is the final solution. It's not generic and not > necessarily suitable for all use case scenarios. > > yes, I am exhausted :):) could you tell me the gap to be generic and necessarily suitable for all use case scenarios? as lack of irq/idle predictors? �I really want to upstream it for all of public cloud users/providers.. as kvm host has a similar one, is it possible to upstream with following conditions? : ��� 1). add a QEMU configuration, whether enable or not, by default disable. ��� 2). add some "TODO" comments near the code. ��� 3). ... anyway, thanks for your help.. Quan �Alibaba Cloud From 1584339292992972625@xxx Fri Nov 17 18:34:52 +0000 2017 X-GM-THRID: 1584141070007959176 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread