From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F3DFC48BE5 for ; Tue, 15 Jun 2021 07:06:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73248613BF for ; Tue, 15 Jun 2021 07:06:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229960AbhFOHIy (ORCPT ); Tue, 15 Jun 2021 03:08:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58103 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230236AbhFOHIx (ORCPT ); Tue, 15 Jun 2021 03:08:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623740809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1bptQkqZVqAajaLHu25xIp56mYAPhq5K+DznNXOGR0E=; b=ih96Qtb+AugWtRO4zjNU0hlO0tGSglXwuR1o6G2h/++c+KLXiodeJ2qfomtOc/fKAqWgHl Vkjc8gMaggYDZv1q2aHNPa5RQs5se8q6vW8dGMdEt8UscyCLg0k6RgAuxAf7yRIdw35csR Bacjc9b6YQT8TPpEAPyB7Ewrb7XFN4k= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-474-CdFP4crWN0G10p0fNs4I3Q-1; Tue, 15 Jun 2021 03:06:48 -0400 X-MC-Unique: CdFP4crWN0G10p0fNs4I3Q-1 Received: by mail-ed1-f72.google.com with SMTP id q7-20020aa7cc070000b029038f59dab1c5so21732678edt.23 for ; Tue, 15 Jun 2021 00:06:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1bptQkqZVqAajaLHu25xIp56mYAPhq5K+DznNXOGR0E=; b=rvB7P7dmTG31uRblPowWSPe8f5OdJDu671lytalPZ8PcxuTjBdyiS6IXJCZsxS6Kr9 ay4TOiKOW2YprlCS5mQ5G5KIJc0+w/gHQu23qp4oBbFSltWFx53Hzni+tBAQXrWftY03 +Mw6lyCBWCtEyijJ4u92g9yTPUFyWYm/TzomkzkFKsR3Y1UOeSUiLHKVnFIe2ANGBc2C WQIbvJr1XOhN57C/52AGpMaJFf2qz+6YI+KFyeVLQ0y+dhfBpjv16OfSKpa+yaLkIos3 +uTUQQEd1Ya7b/K6vQ8TgTXrKkFfQWzuavr/Q0+rrdhKdfBv2OcExfdFTFlthiGaxllK UMEQ== X-Gm-Message-State: AOAM530dLTqKxhqEfGzP3QdR1nvU5W+EEHmt5BtURNMsv5TWEkAFBTkN G+l0gdoMFbNsbHBvPQNYkQlDlxLjDRbUI7xyAOOgduw2k+Z4imSU8PPDaeXNV+fue4fz7ix0Ay5 MZlxZmK0G7dfX99i5QOZsEQ== X-Received: by 2002:a05:6402:1e8b:: with SMTP id f11mr21756483edf.86.1623740807165; Tue, 15 Jun 2021 00:06:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjr2XSQSGkPxI3dJja1mbqx7MqydkJIqxXPBC64kHnxRq+99yMj0rlssdO/n6Q7TVjtTbx4g== X-Received: by 2002:a05:6402:1e8b:: with SMTP id f11mr21756454edf.86.1623740806968; Tue, 15 Jun 2021 00:06:46 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id d4sm9179485ejo.98.2021.06.15.00.06.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Jun 2021 00:06:46 -0700 (PDT) To: Leon Romanovsky , Jing Zhang Cc: KVM , KVMARM , LinuxMIPS , KVMPPC , LinuxS390 , Linuxkselftest , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Will Deacon , Huacai Chen , Aleksandar Markovic , Thomas Bogendoerfer , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Peter Shier , Oliver Upton , David Rientjes , Emanuele Giuseppe Esposito , David Matlack , Ricardo Koller , Krish Sadhukhan , Fuad Tabba References: <20210614212155.1670777-1-jingzhangos@google.com> From: Paolo Bonzini Subject: Re: [PATCH v9 0/5] KVM statistics data fd-based binary interface Message-ID: <15875c41-e1e7-3bf2-a85c-21384684d279@redhat.com> Date: Tue, 15 Jun 2021 09:06:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On 15/06/21 07:25, Leon Romanovsky wrote: > Sorry for my naive questions, but how does telemetry get statistics > for hypervisors? Why is KVM different from hypervisors or NIC's statistics > or any other high speed devices (RDMA) that generate tons of data? Right now, the only way is debugfs but it's slow, and it's disabled when using lockdown mode; this series is a way to fix this. I sense that there is another question in there; are you wondering if another mechanism should be used, for example netlink? The main issue there is how to identify a VM, since KVM file descriptors don't have a name. Using a pid works (sort of) for debugfs, but pids are not appropriate for a stable API. Using a file descriptor as in this series requires collaboration from the userspace program; howver, once the file descriptor has been transmitted via SCM_RIGHTS, telemetry can read it forever without further IPC, and there is proper privilege separation. Paolo