1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
Commit graph

249344 commits

Author SHA1 Message Date
Graham Christensen ece5c0f304
stage-1: modprobe ext{2,3,4} before resizing
I noticed booting a system with an ext4 root which expanded to 5T took
quite a long time (12 minutes in some cases, 43(!) in others.)

I changed stage-1 to run `resize2fs -d 62` for extra debug output and
timing information. It revealed the adjust_superblock step taking
almost all of the time:

    [Fri Oct 30 11:10:15 UTC 2020] zero_high_bits_in_metadata: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
    [Fri Oct 30 11:21:09 UTC 2020] adjust_superblock: Memory used: 396k/4556k (295k/102k), time: 654.21/ 0.59/ 5.13

but when I ran resize2fs on a disk with the identical content growing
to the identical target size, it would only take about 30 seconds. I
looked at what happened between those two steps in the fast case with
strace and found:

```
   235	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=1795}, ru_stime={tv_sec=0, tv_usec=3590}, ...}) = 0
   236	write(1, "zero_high_bits_in_metadata: Memo"..., 84zero_high_bits_in_metadata: Memory used: 132k/0k (72k/61k), time:  0.00/ 0.00/ 0.00
   237	) = 84
   238	gettimeofday({tv_sec=1604061278, tv_usec=480147}, NULL) = 0
   239	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=1802}, ru_stime={tv_sec=0, tv_usec=3603}, ...}) = 0
   240	gettimeofday({tv_sec=1604061278, tv_usec=480192}, NULL) = 0
   241	mmap(NULL, 2564096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa3c7355000
   242	access("/sys/fs/ext4/features/lazy_itable_init", F_OK) = 0
   243	brk(0xf85000)                           = 0xf85000
   244	brk(0xfa6000)                           = 0xfa6000
   245	gettimeofday({tv_sec=1604061278, tv_usec=538828}, NULL) = 0
   246	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=58720}, ru_stime={tv_sec=0, tv_usec=3603}, ...}) = 0
   247	write(1, "adjust_superblock: Memory used: "..., 79adjust_superblock: Memory used: 396k/2504k (305k/92k), time:  0.06/ 0.06/ 0.00
   248	) = 79
   249	gettimeofday({tv_sec=1604061278, tv_usec=539119}, NULL) = 0
   250	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=58812}, ru_stime={tv_sec=0, tv_usec=3603}, ...}) = 0
   251	gettimeofday({tv_sec=1604061279, tv_usec=939}, NULL) = 0
   252	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=520411}, ru_stime={tv_sec=0, tv_usec=3603}, ...}) = 0
   253	write(1, "fix_uninit_block_bitmaps 2: Memo"..., 88fix_uninit_block_bitmaps 2: Memory used: 396k/2504k (305k/92k), time:  0.46/ 0.46/ 0.00
   254	) = 88
```

In particular the access to /sys/fs seemed interesting. Looking
at the source of resize2fs:

```
[root@ip-172-31-22-182:~/e2fsprogs-1.45.5]# rg -B2 -A1 /sys/fs/ext4/features/lazy_itable_init .
./resize/resize2fs.c
923-	if (getenv("RESIZE2FS_FORCE_LAZY_ITABLE_INIT") ||
924-	    (!getenv("RESIZE2FS_FORCE_ITABLE_INIT") &&
925:	     access("/sys/fs/ext4/features/lazy_itable_init", F_OK) == 0))
926-		lazy_itable_init = 1;
```

I confirmed /sys is mounted, and then found a bug suggesting the
ext4 module is maybe not loaded:
https://bugzilla.redhat.com/show_bug.cgi?id=1071909

My home server doesn't have ext4 loaded and had 3T to play with, so
I tried (and succeeded with) replicating the issue locally:

