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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 EE604C433E0 for ; Wed, 27 May 2020 13:14:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE1C4208FE for ; Wed, 27 May 2020 13:14:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="i8OaygwU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387821AbgE0NOv (ORCPT ); Wed, 27 May 2020 09:14:51 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:28560 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387696AbgE0NOu (ORCPT ); Wed, 27 May 2020 09:14:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590585288; 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=Xp4IU27b7aXZqohMpJFZPawUcolyfH/CQm0FvETLmFY=; b=i8OaygwU622MhW4ELzSWhkAH9hpfDy20MW1CP3w+YDknMpHZ3r3gHeZwRC+EHz0GtuTP98 98QPsuFrnEXxcy24QRlrEvMjpoi/Z4DBGo4u+aYBRsixVStCve9QvCrijn2TfyaURRZ1y8 crpn5SHXjEJidrM4x9fSEiQh08T0oCo= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-PofeKK4pOTiEnopIgbqLaw-1; Wed, 27 May 2020 09:14:45 -0400 X-MC-Unique: PofeKK4pOTiEnopIgbqLaw-1 Received: by mail-wr1-f72.google.com with SMTP id j8so4463814wrb.9 for ; Wed, 27 May 2020 06:14:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Xp4IU27b7aXZqohMpJFZPawUcolyfH/CQm0FvETLmFY=; b=GCpVSCyzXnoSav9bv6BlAsKemXeIl7/k4UrBXkdehk3+JPVraCCQpk0C9dRRVjxCko o4gUpA/1gos7ew3dUTQUzzFoyYH2xWSgDkLKyUEdRmFZuYkVzMk2pbdqGHj1WQZ+gtIa vk1aHKy94b90ej0NT8f+NKV+nL5Wdkw31mw/xnAX9tSrTQZQqBfbByknKX4+IQD1Wy7w SVFtekHc06U7a1aol/q5LZf8gnVcGfUH+L5bcRSl50y0dMoKMqsgrBMXEdB1AKdp3pY+ +7gqNy1jHFPxeE2Eh9LJMtwiRZ54u5HlLpDoDnyzpUpPpgeQmH1zgIEcjIbDFrzJhHM1 i3SA== X-Gm-Message-State: AOAM531PaEFDHUDqF9GSaqc8lEnINLAqC2TCcI1dTDw/6Z8RcxGJFgs3 kZOpPrdeUWJMkCTgO1hwj84+w0WpF/Sd4vpqmsl2XaIKh7pwRZILZWOBowgDNwe9sndLDOKmfi3 6VcSPH1+huycp X-Received: by 2002:a1c:1b17:: with SMTP id b23mr4189537wmb.3.1590585284254; Wed, 27 May 2020 06:14:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXDD9pd6xDx85wKJ6DSUd0+jHdsTLXsbOgS1BfL3siVJ+UTokB2SEyRQkeYWpyFjB2Klsulg== X-Received: by 2002:a1c:1b17:: with SMTP id b23mr4189496wmb.3.1590585283890; Wed, 27 May 2020 06:14:43 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.225]) by smtp.gmail.com with ESMTPSA id r4sm2825862wro.32.2020.05.27.06.14.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 May 2020 06:14:43 -0700 (PDT) Subject: Re: [PATCH v3 0/7] Statsfs: a new ram-based file system for Linux kernel statistics To: Jakub Kicinski Cc: kvm@vger.kernel.org, Christian Borntraeger , Paolo Bonzini , Jim Mattson , Alexander Viro , Emanuele Giuseppe Esposito , David Rientjes , Jonathan Adams , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, Andrew Lunn References: <20200526110318.69006-1-eesposit@redhat.com> <20200526153128.448bfb43@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> From: Emanuele Giuseppe Esposito Message-ID: <6a754b40-b148-867d-071d-8f31c5c0d172@redhat.com> Date: Wed, 27 May 2020 15:14:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200526153128.448bfb43@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org >> >> The file system is mounted on /sys/kernel/stats and would be already used >> by kvm. Statsfs was initially introduced by Paolo Bonzini [1]. > > What's the direct motivation for this work? Moving KVM stats out of > debugfs? There's many reasons: one of these is not using debugfs for statistics, but also (and mainly) to try and have a single tool that automatically takes care and displays them, instead of leaving each subsystem "on its own". Sure, everyone gathers and processes stats in different ways, and the aim of this tool is to hopefully be extensible enough to cover all needs. > In my experience stats belong in the API used for creating/enumerating > objects, statsfs sounds like going in the exact opposite direction - > creating a parallel structure / hierarchy for exposing stats. I know > nothing about KVM but are you sure all the info that has to be exposed > will be stats?I don't understand, what do you mean here? > > In case of networking we have the basic stats in sysfs, under the > netdevice's kobject. But since we're not using sysfs much any more > for config, new stats are added in netlink APIs. Again - same APIs > used for enumeration and config. I don't really know a lot about the networking subsystem, and as it was pointed out in another email on patch 7 by Andrew, networking needs to atomically gather and display statistics in order to make them consistent, and currently this is not supported by stats_fs but could be added in future. In addition, right now it won't work properly if the networking namespaces are enabled. That is another issue to take into consideration. That's also why I marked patch 7 as "not for merge" Regarding the config, as I said the idea is to gather multiple subsystems' statistics, therefore there wouldn't be a single configuration method like in netlink. For example in kvm there are file descriptors for configuration, and creating them requires no privilege, contrary to the network interfaces. Thank you, Emanuele