From patchwork Sat Aug 17 12:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Guzik X-Patchwork-Id: 13767180 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 9BDE4C52D7F for ; Sat, 17 Aug 2024 12:38:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8EE6C6B038A; Sat, 17 Aug 2024 08:38:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 87A126B038F; Sat, 17 Aug 2024 08:38:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 67B696B038C; Sat, 17 Aug 2024 08:38:10 -0400 (EDT) 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 44F926B038A for ; Sat, 17 Aug 2024 08:38:10 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A563E1C2D24 for ; Sat, 17 Aug 2024 12:38:09 +0000 (UTC) X-FDA: 82461689898.22.EDED374 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by imf26.hostedemail.com (Postfix) with ESMTP id D0B17140003 for ; Sat, 17 Aug 2024 12:38:07 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Qhdo9RAy; spf=pass (imf26.hostedemail.com: domain of mjguzik@gmail.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=mjguzik@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723898228; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=BbZmF9tOucLancvvkfZPaX47E5zKJzvRx4MlcTZ1+9I=; b=q75xrT8tqQkJAyZag6xKAEYFqlVoD5aUg8oyG17FGhAI+denmC5FQWjer8REUUXBRTbCnn NjJSKj3MNNqaCAw6STRzmX17937c/+SbEw4QKea6l9eN8ZPQofrkQsqxjL40/MVlOw7MYb pNZKMZUQUecmk6pVYd39VfFA2E3VG0w= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Qhdo9RAy; spf=pass (imf26.hostedemail.com: domain of mjguzik@gmail.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=mjguzik@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723898228; a=rsa-sha256; cv=none; b=QWJA9c+4d3wdYJUdslfOEp/St6QEB26Y0V0uEwEOgMq+ViDoPz5AskeLTC6KmClK4C1Rq/ vTtfNbj3jzTpb7w3QOgqZjfTHr9QuHcLGtzShUyBMd/08TlXpNlvn5YKhvhzNA6lZwL0Wk 8oYJPYJU9gY995Bt0ogEsv3QVH04N44= Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-371afae614aso211178f8f.0 for ; Sat, 17 Aug 2024 05:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723898286; x=1724503086; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=BbZmF9tOucLancvvkfZPaX47E5zKJzvRx4MlcTZ1+9I=; b=Qhdo9RAymsZh135m92r4wcXIrF+0gqr8Kid/mzmWaI1Yd3ZSqkCpuXQqh0PN0ksk+m /47VHRmc55TXJIxkI4BjWXM74b1adW1RsMySKsMvJIAc0fuqByUllQf5fQY3P8pN69ed 8E1VHHv2BdIpAU4GSZF/sj64Fp9BSU0G9SbNXlNsg01RuC64cd6KqzjeVCGm6vRaAP2v RL4fHJb+/waxDXFms+W3bOySURuuQa3Fl303EzNm86QsHh23BHNloEiT2hSnOp90r6ak QIm3yjK2NDBG2Kzt2NXUqKcPMCejGcbPas6zuCYbLjdaoVGkAVxZ7y/HrdfYw3lxTWrb cMPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723898286; x=1724503086; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BbZmF9tOucLancvvkfZPaX47E5zKJzvRx4MlcTZ1+9I=; b=XLEQdduZVr2ICbGPGaqR7I9meoJ1X9B/hz6/62GmfaWGm1v2sW9wwt7w4IeStNYqgF n866bnY5dAJkUYTpoApMC2emUI65ZtJFojjNfANPuIj/fL63OQvIWlBn7E/9oX1PDEVV sRxH2PMsMqu/Iznhue5VV/SKT8L1wjjGqaPis7p4V9sWsdk5XwPM1nj4hoOx3lQYA4RU zoPqjsYFI0IWPAkBb5GH5aBJswFAuYbBIBE84IIFCqhF2+5FpvV4hqhUnN8flEnlUY/3 lMMPvJZ6qXWMqKtelUH6YplmaYvWnNbIgjq0itFcImAMUG4LsQPOlMgL8jZI8NuL2kdu U5NA== X-Forwarded-Encrypted: i=1; AJvYcCU7sjWP1GxGsR0i5iRvphYJ99GsUU8hN8G93Z9zmc7d6iJYEoV+03XJaqPZwfFtOzp9EsMkp2kZNJrS69IACV93ZIU= X-Gm-Message-State: AOJu0YyP+rcxU1mYAFcUywa/p1mD3BelMQ1m2q3MuzNkww7AFKYByXGQ X/hFDh5HNvpMpp8SaOcCCOUJ2p7RvCkGcnSr99Iq2Q96oSZUktUF X-Google-Smtp-Source: AGHT+IGK544d35dZ7nJ9p88TgfEC+/D0NCs0IaJprQDCIC4UoZ9JkQo+jVI1FypDAfOu1eZt7fBesA== X-Received: by 2002:adf:f285:0:b0:371:888d:7aaa with SMTP id ffacd0b85a97d-371946b1ae9mr3259001f8f.49.1723898285837; Sat, 17 Aug 2024 05:38:05 -0700 (PDT) Received: from f.. (cst-prg-76-86.cust.vodafone.cz. [46.135.76.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37189897034sm5822436f8f.67.2024.08.17.05.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Aug 2024 05:38:05 -0700 (PDT) From: Mateusz Guzik To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mateusz Guzik Subject: [PATCH] ratelimit: convert flags to int to save 8 bytes in size Date: Sat, 17 Aug 2024 14:37:54 +0200 Message-ID: <20240817123754.240924-1-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Stat-Signature: b6aw1csco36kxx68yppkzf4oiqtiuwc7 X-Rspam-User: X-Rspamd-Queue-Id: D0B17140003 X-Rspamd-Server: rspam02 X-HE-Tag: 1723898287-156079 X-HE-Meta: U2FsdGVkX19ZgRIAe1nelZLlkCzVqCTMEAAUqkIJnbK/6jATy57vexZxAolIG0AdQ6nrdAFcOMRnGlTqBnySuS1/ffZHvSkK5akplc7Y8d5Y5cOB4r3sth40pG/NuKdX3EqoYRcUEwaITMiKfjXypqHfxF+1rMQIdQpqTtASivSuxgVKCWZdln+YRWl0qeHQATD49IHMpuMGskyhXxhHNzh9g12WkhcODcr8rU+72vxJ/+VdE9NxB30QoRthj3C4QzqU4Ev3n0IPM4rUWaPh5+8m2r709VOVVp/oc7m0YhWJGZW8mWeb/X4DC/G+s8hR13hOu/3cFKmlgl0YOQNVWgSEiC0gfofG8fSsmJRZvRKWLbPJkDrk1Q4JubDh+7gwDO4ePh8DPur6tCxoWk4C3DigrncC5oR8PfbF7JpD49Wgodmmg6GuxW0j67u6VT0Pz2ELzwWyG65A8G91GwxnSNHreRzEdZiYSExTUpoKFmoUMofFSEuSAe12hKV5x/NCyeKv6c+DYs+7IgYptE9tkW86AN4CO9MePdrtyf3AJUmPTyFp2jvh20pMJe7YxZQ1jmX2cbXOfCtUvxSFifi1bSL1ID+xv+K0oPdBSG3Htcc7pD4WtH4FNMeqIcpKS8H2p4jFlQgup4QYRNZbfUpELm30MiNzF/Ukoq1I0mUwbI2cMgdPrWbh7VXHmuXfsxgJAfb7YBkUBvwYq6nfF3y04zTViUjnng0T0um1ibLbZ5CM5nK6AGSG6HpMuqITTI2CC/2nKFOdABEp9udu/VbFZTUtOc3DnBBEEjuYlxVdBYrCRfy7+ecF8xouA7h6yLVHOsnmtvQ0IoeakvdqEQlU4Ey+5eMply0LYyEE1jEWYB1iCR5w0BzvCycOVSGyXWkZpdAk6qBXcODgsz1ON7uHD1ndufXR+B7p4kaJFyb8cGOgZftXfz9YudT8WMwLyDwtiy06pdmh40iOYRiU2sN WIgHzkyT EFKRy/y6wRBHs3TBzg3C60GYZeWBDFX3dUj39+A4mkzglcERXR47fFP7MxpRM7o1Z1/KOpmNHZyJjTITauErsx1RkLEApwnpuKeXrZQ62e5/Mej9e2CQPns8wU+ziGYfMOtaSMdi0vL7fV0KacD14lT0eyYf+Hoqw9yo5ndd0zE7LFqpySCi/ObIyF2jbdCqVCZO5P4kJEuIK4vCWPnZNO1Bk9JYTY8zEfviHP10gpltlcXjjalZtoUcUf+mQyhMY2LzqoC9WwO46u4ul9vNdM2DSqZCQRkM9UtVCthR1x+D8bmI2n0Tmpymz3pK7yNwphHnsN47dqUoLPM5c6TUIFg9hgk1LaWcYjV/j 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: List-Subscribe: List-Unsubscribe: Only bit 1 is used, making an unsigned long a total overkill. This brings it from 64 to 32 bytes, which in turn shrinks user_struct from 136 to 128 bytes. Since the latter is allocated with hwalign, this means the total usage goes down from 192 to 128 bytes per object. No functional changes. Signed-off-by: Mateusz Guzik --- ./scripts/get_maintainer.pl --git was most unhelpful showing nothing I have no idea who to prod about it, I think it is pretty trivial not needing any discussion. Andrew Morton pulled in some of the changes to the file, so that's my primary recipient. include/linux/ratelimit_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/ratelimit_types.h b/include/linux/ratelimit_types.h index 002266693e50..765232ce0b5e 100644 --- a/include/linux/ratelimit_types.h +++ b/include/linux/ratelimit_types.h @@ -19,8 +19,8 @@ struct ratelimit_state { int burst; int printed; int missed; + unsigned int flags; unsigned long begin; - unsigned long flags; }; #define RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, flags_init) { \