```
[root@kif:/scratch]# lsmod | grep -i ext

[root@kif:/scratch]# zfs create -V 3G rpool/scratch/ext4

[root@kif:/scratch]# time mkfs.ext4 /dev/zvol/rpool/scratch/ext4
mke2fs 1.45.5 (07-Jan-2020)
Discarding device blocks: done
Creating filesystem with 786432 4k blocks and 196608 inodes
Filesystem UUID: 560a4a8f-93dc-40cc-97a5-f10049bf801f
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

real	0m2.261s
user	0m0.000s
sys	0m0.025s

[root@kif:/scratch]# zfs set volsize=3T rpool/scratch/ext4

[root@kif:/scratch]# time resize2fs -d 62 /dev/zvol/rpool/scratch/ext4
resize2fs 1.45.5 (07-Jan-2020)
fs has 11 inodes, 1 groups required.
fs requires 16390 data blocks.
With 1 group(s), we have 22234 blocks available.
Last group's overhead is 10534
Need 16390 data blocks in last group
Final size of last group is 26924
Estimated blocks needed: 26924
Extents safety margin: 49
Resizing the filesystem on /dev/zvol/rpool/scratch/ext4 to 805306368 (4k) blocks.
read_bitmaps: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
read_bitmaps: I/O read: 1MB, write: 0MB, rate: 3802.28MB/s
fix_uninit_block_bitmaps 1: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
resize_group_descriptors: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
move_bg_metadata: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
zero_high_bits_in_metadata: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
```

here it got stuck for quite some time ... straceing this 20 minutes in revealed this in a tight loop:

```
getuid()                                = 0
geteuid()                               = 0
getgid()                                = 0
getegid()                               = 0
prctl(PR_GET_DUMPABLE)                  = 1 (SUID_DUMP_USER)
fallocate(3, FALLOC_FL_ZERO_RANGE, 2222649901056, 2097152) = 0
fsync(3)                                = 0
```

it finally ended 43(!) minutes later:

```
adjust_superblock: Memory used: 264k/3592k (210k/55k), time: 2554.03/ 0.16/15.07
fix_uninit_block_bitmaps 2: Memory used: 264k/3592k (210k/55k), time:  0.16/ 0.16/ 0.00
blocks_to_move: Memory used: 264k/3592k (211k/54k), time:  0.00/ 0.00/ 0.00
Number of free blocks: 755396/780023556, Needed: 0
block_mover: Memory used: 264k/3592k (216k/49k), time:  0.05/ 0.01/ 0.00
block_mover: I/O read: 1MB, write: 0MB, rate: 18.68MB/s
inode_scan_and_fix: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
inode_ref_fix: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
move_itables: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
calculate_summary_stats: Memory used: 264k/3592k (216k/49k), time: 16.35/16.35/ 0.00
fix_resize_inode: Memory used: 264k/3592k (222k/43k), time:  0.04/ 0.00/ 0.00
fix_resize_inode: I/O read: 1MB, write: 0MB, rate: 22.80MB/s
fix_sb_journal_backup: Memory used: 264k/3592k (222k/43k), time:  0.00/ 0.00/ 0.00
overall resize2fs: Memory used: 264k/3592k (222k/43k), time: 2570.90/16.68/15.07
overall resize2fs: I/O read: 1MB, write: 1MB, rate: 0.00MB/s
The filesystem on /dev/zvol/rpool/scratch/ext4 is now 805306368 (4k) blocks long.

real	43m1.943s
user	0m16.761s
sys	0m15.069s
```

I then cleaned up and recreated the zvol, loaded the ext4 module, created the ext4 fs,
resized the volume, and resize2fs'd and it went quite quickly:

