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 A584DC6FA99 for ; Fri, 10 Mar 2023 22:34:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C61246B0071; Fri, 10 Mar 2023 17:34:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C10E18E0001; Fri, 10 Mar 2023 17:34:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB11E6B0074; Fri, 10 Mar 2023 17:34:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 970BD6B0071 for ; Fri, 10 Mar 2023 17:34:43 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 573101A0D12 for ; Fri, 10 Mar 2023 22:34:43 +0000 (UTC) X-FDA: 80554444446.07.8B7754E Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by imf17.hostedemail.com (Postfix) with ESMTP id 4F51740004 for ; Fri, 10 Mar 2023 22:34:41 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=devkernel.io header.s=fm2 header.b=kjwFM2LT; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=hTRX3lQa; spf=pass (imf17.hostedemail.com: domain of shr@devkernel.io designates 66.111.4.29 as permitted sender) smtp.mailfrom=shr@devkernel.io; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678487681; a=rsa-sha256; cv=none; b=xNkaSTlsQdkSkKWOkFY4AhCs/DrZIfbMWChVJf/jSC41EfOWX7QRT8qDvRAFjLPNgQKhyj ENEJ/PHhCByP1s/t52k0MLpT8aue9U+Sb1uWBgaDd/k7mDziW21GE0FtcMk6MJtjjXnWBl R8U1/ZwvQzi9pYhu6JpG5o6IHMulFeQ= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=devkernel.io header.s=fm2 header.b=kjwFM2LT; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=hTRX3lQa; spf=pass (imf17.hostedemail.com: domain of shr@devkernel.io designates 66.111.4.29 as permitted sender) smtp.mailfrom=shr@devkernel.io; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678487681; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rCwncXR8dFv2PZoG8npQzpJB7yEFLVNUN1n6unOE5n8=; b=Ed5t3zMZalsZA4G96zl4I1Vn+jXNjaWZnYpYqq4gzUZmd4+ezlODVCwV1jsc+X13gwwZR3 B2aZdvJY3k8mEqypK/7V4y6sKgbYYpSpsx3QKwvd3r4+2TeHE1AOf9pgqYPvH1ykdpzUjF bJezkiL1suoiVRVg6RotYnFtTnqSwpI= Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id BF7DF5C0131; Fri, 10 Mar 2023 17:34:40 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute4.internal (MEProxy); Fri, 10 Mar 2023 17:34:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devkernel.io; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1678487680; x=1678574080; bh=rC wncXR8dFv2PZoG8npQzpJB7yEFLVNUN1n6unOE5n8=; b=kjwFM2LTTm+TE0VFAa oxSo2Zq4dJttPnIzAAoe/e5vNRA9kfEH3skIZ3lrzj7oWi5uLRdfEBj6v2/4CXlz l1hm++XfLv1jMfm6veYlcFDyekK37rUDYe21MrKzAwvhQ/YskAjESe1FZcpJMf6I 2yETMuOXU5JdwKTZs9y2IsOdV1WvRXfBSW7Hkrrk/DRQdEZW1nveISmY2/5EUMrm pYsZ3oZsEwCOXmNOWwgbveidaQH8EbFrSSeD3HYB2iByWvgC7z9bywuCtqYNo4Ui vLkDx+7zL/AFiUr+2ribj/COWst5HQzIYv3JuWXQTz2i8lMs95w2bkyihFl7hpCU lw7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1678487680; x=1678574080; bh=rCwncXR8dFv2P ZoG8npQzpJB7yEFLVNUN1n6unOE5n8=; b=hTRX3lQa6VHvGwiN5tb2l45rr+iBh ysiFWO8iQL0R+JFkFIHj+feum9mHAyRgwlqlRWUADhyBRzoZLxGcpbNv6fGAi6eR 9kDJcSOq6SMeWVasFXd4xJNa+x9BKd6pF3xSWOAcCGZ4YRWHoWqj/FYqh+4skHAa rEXIjV+vpvh+XO5Lm6ilTi3v+OzGsvHzPK+1LttSBz/9D6220I7mF5/ST4jWzRQb G9zSwaBwsl3lBqDf/ScyAcYHbh3+nlotWCJvFPbHXC/2H32VHu4sFR3TG8mAJg+x 3jIS3ekp7XZDc+5PWbBxhVzi09Pja7vEm0sL275GRBVYAVU2nMIYf5oEw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddukedgudeitdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesrgdtreerreertdenucfhrhhomhepfdfu thgvfhgrnhcutfhovghstghhfdcuoehshhhrseguvghvkhgvrhhnvghlrdhioheqnecugg ftrfgrthhtvghrnhepvefftddvveeuieegtdehhfehleegfeefieduhfduvdevheeigfeg udeuffffffeinecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehshhhrseguvghvkhgvrhhnvghl rdhioh X-ME-Proxy: Feedback-ID: i84614614:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 88ABDB60086; Fri, 10 Mar 2023 17:34:40 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-206-g57c8fdedf8-fm-20230227.001-g57c8fded Mime-Version: 1.0 Message-Id: <01a4814a-d8e3-4da2-8346-f4dc302e16f2@app.fastmail.com> In-Reply-To: <20230310150218.31510a60@gandalf.local.home> References: <20230210214645.2720847-1-shr@devkernel.io> <20230309172726.14fca32e@gandalf.local.home> <20230310150218.31510a60@gandalf.local.home> Date: Fri, 10 Mar 2023 14:34:20 -0800 From: "Stefan Roesch" To: "Steven Rostedt" 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 Content-Type: multipart/alternative; boundary=743a64c7b4964bb4a5e3328a72a120aa X-Rspam-User: X-Rspamd-Queue-Id: 4F51740004 X-Rspamd-Server: rspam01 X-Stat-Signature: tsrdzu7j4t8839r5qrs3mreqm667t195 X-HE-Tag: 1678487681-275621 X-HE-Meta: U2FsdGVkX19WxffUIC7Vmgzlilypzi760GKVp/DVG/wxqICW0uuOepBddUHq3ODfduPdfYd7CkmCBUZUWobqrl/fQjmXUeWcL8GRX5hE9HkvdtoJl8bPJ6Ux1KJlNOIzMxaezJqil1Zfy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1x4jwY1ssBn34o522RldsPo+qfDiSxuILuDMRy17s0EBAEwrZhvcwj/D5CVLxKX3UYyAabjqm08bdWo200y5/ZP8adwig9rxQMfxSDE3ZgKMnobaneYuU+y+amHiI49R9uvsyMVhNZwhLYT4yUWfUpX2GZA1t5MmdyC7GyCv97RUS5whyqhO97FcZ/jlceiXvygM3A7r3gXunOZJJlI6c24Xv35PabcDE7uJUr6jANY= 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: --743a64c7b4964bb4a5e3328a72a120aa Content-Type: text/plain I'll follow that approach. On Fri, Mar 10, 2023, at 12:02 PM, Steven Rostedt wrote: > 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 > --743a64c7b4964bb4a5e3328a72a120aa Content-Type: text/html Content-Transfer-Encoding: quoted-printable
I'll follow tha= t approach.

On Fri, Mar 10, 2023, at 12:02 PM, = Steven Rostedt wrote:
On Fri, 10 Mar 2023 11:22:54 -0800
Stefan Roesc= h <shr@devkernel.io> wrote= :

> >> + trace_ksm_remove_rmap_i= tem(stable_node->kpfn, rmap_item, rmap_item->mm);  
<= /div>
> >
> > 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
<= /div>
> > in the stable_node instead, and then in the TP_fast_= assign() do:
> >
> > __entry-&= gt;pfn =3D stable_node->kpfn;
> >
&= gt; >  

> To do t= his, 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 no= t printing the pfn
> and use the rmap_item to refer bac= k to it, but exposing it directly
> here is more conven= ient for debugging.

> Any thou= ghts?

Sounds like the include/trace/events/= ksm.h should be local too.

See my reply abo= ut include/trace/events/thermal.h


And their solution.
<= /div>


--743a64c7b4964bb4a5e3328a72a120aa--