Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp185516imj; Thu, 14 Feb 2019 18:12:46 -0800 (PST) X-Google-Smtp-Source: AHgI3IYPw3/Inj/UKEHNp4VuVyijL9VFc/GxNLKanULhp10fiN34sj40ee+ek4pUUSmRO18LUloR X-Received: by 2002:a17:902:282a:: with SMTP id e39mr7641705plb.26.1550196766490; Thu, 14 Feb 2019 18:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550196766; cv=none; d=google.com; s=arc-20160816; b=uUh/AYLHBcwmQBE+Cl5VWVQhpY+xFEeHdqjcG8dNu0+PMD1doSdTXEEoI3ITiVnKr6 +1aBoMu2ORAOCbYfQBvSkn9so9jMSba5GacKPtnu+wSmV64AUGilHWE3PVsj+y/Lziq+ NL2qMkLrPZtkX/BoJrptyGdUthWYEe5/6eN2w6hgDYIoM4xJx1NFOh+Z52SKb9isQZ4G p5f8vvsgh7E8KJU3DX/kP2IRrkvtgZ+6U6ZEbmiz1EEoancPAxIm9CLp7PXrNdWHL9Rd ELf7+W7ncSPnWK9w0E0X0mpujsmhY+4AxsebpHwk7VA3bB4D36Vtd1+RgZZhZuAz5f5Y d+cA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=DRcmb7eavvaVqSXi/lEiGq5CIgT11mtyDTh1QEVcHHQ=; b=yCcq3W/tK3PyvIzFctEwgtDNuG1fyvSpiUEeA4FP0nEHoZ7vukopgoQM+eZeDP+Elu a1PcrfEAJsH/qHu+fWPmzmp50BVGjuvUc3fZ1GowFCC/GzVmYDmHs5H6/CdFuFIFJMae Xs/IrjQ07vx2PCqa/3z9B6k2pJmHSdUq0ucCkGtjb2ESg5GT5IAE1tpy4EZrfBk85kra PT87itt219MTqW1/37R7ncf8QgUFFUzzFe+qBq/Ow3fdkauoS0O4/fm9mpKiMlCgDOqH CifjOhkHDpUf8dij7LSA4oAZ8jNq9gI/tGDyRiyxdEddMoYBu9TgJEa1czCvBDjiu3h3 wXhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=VykqiQNx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si3984388plk.278.2019.02.14.18.12.31; Thu, 14 Feb 2019 18:12:46 -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=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=VykqiQNx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439877AbfBNTuY (ORCPT + 99 others); Thu, 14 Feb 2019 14:50:24 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36018 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728119AbfBNTuY (ORCPT ); Thu, 14 Feb 2019 14:50:24 -0500 Received: by mail-pf1-f194.google.com with SMTP id n22so3621867pfa.3 for ; Thu, 14 Feb 2019 11:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DRcmb7eavvaVqSXi/lEiGq5CIgT11mtyDTh1QEVcHHQ=; b=VykqiQNxuRGS97c+HvlKah4Zm7eRgRhjVcG9SD+h0A4hMzVOlsUxAI2XnN6J56/pao 07nIPAH+7fq4K4tL51zh6rAiD5Xg0Ye3ux9KmbffV4U+WWy0ZYTNeKsNTVwh3v2PhjTA rGzhBD1s6jwzDh5sOIaxeqiw0ggie9uO4WnXo1BxgAkJWTzZibrHqYV3DhkuKSEU2pzU FVdK4Ptsd5XDCQf+yJ8UF0eRL6F/KouYCzpBix3T61oppqB1JtYIYCYvfeBloynQeM8C lAvqri+XXekCVCLUPZFMYFx1Fh7QJnOUcVLQrSyvgms96Np4Xuq/KGasC9FOyss/BB5A F0Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DRcmb7eavvaVqSXi/lEiGq5CIgT11mtyDTh1QEVcHHQ=; b=o/CDp+svxm1ZlAMhLOXjyj0pLkfXkMtouZB1kGP4Q/bSlz6TgCWaO8susoPtNK3Xos JaYsJPhI0aUZKArHymtNsHv6s1h7qMeCKaEhgjlYfMnkpm2J3UMQ9TKEQEKOUQZ7d3Nx Le6Am+5AGKn0UlVO0mPxDIwfsJ5riV6QysJwNlGJh6CBnpiEO5EbzrqFS6To2t+3fX+V u2KvCEBLWWjygzQ10u0MO5GDo7z9qCwv/3OaVmPqpp0Q7ykk8spffDti0lmDsxqm60Nz ySFA1qGWK+JxBjBm3ebks1H8DFUdaD833Zem3SUYVN4xvgYGa8EPMrpDqZtbaxH5M/TE 7Few== X-Gm-Message-State: AHQUAubV6haG68U10uvNyksJdeRUsZfe11Shg2/+znZmpvGSePJ+cQ5P V+wXuV6k6AmKzN5kzIknezwQjA== X-Received: by 2002:a65:40c5:: with SMTP id u5mr1517416pgp.46.1550173823002; Thu, 14 Feb 2019 11:50:23 -0800 (PST) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id e24sm4320839pfi.153.2019.02.14.11.50.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Feb 2019 11:50:22 -0800 (PST) Date: Thu, 14 Feb 2019 11:50:19 -0800 From: Stephen Hemminger To: Kimberly Brown Cc: Michael Kelley , Long Li , Sasha Levin , Dexuan Cui , devel@linuxdriverproject.org, Haiyang Zhang , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] Drivers: hv: vmbus: Display nothing in sysfs if monitor_allocated not set Message-ID: <20190214115019.0e914fa5@shemminger-XPS-13-9360> In-Reply-To: <20190214061102.GA22473@ubu-Virtual-Machine> References: <52d58fe5805f2ba2405c9091b4c86033d434d2b9.1549619051.git.kimbrownkd@gmail.com> <20190208143148.052c8d9c@hermes.lan> <20190211070118.GA2977@ubu-Virtual-Machine> <20190211100247.12221570@hermes.lan> <20190214061102.GA22473@ubu-Virtual-Machine> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Feb 2019 01:11:03 -0500 Kimberly Brown wrote: > On Mon, Feb 11, 2019 at 10:02:47AM -0800, Stephen Hemminger wrote: > > On Mon, 11 Feb 2019 02:01:18 -0500 > > Kimberly Brown wrote: > > > > > On Fri, Feb 08, 2019 at 02:32:09PM -0800, Stephen Hemminger wrote: > > > > On Fri, 8 Feb 2019 05:01:12 -0500 > > > > Kimberly Brown wrote: > > > > > > > > You are right, the current behavior is broken. > > > > It would be good to add a description of under what conditions > > > > monitor is not used. Is this some part of a project emulating > > > > Hyper-V? > > > > > > > > > > I'm not sure which conditions determine whether the monitor mechanism is > > > used. I've searched the Hypervisor TLFS, and I couldn't find any > > > information. If you have any suggestions for where I can find this > > > information, please let me know. > > > > The monitor page stuff pre-dates my involvement with Hyper-V. KY might know. > > But based on comments it looks like it was added to avoid hypercalls > > for each message. It probably showed up in Windows Server 2012 timeframe. > > > > To test you might want to dig up Windows Server 2008. > > > > It looks like the monitor mechanism has always been used. It's present in the > earliest commit that I can find: 3e7ee4902fe6 ("add the Hyper-V virtual bus") > from 2009. > > I propose that the following sentences be added to the sysfs documentation for > the affected attributes: > > "The monitor page mechanism is used for performance critical channels (storage, > network, etc.). Channels that do not use the monitor page mechanism will return > EINVAL." > > I think that this provides sufficient information for a user to understand why > opening an affected file can return EINVAL. What do you think? Thanks for following up. I agree with you EINVAL works as a solution. My understanding is that their are two ways a channel can work. The first one is for the guest to send a hyper call to the host to indicate when data is available. The other is for the guest to indicate by setting a bit in shared memory with host. The shared memory approach reduces host/guest overhead and allows for more opportunities for batching in the ring. The host checks the shared memory on a polling interval defined in the latency field. The hypercall method does not use the monitor page. It has lower latency (no polling).