Skip to contentSkip to conversation

EXT4 panic at jbd2_journal_put_journal_head() in 3.9+

DISCUSSION EUNBONG SONG 4 participants 5 messages May 13, 2013

lore
Share & tools
lore
#0 lore raw
Quoted 21 lines

CONFIG_IA64_PAGE_SIZE_64KB=y

fsblock size is whatever is the default for SLES11SP2 on ia64 - which tool will tell me?

My git bisect finally competed and points the a finger at:

bisect> git bisect good ae4647fb7654676fc44a97e86eb35f9f06b99f66 is first bad commit commit ae4647fb7654676fc44a97e86eb35f9f06b99f66

Author: Jan Kara 
Date:   Fri Apr 12 00:03:42 2013 -0400

jbd2: reduce journal_head size

Remove unused t_cow_tid field (ext4 copy-on-write support doesn't seem to be happening) and change b_modified and b_jlist to bitfields thus saving 8 bytes in the structure.

Quoted 6 lines
Signed-off-by Jan Kara
Signed-off-by "Theodore Ts'o"
Reviewed-by Zheng Liu

:040000 040000 c39ece4341894b3daf84764ba425a87ffb90fe50
d4e8d9185c2a1b740c235ca8ed05d496a442fce3 M include

Hi, my git bisect result is same yours. And i reported that to community yesterday. Thanks.

#1 lore raw
Quoted 1 line · EUNBONG SONG

Hi, my git bisect result is same yours. And i reported that to community yesterday.

Ah. Good to have some confirmation (I was never sure how long to keep running before deciding that a test was "good". My slowest "bad" test took about 2.5 hours. I mostly let the tests run for >6 hours before deciding.

I just confirmed that 3.10-rc1 still fails (30 minutes). Now running a test on 3.10-rc1 with just this commit reverted. Only been going for about 15 minutes, so no useful information yet.

My best guess as to why this commit causes problems is that there are places where updates to individual fields in this structure used to be independent because they were to whole words. Now we have bitfileds there are races between access to different fields in the same word.

-Tony

#2 lore raw
Quoted 5 lines · Tony Luck

My best guess as to why this commit causes problems is that there are places where updates to individual fields in this structure used to be independent because they were to whole words. Now we have bitfileds there are races between access to different fields in the same word.

Yeah, except we access the fields while holding a lock.... wait a minute. We're using bit_spinlocks().... and am I missing something?

Where are the barrier statements to prevent the CPU or the compiler from reordering statements around bit_spin_lock()? But if that's the problem, I would have expected lots of other things to be broken.

- Ted

#3 lore raw
Quoted 7 lines · Theodore Ts'o
Quoted 5 lines · Tony Luck

My best guess as to why this commit causes problems is that there are places where updates to individual fields in this structure used to be independent because they were to whole words. Now we have bitfileds there are races between access to different fields in the same word.

Quoted 6 lines

Yeah, except we access the fields while holding a lock.... wait a minute. We're using bit_spinlocks().... and am I missing something?

Where are the barrier statements to prevent the CPU or the compiler from reordering statements around bit_spin_lock()? But if that's the problem, I would have expected lots of other things to be broken.

Those use test_and_set_bit(), which per Paul McMemory-Wizard...

ATOMIC OPERATIONS
-----------------

Whilst they are technically interprocessor interaction considerations, atomic operations are noted specially as some of them imply full memory barriers and some don't, but they're very heavily relied on as a group throughout the kernel.

Any atomic operation that modifies some state in memory and returns information about the state (old or new) implies an SMP-conditional general memory barrier (smp_mb()) on each side of the actual operation (with the exception of explicit lock operations, described later). These include:

        xchg();
        cmpxchg();
        atomic_xchg();
        atomic_cmpxchg();
        atomic_inc_return();
        atomic_dec_return();
        atomic_add_return();
        atomic_sub_return();
        atomic_inc_and_test();
        atomic_dec_and_test();
        atomic_sub_and_test();
        atomic_add_negative();
        atomic_add_unless();    /* when succeeds (returns 1) */
        test_and_set_bit();
        test_and_clear_bit();
        test_and_change_bit();
#4 lore raw

The 3.10-rc1 with ae4647fb765467 reverted is still running OK. At 3 hours now (only marginally longer that the 2.5 hours that one of the "bad" runs during the bisect managed). So I'm about 30% sure that we have a winner at the moment. I'll leave it running and check again in the morning. This penguin is heading to bed now.

-Tony