Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4813363imw; Tue, 19 Jul 2022 13:51:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uEQA15QkoQxMb79a28yzw+Ez5PplSF0N3oFkqjPYlatkjeozwpSe0oMl8txkfo0IRl0lc/ X-Received: by 2002:a17:902:d581:b0:16c:91e7:cfe1 with SMTP id k1-20020a170902d58100b0016c91e7cfe1mr32748560plh.92.1658263888692; Tue, 19 Jul 2022 13:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658263888; cv=none; d=google.com; s=arc-20160816; b=D5ha3/nD1o2wejmfLy8s29lF2zlMYRGCeYBrx/POeXMu9ircLrM9OOzy9V7sJG4Ns2 zarkt08yDMzXX4LnruYPQ9BgzRlN2+lrLuMY1yRcp/mD3BMP3MkFP3Xn7iG3WKtkMA5U H7AfnAyWJ0cRxgLsFs472V370nzeG2sBaoQLI31c++1RbWJF+LKV61Udnfc0bgqfr8rb FvREPtw3vM2BFaEH7SBEYt3oXUr5yhXNIm/vxzATAnujwgYWtdcQYxYC86/doyMBKRMD f2q8w7FVdbTWbwLrudfi8R+B2ZLo5vVdRsiLgmPprcQBV9uXxpMjF68uBHy2auYxAXLG 4DYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9Xsci+UhKB/MsI37JUVG2yPDVUzib7EsJO7/bDYltqU=; b=vnAGrKhTufTnuO53uVdlsjRt0DYi67dddkSsrNZe3kQdWXmFhhxxVR8TQNQy6xMJ8G ABcEWpFOUO1Nh6cywYWD2cFbIOvUshd7dUe/e/tKPR05qf1EFa6O1jS6h9SlGLU+u7l1 eKilptOBewac35jENUX+6/UsY+6+krXrWhkGGPgFe/gSPqsSvFgfEjpBxor2mpM0aSyP A6yMRx+3z03J+6SuhLzTDrJJE4221w+v4lAk5yYS14aWnziTVLuIWT23w3NyAOcV2ZPa rZoZ8Rvg4MSHv6/0CiFiEqkLAe3ssPve1mUXu0KFw1mOuIiQTwbLX0M3p77IKYxtxhzE GGWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VQRq6SmX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a630e09000000b004126d7ca343si21289426pgl.641.2022.07.19.13.51.13; Tue, 19 Jul 2022 13:51:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VQRq6SmX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240126AbiGSUtD (ORCPT + 99 others); Tue, 19 Jul 2022 16:49:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240315AbiGSUsw (ORCPT ); Tue, 19 Jul 2022 16:48:52 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31EB95F9AD; Tue, 19 Jul 2022 13:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658263726; x=1689799726; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=JKOoFo77x7jN/peLRtw+tsIV5rXzDnhY5iVySkXtvUo=; b=VQRq6SmXmRuS/zDFRQ8GvYrcJ9aa1pROzpt07RC3mh40FHHQOE+NpNdp Ijym+vxctckULjZnQ5vLu9RnQIww5nKSNCl7q58DG5LHZX8DyfYQo68Rx 1WI8Q+l4aBEUUbkQzIIrijbE+Xjz9m756ZkuzePwTPAiJ8UThq8AbIBjy YWYNp/RgcJYHUmSgOg463JlvbwZpJimaYaXYeg3D6XTRNYX70cF9WC6FE +LKthrCXT3DVRxyOJdpZnxghMlIeNMwzBkor4UBvLRZ00vCVXMfLOJWt8 EE+TJ/J8ZSv/pja8ntuLLcRsMO+jRlnYLLBG5+cnL8UcKhoeRswsViFTw Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10413"; a="348290267" X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="348290267" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 13:48:45 -0700 X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="843788360" Received: from avandeve-mobl.amr.corp.intel.com (HELO [10.209.102.45]) ([10.209.102.45]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 13:48:43 -0700 Message-ID: Date: Tue, 19 Jul 2022 13:48:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 09/13] notifier: Show function names on notifier routines if DEBUG_NOTIFIERS is set Content-Language: en-US To: "Guilherme G. Piccoli" , akpm@linux-foundation.org, bhe@redhat.com, pmladek@suse.com, kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, x86@kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, halves@canonical.com, fabiomirmar@gmail.com, alejandro.j.jimenez@oracle.com, andriy.shevchenko@linux.intel.com, arnd@arndb.de, bp@alien8.de, corbet@lwn.net, d.hatayama@jp.fujitsu.com, dave.hansen@linux.intel.com, dyoung@redhat.com, feng.tang@intel.com, gregkh@linuxfoundation.org, mikelley@microsoft.com, hidehiro.kawai.ez@hitachi.com, jgross@suse.com, john.ogness@linutronix.de, keescook@chromium.org, luto@kernel.org, mhiramat@kernel.org, mingo@redhat.com, paulmck@kernel.org, peterz@infradead.org, rostedt@goodmis.org, senozhatsky@chromium.org, stern@rowland.harvard.edu, tglx@linutronix.de, vgoyal@redhat.com, vkuznets@redhat.com, will@kernel.org, Cong Wang , Sebastian Andrzej Siewior , Valentin Schneider , Xiaoming Ni References: <20220719195325.402745-1-gpiccoli@igalia.com> <20220719195325.402745-10-gpiccoli@igalia.com> <8e201d99-78a8-d68c-6d33-676a1ba5a6ee@igalia.com> From: Arjan van de Ven In-Reply-To: <8e201d99-78a8-d68c-6d33-676a1ba5a6ee@igalia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/2022 1:44 PM, Guilherme G. Piccoli wrote: > On 19/07/2022 17:33, Arjan van de Ven wrote: >> On 7/19/2022 12:53 PM, Guilherme G. Piccoli wrote: >>> Currently we have a debug infrastructure in the notifiers file, but >>> it's very simple/limited. Extend it by: >>> >>> (a) Showing all registered/unregistered notifiers' callback names; >> >> >> I'm not yet convinced that this is the right direction. >> The original intent for this "debug" feature was to be lightweight enough that it could run in production, since at the time, rootkits >> liked to clobber/hijack notifiers and there were also some other signs of corruption at the time. >> >> By making something print (even at pr_info) for what are probably frequent non-error operations, you turn something that is light >> into something that's a lot more heavy and generally that's not a great idea... it'll be a performance surprise. >> >> > > Is registering/un-registering notifiers a hot path, or performance > sensitive usually? For me, this patch proved to be very useful, and once > enabled, shows relatively few entries in dmesg, these operations aren't > so common thing it seems. > > Also, if this Kconfig option was meant to run in production, maybe the > first thing would be have some sysfs tuning or anything able to turn it > on - I've worked with a variety of customers and the most terrifying > thing in servers is to install a new kernel and reboot heh > > My understanding is that this debug infrastructure would be useful for > notifiers writers and people playing with the core notifiers > code...tracing would be much more useful in the context of checking if > some specific notifier got registered/executed in production environment > I guess. I would totally support an approach where instead of pr_info, there's a tracepoint for these events (and that shouldnt' need to be conditional on a config option) that's not what the patch does though.