Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3912954ybl; Tue, 21 Jan 2020 09:18:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwkviKlarbMoNkZ5Ic1mz94CKZ/h1jMiv2kyYc81E/mzMZgS+eRn7mZSNwA4LB9HbV2a1rs X-Received: by 2002:aca:ad11:: with SMTP id w17mr3904728oie.85.1579627089343; Tue, 21 Jan 2020 09:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579627089; cv=none; d=google.com; s=arc-20160816; b=UoEAaZh544I+2ThflN7R+JPDg0Do7YL7g3OrNKSFs0WZ221yBAQkTGmQpDiNtOZ8+v 1+AhHtBjFzNmGycl0Yvx8/Q+W1iZI93x0DVfJfJtMmST3SK2qeUEinOVw5Tqit5LvICM yC61AS9a+8vEOUW2skPX3sTmoX67V7b9oQV1zFsTyhfOK4uwuWKdHmtPpIZL9leb1kmi mvb6SauAyuwbOquver9s7FEir/rNe2G999i+ohX57WuIR+IjM6Zx/0ks1FaeVMSewOAz OU3kIKIF3+b1+xmiw5YTx4vatRlA6MVrf4j33oc9afPzTedNaWWilapZG5oyfGj8pOc9 Ul9Q== 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 :dkim-signature; bh=09bMkuvBpqPD3tNwPsbx9bexCvrMcVDcz6ADyOxjx9k=; b=LbyoQBSFLGqfnVjDkf5b3KU3qhwTevuD9qNl7IPE5N6z1eJFio3rvvwLvoUFiJVg3o Zhxv9vWMnCNzJjQYxyCC7xA4/tB0AihUollVpYxCm85bjYQhlSDFMxnvjU0S+OkdoCSH 8KAFiUHYJZys5NdikXI7umVSRI4Z49ixhYnpphUMpGNh3+FzhY3NgjhL6XYNvw7P25mG XdvKFSzuy+0PPECBF+2gx2Vu0uyyOcHacbtA9zrPBh7AqUnCk6qnk+cXBpMlExFKju+h 5Ej2hBiWk7+sopS/+JXymfvH4T9PwqhDQkk1vR34DQfm4pz3PGqm03mhMpNVGfI51NHh RkIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xN+47/rv"; 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 p14si22531828ota.71.2020.01.21.09.17.54; Tue, 21 Jan 2020 09:18:09 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="xN+47/rv"; 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 S1729127AbgAURPu (ORCPT + 99 others); Tue, 21 Jan 2020 12:15:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:43352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728904AbgAURPu (ORCPT ); Tue, 21 Jan 2020 12:15:50 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD4CA20882; Tue, 21 Jan 2020 17:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579626949; bh=qVCil94wgEQJMgnsjwFbC4DcciytL5tgZdZLpbVcBIs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xN+47/rvM7NIeyfvkGJ7bHtr2GVMOcFPD1xvxsbEgp4PiNvshojcXYnvsMA8VgG/C DAgNtQPOlyYlVDqFPtyIGtY/z1ihJKXVQOH2uzbTdFgWhmbMF/5H3HMYT98I+dySJ3 FRmtz7sJSDj4cfuBnsHJpO0DrsPKLOQtVCYX38U0= Date: Tue, 21 Jan 2020 18:15:47 +0100 From: Greg KH To: "Sudarikov, Roman" Cc: Andi Kleen , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, eranian@google.com, bgregg@netflix.com, kan.liang@linux.intel.com, alexander.antonov@intel.com Subject: Re: [PATCH v4 2/2] perf =?iso-8859-1?Q?x86?= =?iso-8859-1?Q?=3A_Exposing_an_Uncore_unit_to_PMON_for_Intel_Xeon?= =?iso-8859-1?Q?=AE?= server platform Message-ID: <20200121171547.GA632898@kroah.com> References: <20200117133759.5729-1-roman.sudarikov@linux.intel.com> <20200117133759.5729-3-roman.sudarikov@linux.intel.com> <20200117141944.GC1856891@kroah.com> <20200117162357.GK302770@tassilo.jf.intel.com> <20200117165406.GA1937954@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 21, 2020 at 07:15:56PM +0300, Sudarikov, Roman wrote: > On 17.01.2020 19:54, Greg KH wrote: > > On Fri, Jan 17, 2020 at 08:23:57AM -0800, Andi Kleen wrote: > > > > I thought I was nice and gentle last time and said that this was a > > > > really bad idea and you would fix it up. That didn't happen, so I am > > > > being explicit here, THIS IS NOT AN ACCEPTABLE FILE OUTPUT FOR A SYSFS > > > > FILE. > > > Could you suggest how such a 1:N mapping should be expressed instead in > > > sysfs? > > I have yet to figure out what it is you all are trying to express here > > given a lack of Documentation/ABI/ file :) > > > > But again, sysfs is ONE VALUE PER FILE. You have a list of items here, > > that is bounded only by the number of devices in the system at the > > moment. That number will go up in time, as we all know. So this is > > just not going to work at all as-is. > > > > greg k-h > > Hi Greg, > > Technically, the motivation behind this patch is to enable Linux perf tool > to attribute IO traffic to IO device. > > Currently, perf tool provides interface to configure IO PMUs only without > any > context. > > Understanding IIO stack concept to find which IIO stack that particular > IO device is connected to, or to identify an IIO PMON block to program > for monitoring specific IIO stack assumes a lot of implicit knowledge > about given Intel server platform architecture. Is "IIO" being used here the same way that drivers/iio/ is in the kernel, or is this some other term? If it is the same, why isn't the iio developers involved in this? If it is some other term, please always define it and perhaps pick a different name :) > Please consider the following mapping schema: > > 1. new "mapping" directory is to be added under each uncore_iio_N directory What is uncore_iio_N? A struct device? Or something else? > 2. that "mapping" directory is supposed to contain symlinks named "dieN" > which are pointed to corresponding root bus. > Below is how it looks like for 2S machine: > > # ll uncore_iio_0/mapping/ > lrwxrwxrwx 1 root root 0 Jan 20 23:55 die0 -> > ../../pci0000:00/pci_bus/0000:00 Where did "pci_bus" come from in there? I don't see under /sys/devices/ for my pci bridges. > lrwxrwxrwx 1 root root 0 Jan 20 23:55 die1 -> > ../../pci0000:80/pci_bus/0000:80 > > # ll uncore_iio_1/mapping/ > lrwxrwxrwx 1 root root 0 Jan 20 23:55 die0 -> > ../../pci0000:17/pci_bus/0000:17 > lrwxrwxrwx 1 root root 0 Jan 20 23:55 die1 -> > ../../pci0000:85/pci_bus/0000:85 > > # ll uncore_iio_2/mapping/ > lrwxrwxrwx 1 root root 0 Jan 20 23:55 die0 -> > ../../pci0000:3a/pci_bus/0000:3a > lrwxrwxrwx 1 root root 0 Jan 20 23:55 die1 -> > ../../pci0000:ae/pci_bus/0000:ae > > # ll uncore_iio_3/mapping/ > lrwxrwxrwx 1 root root 0 Jan 20 23:55 die0 -> > ../../pci0000:5d/pci_bus/0000:5d > lrwxrwxrwx 1 root root 0 Jan 20 23:55 die1 -> > ../../pci0000:d7/pci_bus/0000:d7 Why have a subdir here? Anyway, yes, that would make sense, if userspace can actually do something with that, can it? Also, what tears those symlinks down when you remove those pci devices from the system? Shouldn't you have an entry in the pci device itself for this type of thing? And if so, isn't this really just a "normal" class type driver you are writing? That should handle all of the symlinks and stuff for you automatically, right? thanks, greg k-h