Received: by 10.213.65.68 with SMTP id h4csp1666727imn; Thu, 15 Mar 2018 06:21:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELvGBbs2dQbv7H+h1gCLaOe4xYb0HftaF6x/lNXSp3jncJs/FK4Xpknh83U59Zw2p6C2mPmM X-Received: by 10.101.100.144 with SMTP id e16mr6891312pgv.315.1521120082604; Thu, 15 Mar 2018 06:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521120082; cv=none; d=google.com; s=arc-20160816; b=k0jUEROHJf+dInVgU2xkbqMohD+AFxNBUGRQ9nFvHhBeECrhg/5v9Pem2xK4AgluTb +CXVb3rOIybbgLz+FCUSJYYf9NZAieU97n69LhxRD3Gu8UKA08RwOIYHCb26RM1I+p5u Ic76AEgFSKUanJcOfgwYVEoCsB3siHvc6uLb0lfh1/9qh3ppcVCNYuDBI/WE6FeTe9eI iRU2lwxRra5O8Fijo01pqAdou8wWkhPSapxsJa++X43WHn7DrFPgiSOX9aGSNtOl+Z+9 IshJBMi4ZQPp25RbFj2IppzE2tqvpef6IJuqwhGye0so4WQQFfmnbqVZMj8QOjoUUYlu iGqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=wF6NFEL8hJIEyUn8JG2RsxTiWBqKYmh10Jg3Fm8itko=; b=ZDUnY5spnkT4/Y8rNwkVr9RqRONJwaRGSM0XJj+BubEWA6L47XvAFhWAE5Fb7CWCvb NmUMaMPiwjCRnx1eN9bl0Bu+uWF084LK6IiyFb8i7Wy3uFDc7SshQTx5nBREW7XNXpqA 1MhniXwuZ/fHUyVJGDqQXzek0JzcD0WiP5Mjt5LZcMA290BiNZ8b2hWTnbt6ZXUDWBaW Tu2O5sqO8wuZxmk+WpG/RwbeOD9nbM3gLqh4+WmAY6IDHl4q329VLMgs24Q+LjFE0+SO bfGq/RPc+3wTUJMjlVeHpbMnJM5u6+CkIk0t3ojZUF5bMrx1VX+9dWxqp9tIp8GX6BXw BKaA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si3488125pgn.157.2018.03.15.06.21.07; Thu, 15 Mar 2018 06:21:22 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbeCONUB (ORCPT + 99 others); Thu, 15 Mar 2018 09:20:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56278 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751390AbeCONUA (ORCPT ); Thu, 15 Mar 2018 09:20:00 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A7E37DD0; Thu, 15 Mar 2018 13:19:59 +0000 (UTC) Date: Thu, 15 Mar 2018 14:19:59 +0100 From: Greg KH To: "Michael S. Tsirkin" 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: <20180315131959.GA28568@kroah.com> References: <20180301142215.11812-1-idgar@virtualoco.com> <20180313190617-mutt-send-email-mst@kernel.org> <20180314182536.GA14504@kroah.com> <20180314211704-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180314211704-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) 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 09:25:17PM +0200, Michael S. Tsirkin wrote: > 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 :) Does the hardware notify the kernel that it changes? Or does the kernel have to "poll" for it? > In particular, it changes whenever VM is migrated or snapshotted. So very rarely. And userspace always knows about those events already, right? > > > 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. "every"? That's horrid, why would you write a database that has to do an ACPI i/o call for every transaction? That's a sure way to write a very slow database :( > So I'm pretty sure it's a performance sensitive path. Given that this api is not present today, why is this even needed? Who wants/needs it so badly that it has to be tuned in ways like this? If it is _really_ performant critical, just make it a new syscall :) > But yes, I > didn't profile any apps since they > are yet to be written to use this interface. Then what database are you talking about? What apps need/want this thing? thanks, greg k-h