Skip to contentSkip to conversation

linux-next: build failure after merge of the net-next tree

DISCUSSION Stephen Rothwell 2 participants 4 messages Mar 1, 2024 – Mar 5, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the net-next tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

In file included from <command-line>:
In function 'tcp_struct_check',

    inlined from 'tcp_init' at net/ipv4/tcp.c:4700:2:

include/linux/compiler_types.h:442:45: error: call to '__compiletime_assert_940' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct tcp_sock, __cacheline_group_end__tcp_sock_write_rx) - offsetofend(struct tcp_sock, __cacheline_group_begin__tcp_sock_write_rx) > 99
442 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:423:25: note: in definition of macro '__compiletime_assert'

  423 |                         prefix ## suffix();                             \
      |                         ^~~~~~
include/linux/compiler_types.h:442:9: note: in expansion of macro '_compiletime_assert'
  442 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
   50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
      |         ^~~~~~~~~~~~~~~~
include/linux/cache.h:108:9: note: in expansion of macro 'BUILD_BUG_ON'
  108 |         BUILD_BUG_ON(offsetof(TYPE, __cacheline_group_end__##GROUP) - \
      |         ^~~~~~~~~~~~
net/ipv4/tcp.c:4687:9: note: in expansion of macro 'CACHELINE_ASSERT_GROUP_SIZE'
 4687 |         CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_rx, 99);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Caused by commit

99123622050f ("tcp: remove some holes in struct tcp_sock")

I have reverted that commit for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 31 lines · Stephen Rothwell

Hi all,

After merging the net-next tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

In file included from <command-line>:
In function 'tcp_struct_check',

    inlined from 'tcp_init' at net/ipv4/tcp.c:4700:2:

include/linux/compiler_types.h:442:45: error: call to '__compiletime_assert_940' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct tcp_sock, __cacheline_group_end__tcp_sock_write_rx) - offsetofend(struct tcp_sock, __cacheline_group_begin__tcp_sock_write_rx) > 99
442 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:423:25: note: in definition of macro '__compiletime_assert'

  423 |                         prefix ## suffix();                             \
      |                         ^~~~~~
include/linux/compiler_types.h:442:9: note: in expansion of macro '_compiletime_assert'
  442 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
   50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
      |         ^~~~~~~~~~~~~~~~
include/linux/cache.h:108:9: note: in expansion of macro 'BUILD_BUG_ON'
  108 |         BUILD_BUG_ON(offsetof(TYPE, __cacheline_group_end__##GROUP) - \
      |         ^~~~~~~~~~~~
net/ipv4/tcp.c:4687:9: note: in expansion of macro 'CACHELINE_ASSERT_GROUP_SIZE'
 4687 |         CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_rx, 99);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 6 lines

Caused by commit

99123622050f ("tcp: remove some holes in struct tcp_sock")

I have reverted that commit for today.

I have no idea. Maybe this arch has some unusual alignments on u64/u32/u16 fields ?

The patch should not have changed tcp_sock_write_rx group...

My patch reduced tcp_sock_write_tx on x86_64 from 113 to 105 bytes but I did not bother changing the assert,
because the assertion triggers if the size of the group is bigger than the numerical value.

So I could have added the following, but really did not bother.

net/ipv4/tcp.c +0 -0
index c82dc42f57c65df112f79080ff407cd98d11ce68..7e1b848398d04f2da2a91c3af97b1e2e3895b8ee

100644

net/ipv4/tcp.c +0 -0
@@ -4651,7 +4651,7 @@ static void __init tcp_struct_check(void)
        CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,

tcp_sock_write_tx, tsorted_sent_queue);
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,
tcp_sock_write_tx, highest_sack);
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,
tcp_sock_write_tx, ecn_flags);
- CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_tx, 113);
+ CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_tx, 105);

        /* TXRX read-write hotpath cache lines */
        CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,

tcp_sock_write_txrx, pred_flags);

#2 lore raw
Quoted 43 lines · Eric Dumazet
Quoted 31 lines · Stephen Rothwell

Hi all,

After merging the net-next tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

In file included from <command-line>:
In function 'tcp_struct_check',

    inlined from 'tcp_init' at net/ipv4/tcp.c:4700:2:

include/linux/compiler_types.h:442:45: error: call to '__compiletime_assert_940' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct tcp_sock, __cacheline_group_end__tcp_sock_write_rx) - offsetofend(struct tcp_sock, __cacheline_group_begin__tcp_sock_write_rx) > 99
442 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:423:25: note: in definition of macro '__compiletime_assert'

  423 |                         prefix ## suffix();                             \
      |                         ^~~~~~
