From patchwork Sat Feb 24 01:10:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 205745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp932816dyb; Fri, 23 Feb 2024 17:13:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVTDmHDpiC6i3mEPJaHwYspMti9LO1vE6HVRfDit6/53tuiHm2wYNC7G6KRTo0x3G+N+u7im3Nvmt8n2ImeCUG+0LeASw== X-Google-Smtp-Source: AGHT+IHgg2p0q0zCsdTHa6/o0X1j0X/p3CUXVoqSAvCUmMrvmi/cDfEcXy89fG76GAGnYiQIIef7 X-Received: by 2002:a17:902:d491:b0:1d9:53ca:e651 with SMTP id c17-20020a170902d49100b001d953cae651mr1845686plg.33.1708737184888; Fri, 23 Feb 2024 17:13:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708737184; cv=pass; d=google.com; s=arc-20160816; b=IVL/Alj9f0f1vC0JhBzBlVd4bDB2jWdJafE0Wey2OgUW7KMM6wuH3p5tAjZGKUP066 FerzIorkEfubR3PCU2siAXbCB3P6aeHsUHhHuPo+XEcoIxFmtE5ERUoh6H2tap40gSXu DPqph7GU7gu6OjwbpQ4QLCueXrSji2Yd46dwEgEwEdc+5v9g2AdnV43HBHBz7+OUVlH/ /JJPLxbYlHa3sgcGvkFq52oXcthez7RQ6bJbg23hVeNpi/hbnD3VZvyEIOgao2CfN2Mz ggZA6WmXi/uNPZ7y2CDDmlXkCbmdCmqu0QIiB2dAp/O418kGQJ2F5gjoVOod8yoakrPh SUyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:cc:to:from:subject:date:dkim-signature; bh=CdQylOv4WMwWJBPzofX8yKLF1TdgNKNV5SVH8Ugg37Q=; fh=eGotrG2wUAPCtJbO4MhMKF1jcndrbQy7pSZLLDRnPjs=; b=Mb8YFx1AHjKzPFCE8BCTEqUx9ZoeJ4dBSZUrVEyBUWyX8axHy3PB0+oK/3Lo6rypgU svPH21L/mCbOTMbOHawhertQrtCPOVHN6WQMvIH6ia3BccAr/WFUW1yY4e76QRG5EsMl tMqZK3mdXkgmFG2qlPUOaG5kwNyRfJXFeVMsTC2+YEtJI/PdrdOBl8SXnxGT/51nCewP CeZ8mPE2Vd1e33tu6Ud9MTOLNUjOexoK3cG4jAY0fwetV92tFQe0GsApl0on1VweaXHz +G1AlaPFF09BwzfA5GyCKs/lsE8Nf7NSpQrveDco/KamLLlqQAk59dmx7cDrBOtJ5Q1G W7nA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=caEkkQyz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79393-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79393-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f3-20020a17090274c300b001dbe7aead2fsi76242plt.113.2024.02.23.17.13.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 17:13:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79393-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=caEkkQyz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79393-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79393-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CC18AB2332B for ; Sat, 24 Feb 2024 01:11:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DF0A138A; Sat, 24 Feb 2024 01:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="caEkkQyz" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3C0C63AC; Sat, 24 Feb 2024 01:10:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708737053; cv=none; b=TA3voLpo6OyXFqHpTMs1+ucsyr9PiIap+wDO0l1vbTVCKGjBWpDaCh1y4khVc/glowL8D1iJ5yaT5z9yBNJeyPcNKkBAuOqei7EBesyc7gTOe3lS8ZzlBlZgji7QFNIf3Q9ZBpLhzSrQCH6GGudLtxxz/FLNBiXLwQcA/MEiB3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708737053; c=relaxed/simple; bh=eJon+naYLvX2TtPG4PA+bOIKoeqRl8FeptOhgYTmTjY=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TkWS7CqtztPQFb4lye3Qheo9Wh8B9SRVFcoBFWNRVRfRiklceMSN2MztIwEiD1VKbSQJxjgNCUrhRXghpbkszpjF3FRjMtkv6s3SxntA5bRUXhzNiDcgWKruFvE3TgS4Qv387+sip6PZtZF0KdRzuLbboKeXeqHwh8QyVDrnFcY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=caEkkQyz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 157A1C433C7; Sat, 24 Feb 2024 01:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708737053; bh=eJon+naYLvX2TtPG4PA+bOIKoeqRl8FeptOhgYTmTjY=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=caEkkQyzIq0Ve+Ewj/ihNiVZjSYmf5e1Klx0MPBtyINMpbgb6aCxsqckZ+GRb8kKK zHIlArrJNyH+I13vprpxjOTejJt0fy5KpBtrBDFdLrF8getzqnngOgaRagSoc7hMiY rhyAo8S8GXIfP+Oe5ms1/NuSh5tAB/tywCZP/gkYPYjYQMJ4M0KD69CaAfIPpWShYJ 7OFgAkkMbi0XGgXjHiqbRpJrsuaq6pdNff6nrs+fE4EyuM7uR0gjEHs5twu8Btym2f Ao1hKS2DnwLicW4aFYYqZeIgm1M4BlajMV1TLu7akKwpYlP+0Xm0FcGsJKVpcme+nl IONWowmzq/AmA== Date: Fri, 23 Feb 2024 17:10:52 -0800 Subject: [PATCH 03/10] time_stats: fix struct layout bloat From: "Darrick J. Wong" To: akpm@linux-foundation.org, daniel@gluo.nz, kent.overstreet@linux.dev, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <170873667989.1860949.8776444464588431097.stgit@frogsfrogsfrogs> In-Reply-To: <170873667916.1860949.11027844260383646446.stgit@frogsfrogsfrogs> References: <170873667916.1860949.11027844260383646446.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791740802394173690 X-GMAIL-MSGID: 1791740802394173690 From: Darrick J. Wong Make these more efficient by getting rid of the holes. This reduces the structure size from 224 bytes to 208 bytes. Signed-off-by: Darrick J. Wong Signed-off-by: Kent Overstreet --- include/linux/time_stats.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/time_stats.h b/include/linux/time_stats.h index c05490101d197..1c1ba8efa7bfe 100644 --- a/include/linux/time_stats.h +++ b/include/linux/time_stats.h @@ -77,19 +77,19 @@ struct time_stats { u64 last_event; u64 last_event_start; -/* - * Is this really a struct time_stats_quantiled? Hide this flag in the least - * significant bit of the start time to avoid blowing up the structure size. - */ -#define TIME_STATS_HAVE_QUANTILES (1ULL << 0) - - u64 start_time; - struct mean_and_variance duration_stats; - struct mean_and_variance_weighted duration_stats_weighted; struct mean_and_variance freq_stats; + struct mean_and_variance_weighted duration_stats_weighted; struct mean_and_variance_weighted freq_stats_weighted; struct time_stat_buffer __percpu *buffer; + +/* + * Is this really a struct time_stats_quantiled? Hide this flag in the least + * significant bit of the start time to avoid blowing up the structure size. + */ +#define TIME_STATS_HAVE_QUANTILES (1ULL << 0) + + u64 start_time; }; struct time_stats_quantiles {