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 74B26377 for ; Fri, 22 Sep 2023 01:51:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5126FC433C8; Fri, 22 Sep 2023 01:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695347462; bh=tO499MJh0Rmss4aq5EkxYyocXf/RBJNFYcxNU66BgZ0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DedHTISbGl1Riy18bkpDUE2V1L8tCAl347+qvXyDNjcqd6UoXQPkXJ/T6hLBMCPdh GQHrEdXGfqqInls/ng/5jvcyukR/1kpUN2L6M7JaDGd1Om913kWjs9EyHORdrViNQc 9lf5etLiFOUw9tWjUS0d85P7/uHrycgcG98cFeO1b+z0hjtO1rJc8+t8icXqcCt0lK NFs6pPuMQOQOvHKbwp2sRbqi9N0ee0AYJ4vVSM5UyXRJjk1zBZ8tmev8LlD2n6ka/6 eZEuzD2I8YXE0rBxgEaf5VK74NicMJHFo0qOfKofFhk2d8Ps+wyAx+Acnb7cpYsCXR 7wP1qJrTSBb8A== Message-ID: Date: Thu, 21 Sep 2023 19:51:01 -0600 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCHv3 net 1/2] fib: convert fib_nh_is_v6 and nh_updated to use a single bit Content-Language: en-US To: Hangbin Liu Cc: netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Ido Schimmel , Benjamin Poirier , Thomas Haller , Stephen Hemminger , Eric Dumazet , Nicolas Dichtel , Ido Schimmel References: <20230921031409.514488-1-liuhangbin@gmail.com> <20230921031409.514488-2-liuhangbin@gmail.com> <21c58c78-1b76-745a-0a12-7532a569374b@kernel.org> From: David Ahern In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 9/21/23 7:29 PM, Hangbin Liu wrote: > On Thu, Sep 21, 2023 at 07:03:20AM -0600, David Ahern wrote: >> On 9/20/23 9:14 PM, Hangbin Liu wrote: >>> The FIB info structure currently looks like this: >>> struct fib_info { >>> struct hlist_node fib_hash; /* 0 16 */ >>> [...] >>> u32 fib_priority; /* 80 4 */ >>> >>> /* XXX 4 bytes hole, try to pack */ >>> >>> struct dst_metrics * fib_metrics; /* 88 8 */ >>> int fib_nhs; /* 96 4 */ >>> bool fib_nh_is_v6; /* 100 1 */ >>> bool nh_updated; /* 101 1 */ >>> >>> /* XXX 2 bytes hole, try to pack */ >> >> 2B hole here and you want to add a single flag so another bool. I would >> prefer the delay to a bitfield until all holes are consumed. >> > > OK, just in case I didn't misunderstand. I should add a `bool pfsrc_removed` > here and drop the first patch, right? yes. The bitfield has higher overhead. Let's reserve that overhead to when there are no more holes and a new field pushes the struct over 128B.