```
[root@kif:/scratch]# zfs destroy rpool/scratch/ext4

[root@kif:/scratch]# zfs create -V 3G rpool/scratch/ext4

[root@kif:/scratch]# modprobe ext4

[root@kif:/scratch]# time resize2fs -d 62 /dev/zvol/rpool/scratch/ext4

[root@kif:/scratch]# time mkfs.ext4 /dev/zvol/rpool/scratch/ext4
mke2fs 1.45.5 (07-Jan-2020)
Discarding device blocks: done
Creating filesystem with 786432 4k blocks and 196608 inodes
Filesystem UUID: 5b415f2f-a8c4-4ba0-ac1d-78860de77610
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

real	0m1.013s
user	0m0.001s
sys	0m0.023s

[root@kif:/scratch]# zfs set volsize=3T rpool/scratch/ext4

[root@kif:/scratch]# time resize2fs -d 62 /dev/zvol/rpool/scratch/ext4
resize2fs 1.45.5 (07-Jan-2020)
fs has 11 inodes, 1 groups required.
fs requires 16390 data blocks.
With 1 group(s), we have 22234 blocks available.
Last group's overhead is 10534
Need 16390 data blocks in last group
Final size of last group is 26924
Estimated blocks needed: 26924
Extents safety margin: 49
Resizing the filesystem on /dev/zvol/rpool/scratch/ext4 to 805306368 (4k) blocks.
read_bitmaps: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
read_bitmaps: I/O read: 1MB, write: 0MB, rate: 3389.83MB/s
fix_uninit_block_bitmaps 1: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
resize_group_descriptors: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
move_bg_metadata: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
zero_high_bits_in_metadata: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
adjust_superblock: Memory used: 264k/1540k (210k/55k), time:  0.02/ 0.02/ 0.00
fix_uninit_block_bitmaps 2: Memory used: 264k/1540k (210k/55k), time:  0.15/ 0.15/ 0.00
blocks_to_move: Memory used: 264k/1540k (211k/54k), time:  0.00/ 0.00/ 0.00
Number of free blocks: 755396/780023556, Needed: 0
block_mover: Memory used: 264k/3592k (216k/49k), time:  0.01/ 0.01/ 0.00
block_mover: I/O read: 1MB, write: 0MB, rate: 157.11MB/s
inode_scan_and_fix: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
inode_ref_fix: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
move_itables: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00

calculate_summary_stats: Memory used: 264k/3592k (216k/49k), time: 16.20/16.20/ 0.00
fix_resize_inode: Memory used: 264k/3592k (222k/43k), time:  0.00/ 0.00/ 0.00
fix_resize_inode: I/O read: 1MB, write: 0MB, rate: 5319.15MB/s
fix_sb_journal_backup: Memory used: 264k/3592k (222k/43k), time:  0.00/ 0.00/ 0.00
overall resize2fs: Memory used: 264k/3592k (222k/43k), time: 16.45/16.38/ 0.00
overall resize2fs: I/O read: 1MB, write: 1MB, rate: 0.06MB/s
The filesystem on /dev/zvol/rpool/scratch/ext4 is now 805306368 (4k) blocks long.

real	0m17.908s
user	0m16.386s
sys	0m0.079s
```

