Skip to contentSkip to conversation

XFS long delays on disk full

DISCUSSION Andi Kleen 2 participants 5 messages Jul 18, 2018 – Jul 25, 2018

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

Hi,

I was doing some testing on a 4.18-rc1 kernel, and a single threaded test wrote a fairly large file to a XFS file system, causing it to fill up.

After that the process hung in D state for a long time, and only recovered after several minutes. Here's the backtrace during the hang:

[<0>] wb_wait_for_completion+0x5e/0x90
[<0>] sync_inodes_sb+0xc9/0x290
[<0>] xfs_flush_inodes+0x25/0x30 [xfs]
[<0>] xfs_file_buffered_aio_write+0x2be/0x300 [xfs]
[<0>] __vfs_write+0x114/0x1a0
[<0>] vfs_write+0xad/0x1a0
[<0>] ksys_write+0x52/0xc0
[<0>] do_syscall_64+0x5b/0x160
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

[<0>] 0xffffffffffffffff

There were no IO errors or similar.

Expected? Already fixed?

Thanks,
-Andi

#1 lore raw
Quoted 6 lines · Andi Kleen

Hi,

I was doing some testing on a 4.18-rc1 kernel, and a single threaded test wrote a fairly large file to a XFS file system, causing it to fill up.

Quoted 6 lines

After that the process hung in D state for a long time, and only recovered after several minutes. Here's the backtrace during the hang:

[<0>] wb_wait_for_completion+0x5e/0x90
[<0>] sync_inodes_sb+0xc9/0x290

Hmm, these two:

Quoted 2 lines
[<0>] xfs_flush_inodes+0x25/0x30 [xfs]
[<0>] xfs_file_buffered_aio_write+0x2be/0x300 [xfs]

Offhand I'd guess (while awayish at OSCON) that the fs hit ENOSPC while trying to write() the file so now we're scanning the fs like mad trying to free up space preallocations from any open file in the fs.

How big is the fs, how big is the file, how many inodes, how many are open, which kernel?

--D

Quoted 18 lines
[<0>] __vfs_write+0x114/0x1a0
[<0>] vfs_write+0xad/0x1a0
[<0>] ksys_write+0x52/0xc0
[<0>] do_syscall_64+0x5b/0x160
[<0>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

[<0>] 0xffffffffffffffff

There were no IO errors or similar.

Expected? Already fixed?

Thanks,
-Andi

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw
Quoted 19 lines · Darrick J. Wong
Quoted 6 lines · Andi Kleen

Hi,

I was doing some testing on a 4.18-rc1 kernel, and a single threaded test wrote a fairly large file to a XFS file system, causing it to fill up.

Quoted 6 lines

After that the process hung in D state for a long time, and only recovered after several minutes. Here's the backtrace during the hang:

[<0>] wb_wait_for_completion+0x5e/0x90
[<0>] sync_inodes_sb+0xc9/0x290

Hmm, these two:

Quoted 2 lines
[<0>] xfs_flush_inodes+0x25/0x30 [xfs]
[<0>] xfs_file_buffered_aio_write+0x2be/0x300 [xfs]
Quoted 6 lines

Offhand I'd guess (while awayish at OSCON) that the fs hit ENOSPC while trying to write() the file so now we're scanning the fs like mad trying to free up space preallocations from any open file in the fs.

How big is the fs, how big is the file, how many inodes, how many are open, which kernel?

Kernel 2.18-rc1

/dev/sdb1 233G 211G 23G 91% /data
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sdb1 90M 59K 89M 1% /data

Very few files were open. The file was ~23G as it filled up the file (I now deleted it)

-Andi

#3 lore raw
Quoted 27 lines · Andi Kleen
Quoted 19 lines · Darrick J. Wong
Quoted 6 lines · Andi Kleen

Hi,

I was doing some testing on a 4.18-rc1 kernel, and a single threaded test wrote a fairly large file to a XFS file system, causing it to fill up.

Quoted 6 lines

After that the process hung in D state for a long time, and only recovered after several minutes. Here's the backtrace during the hang:

[<0>] wb_wait_for_completion+0x5e/0x90
[<0>] sync_inodes_sb+0xc9/0x290

Hmm, these two:

Quoted 2 lines
[<0>] xfs_flush_inodes+0x25/0x30 [xfs]
[<0>] xfs_file_buffered_aio_write+0x2be/0x300 [xfs]
Quoted 6 lines

Offhand I'd guess (while awayish at OSCON) that the fs hit ENOSPC while trying to write() the file so now we're scanning the fs like mad trying to free up space preallocations from any open file in the fs.

How big is the fs, how big is the file, how many inodes, how many are open, which kernel?

Quoted 8 lines

Kernel 2.18-rc1

/dev/sdb1 233G 211G 23G 91% /data
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sdb1 90M 59K 89M 1% /data

Very few files were open. The file was ~23G as it filled up the file (I now deleted it)

Yep, that looks like xfs scraping around trying to find space when the fs is nearly full.

--D

Quoted 7 lines

-Andi

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#4 lore raw
Quoted 2 lines

Yep, that looks like xfs scraping around trying to find space when the fs is nearly full.

Okay. Not sure what it is doing. The disk isn't that large after all, and it's not clear why it takes that long to check a few AGs.

Can something be done about it?

It would be good enough for me if it was interruptible, so that Ctrl-C just worked.

-Andi