Received: by 10.213.65.68 with SMTP id h4csp570802imn; Sun, 25 Mar 2018 07:15:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELuUOWS7mUNW5GFZT6slDHhMLtdJzTEbxfMtN8MJ8jH+WCX+56/6YTRZ5nERSsbKuSuVxo7a X-Received: by 10.99.127.9 with SMTP id a9mr7655261pgd.168.1521987358284; Sun, 25 Mar 2018 07:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521987358; cv=none; d=google.com; s=arc-20160816; b=mqQUyTtsFEfyu407db004sMDtqZUaA9Z4Vjp/ljpPqQANI9S4MRm9cuJND3jwwHk4m 4159wVqLWEuxcQOrBwrBTI9TyAgbRwKsJG5C8823jwY7+ae5s/9jVG0ZBEAlv4a7wcY9 ZAP85urSA2iB+IIvCPEP/HKWLRTB39eQg/tii9rHw1UcuDkW7APNiL1vbFkjYegcq2h/ WssbKqvSxdyUcnW0qztHXWKkPkWovn1j+vG/UQtw2jVExeecz5uEZxcHY8rWQmGE+dE6 TWs5HW2sHPoYDuuEEcpUq5QVymRgoX/+lrHlVN3QEq5xGwTVhbbVotAyZzfz6xy2dAtx bGEg== 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=Q7V7U37lP3bqEsdSf9Rm8/ze+SfyuFVDo2nqWzSoKis=; b=jBaZyevMQiNrrc/Y3rQqKF4UsykM1bKQnQ/XRlCkJFOEUk+jUC4PHugt5zouiX0gw5 oaUQRaFtCJvoaXZ4t6OSQqWEFkOjJkBmFcNsV2MzFwKjcdgD2/UL+KLTAe++BNpzTns7 ARSy2FqlzZsAX1Bi1a0zI5CRJk/No48Er0VSkc+EzKZdkfQ1orZzvTLDTMx/JWFe1j7O +sVqRYhk8wN19zL3S7Eg4KQStqq8I7b8AcB5LuFLFzlovT5gF09vP0jXWMmDg0BfjrLf t+MKuNXGYI4HDgzK9bGkDjyi/44rMRlzCbDVE/wynZ7e2E/Y+ZQpe1a4PlufBzt34S9q 9nSw== 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 92-v6si12941038pli.623.2018.03.25.07.15.42; Sun, 25 Mar 2018 07:15:58 -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 S1753381AbeCYONf (ORCPT + 99 others); Sun, 25 Mar 2018 10:13:35 -0400 Received: from mail.skyhub.de ([5.9.137.197]:38502 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753229AbeCYONe (ORCPT ); Sun, 25 Mar 2018 10:13:34 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id b9KfN42uZbQR; Sun, 25 Mar 2018 16:13:17 +0200 (CEST) Received: from pd.tnic (p200300EC2BE34600791E0C6965666DA9.dip0.t-ipconnect.de [IPv6:2003:ec:2be3:4600:791e:c69:6566:6da9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 6674B1EC00EE; Sun, 25 Mar 2018 16:13:17 +0200 (CEST) Date: Sun, 25 Mar 2018 16:12:42 +0200 From: Borislav Petkov To: Eric Dumazet Cc: Ingo Molnar , Eric Dumazet , x86 , lkml , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Hugh Dickins , Peter Zijlstra Subject: Re: [PATCH v3 1/2] x86, msr: allow rdmsr_safe_on_cpu() to schedule Message-ID: <20180325141242.GC21878@pd.tnic> References: <20180323215818.127774-1-edumazet@google.com> <20180324080946.3db4xdkl5i6jx2rc@gmail.com> <336355a3-c11d-44fc-0642-671670980ac0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <336355a3-c11d-44fc-0642-671670980ac0@gmail.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 24, 2018 at 07:29:48AM -0700, Eric Dumazet wrote: > It is named gsysd, "Google System Tool", a daemon+cli that is run > on all machines in production to provide a generic interface > for interacting with the system hardware. So I'm wondering if poking at the hardware like that is a really optimal design. Maybe it would be cleaner if the OS would provide properly abstracted sysfs interfaces instead of raw MSRs. For a couple of reasons: * different vendors have different MSR ranges giving the same info so instead of differentiating that in your daemon, we can do that nicely in the kernel. * exposing raw MSRs instead of having clearly defined sysfs files is always a pain when a new CPU decides to change those MSRs. Hiding that change in the OS is always easier. * periodically polling MSRs which don't change that often is, of course, wasting power and so reading a cached result is leaner. * In general, we should've never have had exposed that raw MSR access but it is too late now - that ship has sailed. We can still try to design new interfaces more cleanly, though. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.