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 B792FC433FE for ; Mon, 14 Nov 2022 15:33:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F4EF6B0072; Mon, 14 Nov 2022 10:33:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A4A36B0073; Mon, 14 Nov 2022 10:33:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 094186B0074; Mon, 14 Nov 2022 10:33:18 -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 E921C6B0072 for ; Mon, 14 Nov 2022 10:33:17 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id EB06D12093F for ; Mon, 14 Nov 2022 15:33:16 +0000 (UTC) X-FDA: 80132441592.08.672B8AC Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf07.hostedemail.com (Postfix) with ESMTP id 575B24000C for ; Mon, 14 Nov 2022 15:33:15 +0000 (UTC) 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 68A77B80FEE; Mon, 14 Nov 2022 15:33:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 341DBC433D6; Mon, 14 Nov 2022 15:33:12 +0000 (UTC) Date: Mon, 14 Nov 2022 10:33:50 -0500 From: Steven Rostedt To: Gautam Menghani Cc: akpm@linux-foundation.org, mhiramat@kernel.org, shy828301@gmail.com, zokeefe@google.com, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] mm/khugepaged: add tracepoint to collapse_file() Message-ID: <20221114103350.4b8a2786@gandalf.local.home> In-Reply-To: <20221026052218.148234-1-gautammenghani201@gmail.com> References: <20221026052218.148234-1-gautammenghani201@gmail.com> 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668439996; 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=0X2G0Hr7gjZDgvh/KqC8+h1zGtBpfKWftt0hPc3PXnw=; b=7naDhDfLK0L8pE+Ptcr7W09ffIUbdsMSyC+J3A9v5rqa5Unz3y4hplGbJ8/9L+ndF6Et79 zc9I12M0CqpAFRLLnL3kzXVGHeCH25zwI9I3I623XuZtuYryzcRLJYyo91D+bioVLpzSNn iBxDAeH18MFqJlBFA02Z/idBbW2qJl8= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf07.hostedemail.com: domain of "SRS0=LXGb=3O=goodmis.org=rostedt@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=LXGb=3O=goodmis.org=rostedt@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668439996; a=rsa-sha256; cv=none; b=nigjhFpiJhaKv6+b8Wz6N5DRTKZWmTahwTck7qs2U6yjPLz/+4ZAbp1POt7Ky5qMx1ljqC 3EuJeAVKMltcCQbRyHE5o4VcQh8ZDgkdDBUz3RBFeN9fz4xo9Fa6NFtaRJZVHTMPrnk0JT typ5HPqKYEPBAOZwk+Vbca6IW5vpLN4= X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 575B24000C X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf07.hostedemail.com: domain of "SRS0=LXGb=3O=goodmis.org=rostedt@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=LXGb=3O=goodmis.org=rostedt@kernel.org" X-Stat-Signature: ftdx3pa4gxbag6zf943grbciworn7yqc X-HE-Tag: 1668439995-565905 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 Wed, 26 Oct 2022 10:52:18 +0530 Gautam Menghani wrote: Ideally we want the trace event structure to be as packed as possible to not waste space on the ring buffer. > + TP_ARGS(mm, hpage, index, is_shmem, addr, file, nr, result), > + TP_STRUCT__entry( > + __field(struct mm_struct *, mm) 4 / 8 bytes (depending on 32 bit or 64 bit arch) > + __field(unsigned long, hpfn) 4 / 8 bytes The two above is fine. > + __field(pgoff_t, index) 4 / 8 bytes > + __field(bool, is_shmem) 4 bytes (or less) > + __field(unsigned long, addr) 4 / 8 bytes > + __string(filename, file->f_path.dentry->d_iname) 4 bytes > + __field(int, nr) 4 bytes > + __field(int, result) 4 bytes For best packing, it's best to keep long / pointers together, and ints and bools together (or paired). On 64 bit archs, there is likely to be a 4 byte hole between is_shmem and addr. > + ), > + Better to have it be: TP_STRUCT__entry( __field(struct mm_struct *, mm) __field(unsigned long, hpfn) __field(pgoff_t, index) __field(unsigned long, addr) __field(bool, is_shmem) __string(filename, file->f_path.dentry->d_iname) __field(int, nr) __field(int, result) ), Where I swapped is_shmem and addr. -- Steve