Received: by 10.213.65.68 with SMTP id h4csp1193681imn; Wed, 14 Mar 2018 12:26:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELs0IH0HQ7mAifvBYUphW/hvgUnoQjEkQ9c89STr9ZF6gRB8KFIso/6g7EWQS1S45JM6xDn4 X-Received: by 10.99.164.25 with SMTP id c25mr4664687pgf.235.1521055598628; Wed, 14 Mar 2018 12:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521055598; cv=none; d=google.com; s=arc-20160816; b=y/aruY5hDdlzhVySJZng7PzVg3wcS9hhPqgtqh8yxWgZpHb06q7na9xXGA24kVkiBr NkmKZu1Ws3GlFoa9lg5JEqvNXwfWIRzAZXTwLZfsOnjhUVWXPoQyZAuPPZWvPQblREQD U+1gSSg12s5JYr2F4vw7RWiFf+7xqC/pXEIeoNI09YqW06IZ+5AxqPwhwFX9U9zQJ3lF P932JwLM3LtRDfs9bV1QauydMZUlf+zlNQjGcDqG76MDjYGZS0GD+4o14U2vU3dc1HDe 0K42DZHel3pdb+FEmoU4X02WlDDGOjJRfO+5lG77GRlkvR/2Z+w0/Us2GZkT1NBwT3eY /CVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=Zqbrv/eOPzB+8WA5ovjMMBUzg2Q52Q0FQfTK3ZRLDm8=; b=W8QgFcJ1rDLaobjtBh3egVZASQg8WdKvgBrbTCb0oOFCOhj6To2snokdDRaLlHv7HM 1oS0qwxCUyC6hYYob9kKJWh+T10a2XrJAlwXWEeda9CmeUfBI7as8Xn7aMkcHVVydVpz snmVnQv35zbBo+ox4MpgsWvuye2xdT0eYDrozT4gbHsOG6Nd2yWNvjWL5PrFgc3gCG+k wnAyhjTrIx67MGmO/IWf7uyeRL6RXjjW6HB5P9cGp++ARwky6KoRHx8ZML5vBoTtkd0s L9J23onRtIdfsPpn/PP93p+J4Y+Wzg2nelqXxg/kbTLhhFonJdNMlb9mXU9+MRcT5G7y cvww== 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 f3-v6si1511248plm.433.2018.03.14.12.26.23; Wed, 14 Mar 2018 12:26:38 -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 S1751413AbeCNTZV (ORCPT + 99 others); Wed, 14 Mar 2018 15:25:21 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38822 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751000AbeCNTZU (ORCPT ); Wed, 14 Mar 2018 15:25:20 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 529FF406803F; Wed, 14 Mar 2018 19:25:20 +0000 (UTC) Received: from redhat.com (ovpn-125-227.rdu2.redhat.com [10.10.125.227]) by smtp.corp.redhat.com (Postfix) with SMTP id 87A7C6F9E3; Wed, 14 Mar 2018 19:25:17 +0000 (UTC) Date: Wed, 14 Mar 2018 21:25:17 +0200 From: "Michael S. Tsirkin" To: Greg KH Cc: Or Idgar , linux-kernel@vger.kernel.org, arnd@arndb.de, oidgar@redhat.com, ghammer@redhat.com, Or Idgar Subject: Re: [PATCH v5] drivers/misc: vm_gen_counter: initial driver implementation Message-ID: <20180314211704-mutt-send-email-mst@kernel.org> References: <20180301142215.11812-1-idgar@virtualoco.com> <20180313190617-mutt-send-email-mst@kernel.org> <20180314182536.GA14504@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180314182536.GA14504@kroah.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Mar 2018 19:25:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Mar 2018 19:25:20 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 14, 2018 at 07:25:36PM +0100, Greg KH wrote: > On Tue, Mar 13, 2018 at 07:40:51PM +0200, Michael S. Tsirkin wrote: > > I think it's a good idea to use sysfs for this. However, > > there are a couple of missing interfaces here: > > > > 1. Userspace needs a way to know when this value changes. > > I see no change notifications here and that does not seem right. > > How can these change? It's a hardware register. It changes when hardware feels like it :) In particular, it changes whenever VM is migrated or snapshotted. > > 2. Userspace needs to be able to read these without > > system calls. > > Ick, what? Why not? > > > Pls add mmap support to the raw format. > > For a single integer? Why do you need mmap for this? What is so > "performant" that needs to touch a sysfs file? > > (Phys address is not guaranteed to be page-aligned so you will > > probably want an offset attribute for that as well). > > Ick ick ick, that's why it's good to just stick with a sysfs file. > > Have you tested just how long this takes to see if the open/read/close > is really the bottleneck, or if the io on reading the value is the > bottleneck? > > thanks, > > greg k-h Well an application needs to check this value basically after every database transaction. So I'm pretty sure it's a performance sensitive path. But yes, I didn't profile any apps since they are yet to be written to use this interface. I'm fine deferring point 2 for now. -- MST