Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3247002rdb; Thu, 16 Nov 2023 04:43:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHDGlA2iRoi92rx5o5vwKKlWyqXP/kJex0jB73lgzu1fgl8kAh58Rj90Lu6VukYdvhdJ9jJ X-Received: by 2002:a17:90b:1a8c:b0:27d:882f:e6c5 with SMTP id ng12-20020a17090b1a8c00b0027d882fe6c5mr14207443pjb.9.1700138580271; Thu, 16 Nov 2023 04:43:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700138580; cv=none; d=google.com; s=arc-20160816; b=FEdRKup1ly6n8DSyGnum1jdtvC/QKqZnWzlVBqS4Jb4mLCprSKTXTtnQg3y/sXCMa8 xQbPG1RwqB6VYO5JjKXLa50T08338A/zkVFP5BI0HwSBFoWhZc6G4Tsf31k7XJHZXQtb IFlfgFPjBAh3E9Qbb4ZQ04EGqw8oDTwGE1fugIgs47RmF2hN42q5zmaPuJV/CvO+Dr2g FCVZ5BQ5SAHtDnHrZiU8qWOWhvdDWyuUO7OK5ILbPhvLLudv8s7lJqNTpy7t1Rq2K96/ fKGGB5zCiS9DjfMY8lkfFX5VkU4C3VbM3oqk9BSyto1O6dQj4Dy64nhNcrRmRI1zAHuD zUQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=h0cgDtlCn3yVws2N/gdlQc9Ry1b50ay82U2VPVFHUd8=; fh=yaWfQqSjEUYxK6/4FpRqyuI+iwm17HeTF+Pa2r7sxwI=; b=FMs4lfkQ5l3xbmvtaa9peCzE52tOPDmEpgbxFdL2e/Crdiy8mK7Py68SUxHMH3Vm9n 9myaVNor0kyiVrga+nsfE0PJDgLQUc7uPbOXT7xkB9tsQ6txzhVoadYT+Ex9FiSrjuyn lt0NhPLuPwKdLshaoP63omOtlw3PI//vXrnbdGfIymgMd0DRTh9Gnmj0BmgTu1GP6TN1 yYaHDP/q3HaEi0DMU40iZowiqa5ZqU0todAQ1lLaQQOX0n/bmZQlEJQVbgRqH8xEiv9h xoFOshVCwdWskquZSWsJzRV3N6OjZO3/fFdeDJcuVC+xpMXVzV6Xikvs2c8RHEFuhUuC BT3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eTZ5IJOL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id gm23-20020a17090b101700b002773cc10d3csi2003078pjb.78.2023.11.16.04.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 04:43:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eTZ5IJOL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F35A6804F630; Thu, 16 Nov 2023 04:42:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344966AbjKPMm0 (ORCPT + 99 others); Thu, 16 Nov 2023 07:42:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345142AbjKPMm0 (ORCPT ); Thu, 16 Nov 2023 07:42:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE60F193 for ; Thu, 16 Nov 2023 04:42:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700138540; h=from:from: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=h0cgDtlCn3yVws2N/gdlQc9Ry1b50ay82U2VPVFHUd8=; b=eTZ5IJOL0qAyuOJeSlxvzvw2IUHYPSwyYhHinJk+s3VcnNXOAPE9T+GmP29nI856npIAA2 Bfi99OYSwcPBXpq044zEiJdMwZkUMfh+J/h5l1TZvocDUnc0O82biZdPAZgSsnPeyzU9Mu NeoRMN2rNn3q1X7RvrwhGm7/omg7Z8U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-210-cunVPJq3M0ikTpkJFsMo_w-1; Thu, 16 Nov 2023 07:42:17 -0500 X-MC-Unique: cunVPJq3M0ikTpkJFsMo_w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 15A2B8058ED; Thu, 16 Nov 2023 12:42:17 +0000 (UTC) Received: from [10.22.16.205] (unknown [10.22.16.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id C95041C060B5; Thu, 16 Nov 2023 12:42:16 +0000 (UTC) Message-ID: Date: Thu, 16 Nov 2023 07:42:16 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] lockdep: optimise "struct lock_class" layout Content-Language: en-US To: Alexey Dobriyan , Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng Cc: linux-kernel@vger.kernel.org References: From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 04:42:30 -0800 (PST) On 11/16/23 06:25, Alexey Dobriyan wrote: > struct lock_class does > > const struct lock_trace * usage_traces[]; > int name_version; > const char * name; > > which wastes 4 bytes after "name_version". > > Put pointer after pointers shrinking sizeof from 208 bytes to 200 bytes. > Space savings are considerable for such a trivial patch: > > $ ./scripts/bloat-o-meter ../vmlinux-000 ../obj/vmlinux > add/remove: 0/0 grow/shrink: 1/11 up/down: 2/-65640 (-65638) > Function old new delta > check_irq_usage 2852 2854 +2 > reacquire_held_locks 486 484 -2 > lock_chain_get_class 41 39 -2 > l_start 34 32 -2 > check_noncircular 276 274 -2 > print_usage_bug.part 688 683 -5 > print_circular_bug 1017 1011 -6 > hlock_conflict 141 135 -6 > print_deadlock_bug 944 935 -9 > mark_lock 3791 3769 -22 > __lock_acquire 9801 9753 -48 > lock_classes 1703936 1638400 -65536 > Total: Before=21163908, After=21098270, chg -0.31% > > Signed-off-by: Alexey Dobriyan > --- > > include/linux/lockdep_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/include/linux/lockdep_types.h > +++ b/include/linux/lockdep_types.h > @@ -127,12 +127,12 @@ struct lock_class { > unsigned long usage_mask; > const struct lock_trace *usage_traces[LOCK_TRACE_STATES]; > > + const char *name; > /* > * Generation counter, when doing certain classes of graph walking, > * to ensure that we check one node only once: > */ > int name_version; > - const char *name; > > u8 wait_type_inner; > u8 wait_type_outer; > LGTM. Acked-by: Waiman Long