include/linux/compiler_types.h:442:9: note: in expansion of macro '_compiletime_assert'
  442 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
   50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
      |         ^~~~~~~~~~~~~~~~
include/linux/cache.h:108:9: note: in expansion of macro 'BUILD_BUG_ON'
  108 |         BUILD_BUG_ON(offsetof(TYPE, __cacheline_group_end__##GROUP) - \
      |         ^~~~~~~~~~~~
net/ipv4/tcp.c:4687:9: note: in expansion of macro 'CACHELINE_ASSERT_GROUP_SIZE'
 4687 |         CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_rx, 99);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 6 lines

Caused by commit

99123622050f ("tcp: remove some holes in struct tcp_sock")

I have reverted that commit for today.

I have no idea. Maybe this arch has some unusual alignments on u64/u32/u16 fields ?

Quoted 7 lines

The patch should not have changed tcp_sock_write_rx group...

My patch reduced tcp_sock_write_tx on x86_64 from 113 to 105 bytes but I did not bother changing the assert,
because the assertion triggers if the size of the group is bigger than the numerical value.

OK, I think the issue is caused by a hole at the start of tcp_sock_write_rx group

I will send this patch for review, thanks !

include/linux/tcp.h +0 -0
index 988a30ef6bfe956fa573f1f18c8284aa382dc1cc..55399ee2a57e736b55ed067fc06ea620bbe62fd3

100644

include/linux/tcp.h +1 -1
@@ -304,7 +304,7 @@ struct tcp_sock {
        __cacheline_group_end(tcp_sock_write_txrx);
 
        /* RX read-write hotpath cache lines */
-       __cacheline_group_begin(tcp_sock_write_rx);
+       __cacheline_group_begin(tcp_sock_write_rx) __aligned(8);
        u64     bytes_received;
                                /* RFC4898 tcpEStatsAppHCThruOctetsReceived
                                 * sum(delta(rcv_nxt)), or how many bytes
net/ipv4/tcp.c +0 -0
index c82dc42f57c65df112f79080ff407cd98d11ce68..7e1b848398d04f2da2a91c3af97b1e2e3895b8ee

100644

net/ipv4/tcp.c +0 -0
@@ -4651,7 +4651,7 @@ static void __init tcp_struct_check(void)
        CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,

tcp_sock_write_tx, tsorted_sent_queue);
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,
tcp_sock_write_tx, highest_sack);
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,
tcp_sock_write_tx, ecn_flags);
- CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_tx, 113);
+ CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_tx, 105);

        /* TXRX read-write hotpath cache lines */
        CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,

tcp_sock_write_txrx, pred_flags);

#3 lore raw

Hi Eric,

Quoted 35 lines · On Fri, 1 Mar 2024 10:54:19 +0100 Eric Dumazet <[email protected]> wrote:

OK, I think the issue is caused by a hole at the start of tcp_sock_write_rx group

I will send this patch for review, thanks !

include/linux/tcp.h +0 -0
index 988a30ef6bfe956fa573f1f18c8284aa382dc1cc..55399ee2a57e736b55ed067fc06ea620bbe62fd3

100644

include/linux/tcp.h +1 -1
@@ -304,7 +304,7 @@ struct tcp_sock {
        __cacheline_group_end(tcp_sock_write_txrx);
 
        /* RX read-write hotpath cache lines */
-       __cacheline_group_begin(tcp_sock_write_rx);
+       __cacheline_group_begin(tcp_sock_write_rx) __aligned(8);
        u64     bytes_received;
                                /* RFC4898 tcpEStatsAppHCThruOctetsReceived
                                 * sum(delta(rcv_nxt)), or how many bytes
net/ipv4/tcp.c +0 -0
index c82dc42f57c65df112f79080ff407cd98d11ce68..7e1b848398d04f2da2a91c3af97b1e2e3895b8ee

100644

net/ipv4/tcp.c +1 -1
@@ -4651,7 +4651,7 @@ static void __init tcp_struct_check(void)
        CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,
 tcp_sock_write_tx, tsorted_sent_queue);
        CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,
 tcp_sock_write_tx, highest_sack);
        CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,
 tcp_sock_write_tx, ecn_flags);
-       CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_tx, 113);
+       CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_write_tx, 105);
Quoted 3 lines
        /* TXRX read-write hotpath cache lines */
        CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock,

tcp_sock_write_txrx, pred_flags);

I will apply this patch to them merge of the net-next tree until it is applied there.

Signature · 2 lines
Cheers,
Stephen Rothwell