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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11B42C41535 for ; Tue, 19 Dec 2023 20:29:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A24E510E1E8; Tue, 19 Dec 2023 20:29:11 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0AD4110E1DE for ; Tue, 19 Dec 2023 20:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703017750; x=1734553750; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=ArF3aVoGrukklzZ+p1g++ZVuiazYTa6fYveoWv7rWRg=; b=Z6Tgg5YPpsSMbrliGf5UfdqwZXuOSZJR66a6H1UUmKfqQHsns0S2huXm yWrU0YakJT269aZFi7B1dN38f3YMbCxNV0wLNteHVok5CxKdMl9qXsBpA f6XNe+IHYKkU9v/7f74LKQ3valBgSHENG0Ia289a1pVgFdeXNlj0bQWyN QZhlGo7k/QvFakOx5YKQ+3lD0JOUgMIx+7vMXquhq5+6w655DwjHYaQ08 p1IN+n0de/fbLM4h1ybRzw8tvV+9VgPQHjyhUXw3NOxb82dk5lFYzyR7F YgeKPYbkA2sbc7M9qdBWXJZepaX+klIECJL4pj0Y0SOwmoKviH2+xu4Bu Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10929"; a="392885785" X-IronPort-AV: E=Sophos;i="6.04,289,1695711600"; d="scan'208";a="392885785" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2023 12:29:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10929"; a="752296947" X-IronPort-AV: E=Sophos;i="6.04,289,1695711600"; d="scan'208";a="752296947" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.19.159]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2023 12:29:08 -0800 Date: Tue, 19 Dec 2023 12:28:51 -0800 Message-ID: <87wmtaszr0.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: intel-xe@lists.freedesktop.org Subject: Re: [PATCH 02/17] drm/xe/perf/uapi: Add perf_stream_paranoid sysctl In-Reply-To: <20231208064329.2387604-3-ashutosh.dixit@intel.com> References: <20231208064329.2387604-1-ashutosh.dixit@intel.com> <20231208064329.2387604-3-ashutosh.dixit@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Thu, 07 Dec 2023 22:43:14 -0800, Ashutosh Dixit wrote: > > +static struct ctl_table perf_ctl_table[] = { > + { > + .procname = "perf_stream_paranoid", > + .data = &xe_perf_stream_paranoid, > + .maxlen = sizeof(xe_perf_stream_paranoid), > + .mode = 0644, > + .proc_handler = proc_dointvec_minmax, > + .extra1 = SYSCTL_ZERO, > + .extra2 = SYSCTL_ONE, > + }, > + {} > +}; > + > +int xe_perf_sysctl_register(void) > +{ > + sysctl_header = register_sysctl("dev/xe", perf_ctl_table); > + return 0; > +} Any idea why this (and xe_oa_max_sample_rate) is create in /proc, rather than something attached to the module? We would want it to be per module, rather than per device, so that's one reason. What are the options for creating per module params? One is module_param itself. In that case this would appear in "/sys/module/xe/parameters/perf_stream_paranoid" rather than in "/proc/sys/dev/xe/perf_stream_paranoid". Module params are slightly simpler to manage than /proc stuff I think. Any other reason to prefer one over the other? Comments? Thanks. -- Ashutosh