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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86B42C6FD19 for ; Fri, 10 Mar 2023 20:02:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D776C8E0001; Fri, 10 Mar 2023 15:02:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D27C26B0072; Fri, 10 Mar 2023 15:02:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C169C8E0001; Fri, 10 Mar 2023 15:02:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B38726B0071 for ; Fri, 10 Mar 2023 15:02:26 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8587716096F for ; Fri, 10 Mar 2023 20:02:26 +0000 (UTC) X-FDA: 80554060692.20.42F7C7D Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf04.hostedemail.com (Postfix) with ESMTP id BC4B64000A for ; Fri, 10 Mar 2023 20:02:24 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of "SRS0=GJLE=7C=goodmis.org=rostedt@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=GJLE=7C=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678478544; h=from:from:sender: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=FlCEIy6U1V9CA1vm9xPBdgO8KFP7LnRkL4rmpfClcTA=; b=kIRK6mbo8KFK+bkpfPnyRaNxZsxG4j/+Gn8HLWDKwlwtB7VLZcIHZhT67dHyTJYZITY1XA 3D4XvKUlGvnyUdk/90w0mEF6Nv6Re/YlP2YjKJsiiB59DSd5EJjzLhvCKF3vo5EZg6rWOo x068C67vWTI1lD77ONXtrH74jgDlEM8= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of "SRS0=GJLE=7C=goodmis.org=rostedt@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=GJLE=7C=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678478544; a=rsa-sha256; cv=none; b=boBe0c6njZuxQdTsBy3jBI46dlayn6OWEPn9urBjXOD9sLiYK+1truRthLvnT4CDJ5BhVc FHW7PS1xQd0jSX1vcEovYWts2hN26rvyVIZsu/vIwQKBZ1URBELhHhXlPIMbTprXWXiQiR bCQXM64SDUMBW9ns6AYEpce3bPw6Wig= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2FC40B82325; Fri, 10 Mar 2023 20:02:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6350BC433EF; Fri, 10 Mar 2023 20:02:21 +0000 (UTC) Date: Fri, 10 Mar 2023 15:02:18 -0500 From: Steven Rostedt To: Stefan Roesch Cc: kernel-team@fb.com, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: Re: [PATCH v1] mm: add tracepoints to ksm Message-ID: <20230310150218.31510a60@gandalf.local.home> In-Reply-To: References: <20230210214645.2720847-1-shr@devkernel.io> <20230309172726.14fca32e@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: zazebqh74xdzskc5zdiqjqzy63uz61gg X-Rspamd-Queue-Id: BC4B64000A X-HE-Tag: 1678478544-836820 X-HE-Meta: U2FsdGVkX19ZsqmbZUu5YmH5EtLTrecft5cmRLGa2hWBZSAiDna3oHvKTLSDJUn6zZIxSbP+vGu+ekUgmzBg1XD7WnyyeZYeHmE41fQ7wblRDTFRbof+mmInpnpZEwSQdrCgU6kJFc2RmY1TYxPvAPGySyPfo3DmCcs5rUOx03qcLocDc0Eo9ZxpQnovog8zeleyTUNuSgX4hWCRCqk5rxLBDribHUmODae9AcV+tWtcWBmP2uJNjkjHAFq2/ZrTZqjcywCrxFAlEqZ6D1eHOJ31rkTEDQv8lryQLqHIUiCm3vVQx4t1iD2+GATjFWkOUOq8fboN/q2NFsvyEkZ7gYtgInICVxNny6WrjBIQ6xayiWzE2QHoxSd7O+0fE1raMKWVuX5mIqdfi5UP5yWBz4hZNlkxeLYmn3SHuJKuuAgYkE9fpsyTXsJcaPAIiSikNApXQ7maZh6TYKdrYzTeDakAz9evWKxUZzmGWR4spooTPRo7XhAGwtTVkjbseIVGkJE7irAETNA56HCd2+pQuiM/71VwPi5+ej5Z4DjHyZ5AcuMtkkTR0fXBzLoM7nUksuJ+r+SQICzjCI9hUvdydZT3+qfVnsdEISUwGSLm5fYNX8v0UKzZce7Nu10igap5WAAjnEXT3K/livusaRL5Cnocxwis1dLpiGeLK0+GSjate7oKaDzeTY7n4+CGK8XTAVTtQf0zHRcUfJJuJ3rC7byzPjXbzmDFwmc5IhedSlTZMdBtoh5I02mzyJ+lQelkDk11gQO0p6CLgAN35JqA9r6TNOEIMvUNPgeluMQwJUxvnAB8hI+UhnED0f2j0Cf55QxF75Cuk2irCe1HXGODsIaxDF2q0T7AMv7RyCz7nFxdfOEMLTY/jVa3coju07F5nydJcuCgF2bqpGHHdlGQyyVGjAL8Sup7t4X+UnpGpEJtmcsWmMyJSsFW4jmQKXbGD1/rq+GDaF4xNJ8PcvJ gOuVlcrk GZpNuldWzUjHoz70PKlgSMrLYEPoSzs2WxuLYO0sknpOhpBLT6/7ZR9OEQZE4g5VDhNLoQPW9QI4Y8OEyc33T2Qux89dpAz51VH3+j2exd20QyrHPuPXMxkurVfZ4KjSF/SMgrly/wLbF1DozDGmrS30y7YdWmY60w7g7pHx1NLFyS89aX088yAdVu3zYUTc3eRFnYKRx7MZQ58EA45qhT9aclMYjpGzuc93erDkbOWfeUQe3s2FC+jzLObR1YvKLLhU/21L7Sd24eSZBGpw+iEQP9AWbeRCJ41K7H74NOvYb2IM2+UhWsW2+Undyqrrbebdwj3UEpAjHrQtNRfAS4votfh1OUBAmFTXSwK7tvpGYA0Pnu1IgY/TT33O2L4eu4C8df20mjUi5kowCEG+oA9dHaCWXWyj0yHRJyL5TAlnfWP+OVq/Sm7PT17bAUWM1axGXQ5i3kszwXfv5r1tRhGXlDSGTI7czt0B9+iIFFerTDgA= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 10 Mar 2023 11:22:54 -0800 Stefan Roesch wrote: > >> + trace_ksm_remove_rmap_item(stable_node->kpfn, rmap_item, rmap_item->mm); > > > > Instead of dereferencing the stable_node here, where the work could > > possibly happen outside the trace event and in the hot path, could you pass > > in the stable_node instead, and then in the TP_fast_assign() do: > > > > __entry->pfn = stable_node->kpfn; > > > > > > To do this, the structure would need to be exposed. Currently the > structure is defined in ksm.c. This is an internal structure that we > most likely don't want to expose. We can get by not printing the pfn > and use the rmap_item to refer back to it, but exposing it directly > here is more convenient for debugging. > > Any thoughts? Sounds like the include/trace/events/ksm.h should be local too. See my reply about include/trace/events/thermal.h https://lore.kernel.org/all/20230227100715.7d896836@gandalf.local.home/ And their solution. https://lore.kernel.org/all/20230307133735.90772-2-daniel.lezcano@linaro.org/ I suggest you do the same. -- Steve