Success!
2020-10-30 12:18:23 -04:00
StigP 4512dac960
Merge pull request #99444 from etu/aldo-upgrade
aldo: 0.7.7 -> 0.7.8
2020-10-28 13:23:42 +00:00
Anderson Torres c3feda093d
Merge pull request #101569 from AndersonTorres/megafix
Fixing some URLs
2020-10-28 10:15:26 -03:00
Jörg Thalheim c5ef62db67
Merge pull request #97975 from 06kellyjac/deno_1.4.0 2020-10-28 14:06:23 +01:00
Marek Mahut 40926647b1
Merge pull request #101926 from stovemeerkat/submit/metabase-0.37.0.2
metabase: 0.36.4 -> 0.37.0.2
2020-10-28 13:51:26 +01:00
Niklas Hambüchen c06f86d591
Merge pull request #101879 from sikmir/cloudcompare
cloudcompare: 2.11.0 → 2.11.2
2020-10-28 13:43:31 +01:00
Mario Rodas 8385452994
Merge pull request #101919 from r-ryantm/auto-update/python3.7-Eve
python37Packages.eve: 1.1.3 -> 1.1.4
2020-10-28 07:27:27 -05:00
Nikolay Korotkiy 59645d2e42 cloudcompare: 2.11.0 → 2.11.2 2020-10-28 13:24:55 +01:00
stovemeerkat 4c7982a2c5 metabase: 0.36.4 -> 0.37.0.2 2020-10-28 13:02:30 +01:00
Emery Hemingway 17a9d2187d vix: init at 0.1.2 2020-10-28 12:34:43 +01:00
R. RyanTM 6d6ed15508 python37Packages.eve: 1.1.3 -> 1.1.4 2020-10-28 11:21:17 +00:00
Mario Rodas 023ff35f38
Merge pull request #101746 from oyren/update-portfolio
portfolio: 0.48.1 -> 0.49.0
2020-10-28 06:18:01 -05:00
Mario Rodas ec2f49dc8c
Merge pull request #101842 from helsinki-systems/litecli-1.4.1
litecli: 1.3.2 -> 1.4.1
2020-10-28 06:16:48 -05:00
Mario Rodas 10400f179f
Merge pull request #101846 from stigtsp/package/rakudo-2020.10
rakudo: 2020.09 -> 2020.10
2020-10-28 06:15:52 -05:00
Mario Rodas 742e5e5f67
Merge pull request #101912 from marsam/update-nodejs-10_x
nodejs-10_x: 10.22.1 -> 10.23.0
2020-10-28 06:14:25 -05:00
Jörg Thalheim afd599e647
Merge pull request #101875 from lovesegfault/ccls-20201025
ccls: 0.20190823 -> 0.20201025
2020-10-28 11:57:30 +01:00
Mario Rodas a151124ca3
Merge pull request #101896 from r-ryantm/auto-update/python3.7-chalice
python37Packages.chalice: 1.21.2 -> 1.21.3
2020-10-28 05:29:16 -05:00
Mario Rodas b69f140a80
Merge pull request #100043 from marsam/update-starship
starship: 0.45.2 -> 0.46.2
2020-10-28 05:22:54 -05:00
Mario Rodas 5b4331e2c9
Merge pull request #99949 from marsam/update-micro
micro: 2.0.7 -> 2.0.8
2020-10-28 05:22:00 -05:00
Maximilian Bosch 3d04e9a779
Merge pull request #101669 from Zopieux/nxdomain
nxdomain: init at 1.0.1
2020-10-28 10:49:50 +01:00
Mario Rodas 10a713e540
Merge pull request #101891 from punkeel/patch-1
nodejs-14_x: 14.14.0 -> 14.15.0
2020-10-28 04:24:28 -05:00
Mario Rodas 8989bf1e62
Merge pull request #101895 from r-ryantm/auto-update/python3.7-apprise
python37Packages.apprise: 0.8.7 -> 0.8.9
2020-10-28 03:59:25 -05:00
Frederik Rietdijk 1489c07cb7 teams: work around screen sharing bug 2020-10-28 09:39:16 +01:00
R. RyanTM 533965957e python37Packages.py-multibase: 1.0.1 -> 1.0.3 2020-10-28 00:08:16 -07:00
R. RyanTM 1ecbf98eee python37Packages.cchardet: 2.1.6 -> 2.1.7 2020-10-28 00:06:06 -07:00
R. RyanTM a8025a3129 python37Packages.snowflake-connector-python: 2.3.3 -> 2.3.4 2020-10-27 23:38:53 -07:00
Daniël de Kok a36a70c2af
Merge pull request #99164 from danieldk/tensorflow2-cuda-capabilities
python3Packages.tensorflow_2: update CUDA capabilities
2020-10-28 06:55:06 +01:00
R. RyanTM 91a190aa77 python37Packages.chalice: 1.21.2 -> 1.21.3 2020-10-28 05:28:48 +00:00
Vincent Laporte ef45e1161e ocamlPackages.ezjsonm: 0.6.0 → 1.2.0 2020-10-28 06:28:44 +01:00
R. RyanTM 34ab3fbaa2 python37Packages.apprise: 0.8.7 -> 0.8.9 2020-10-28 05:17:55 +00:00
Mario Rodas 83d9ca8268 nodejs-10_x: 10.22.1 -> 10.23.0
https://github.com/nodejs/node/releases/tag/v10.23.0
2020-10-28 04:20:00 +00:00
Maxime Guerreiro 0bd06ce0de
nodejs-14_x: 14.14.0 -> 14.15.0
https://github.com/nodejs/node/releases/tag/v14.15.0
2020-10-28 03:34:52 +01:00
Andreas Rammhold c127653b72
Merge pull request #101887 from jonringer/minor-release-notes-adjustment
nixos/docs/rl-2009.xml: grafana: description, example agreement
2020-10-28 02:38:55 +01:00
Mario Rodas b437b6b405
Merge pull request #101681 from r-ryantm/auto-update/lucky-cli
lucky-cli: 0.23.1 -> 0.24.0
2020-10-27 20:29:14 -05:00
MetaDark da11534a4e pythonPackages.debugpy: 1.0.0 -> 1.1.0 2020-10-27 18:27:08 -07:00
Mario Rodas 5594fe0c39
Merge pull request #101685 from woffs/btrfsprogs59
btrfs-progs: 5.7 -> 5.9
2020-10-27 20:03:53 -05:00
Mario Rodas 144ec0c514
Merge pull request #101706 from r-ryantm/auto-update/netdata
netdata: 1.25.0 -> 1.26.0
2020-10-27 19:56:15 -05:00
Mario Rodas 5b27ea8d02
Merge pull request #101714 from r-ryantm/auto-update/oneDNN
oneDNN: 1.6.3 -> 1.6.4
2020-10-27 19:51:53 -05:00
Jonathan Ringer 3963954fc8
nixos/docs/rl-2009.xml: grafana: description, example agreement 2020-10-27 17:50:39 -07:00
Mario Rodas f9a8f295b0
Merge pull request #101701 from r-ryantm/auto-update/moosefs
moosefs: 3.0.114 -> 3.0.115
2020-10-27 19:48:26 -05:00
Andreas Rammhold 05e1e75e26
Merge pull request #101867 from mweinelt/blueman
blueman: 2.1.3 -> 2.1.4
2020-10-28 01:39:46 +01:00
Mario Rodas 9fce5c704a
Merge pull request #101779 from dbirks/update-helm
kubernetes-helm: 3.3.4 -> 3.4.0
2020-10-27 19:27:24 -05:00
Jonathan Ringer f175726bd2
Merge pull request #101874 from davidak/fix-release-notes
doc: improve 20.09 release notes
2020-10-27 17:26:53 -07:00
Mario Rodas d74dbb9254
Merge pull request #101839 from helsinki-systems/amazon-ecs-cli-1.20.0
amazon-ecs-cli: 1.18.1 -> 1.20.0
2020-10-27 19:25:52 -05:00
Peter Hoeg 02de51f120 rubber: put man and info pages in the right directory 2020-10-28 08:13:47 +08:00
Aaron Andersen 48148913b6
Merge pull request #101808 from aanderse/zabbix
zabbix: 4.0.25 -> 4.0.26, 5.0.4 -> 5.0.5
2020-10-27 20:09:58 -04:00
Mario Rodas b5d10cb440
Merge pull request #101878 from ivan/periods-1.2
postgresqlPackages.periods: 1.1 -> 1.2
2020-10-27 18:59:16 -05:00
Mario Rodas 9952b7b244
Merge pull request #101818 from marsam/update-rclone
rclone: 1.53.1 -> 1.53.2
2020-10-27 18:57:47 -05:00
zowoq 023abd4ffb fzf: 0.23.1 -> 0.24.0
https://github.com/junegunn/fzf/releases/tag/0.24.0
2020-10-28 09:07:12 +10:00
zowoq 092aa94ca7 buildGoModule: use optionalString 2020-10-28 09:06:55 +10:00