Commit 0d1120b
xfs: remove most in-flight buffer accounting
The buffer cache keeps a bt_io_count per-CPU counter to track all
in-flight I/O, which is used to ensure no I/O is in flight when
unmounting the file system.
For most I/O we already keep track of inflight I/O at higher levels:
- for synchronous I/O (xfs_buf_read/xfs_bwrite/xfs_buf_delwri_submit),
the caller has a reference and waits for I/O completions using
xfs_buf_iowait
- for xfs_buf_delwri_submit_nowait the only caller (AIL writeback)
tracks the log items that the buffer attached to
This only leaves only xfs_buf_readahead_map as a submitter of
asynchronous I/O that is not tracked by anything else. Replace the
bt_io_count per-cpu counter with a more specific bt_readahead_count
counter only tracking readahead I/O. This allows to simply increment
it when submitting readahead I/O and decrementing it when it completed,
and thus simplify xfs_buf_rele and remove the needed for the
XBF_NO_IOACCT flags and the XFS_BSTATE_IN_FLIGHT buffer state.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>1 parent efc5f7a commit 0d1120b
File tree
5 files changed
+20
-86
lines changed- fs/xfs
5 files changed
+20
-86
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 32 | | |
38 | 33 | | |
39 | 34 | | |
| |||
81 | 76 | | |
82 | 77 | | |
83 | 78 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | 79 | | |
130 | 80 | | |
131 | 81 | | |
| |||
156 | 106 | | |
157 | 107 | | |
158 | 108 | | |
159 | | - | |
160 | | - | |
161 | 109 | | |
162 | 110 | | |
163 | 111 | | |
| |||
946 | 894 | | |
947 | 895 | | |
948 | 896 | | |
| 897 | + | |
949 | 898 | | |
950 | 899 | | |
951 | 900 | | |
| |||
1002 | 951 | | |
1003 | 952 | | |
1004 | 953 | | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
1005 | 957 | | |
1006 | 958 | | |
1007 | | - | |
1008 | | - | |
| 959 | + | |
1009 | 960 | | |
1010 | 961 | | |
1011 | 962 | | |
| |||
1059 | 1010 | | |
1060 | 1011 | | |
1061 | 1012 | | |
1062 | | - | |
1063 | 1013 | | |
1064 | 1014 | | |
1065 | 1015 | | |
| |||
1078 | 1028 | | |
1079 | 1029 | | |
1080 | 1030 | | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
| 1031 | + | |
1089 | 1032 | | |
1090 | 1033 | | |
1091 | 1034 | | |
1092 | 1035 | | |
1093 | | - | |
1094 | 1036 | | |
1095 | 1037 | | |
1096 | 1038 | | |
| |||
1370 | 1312 | | |
1371 | 1313 | | |
1372 | 1314 | | |
| 1315 | + | |
| 1316 | + | |
1373 | 1317 | | |
1374 | 1318 | | |
1375 | 1319 | | |
| |||
1658 | 1602 | | |
1659 | 1603 | | |
1660 | 1604 | | |
1661 | | - | |
1662 | | - | |
1663 | | - | |
1664 | 1605 | | |
1665 | 1606 | | |
1666 | 1607 | | |
| |||
1786 | 1727 | | |
1787 | 1728 | | |
1788 | 1729 | | |
1789 | | - | |
1790 | | - | |
1791 | | - | |
| 1730 | + | |
| 1731 | + | |
1792 | 1732 | | |
1793 | 1733 | | |
1794 | 1734 | | |
| |||
1797 | 1737 | | |
1798 | 1738 | | |
1799 | 1739 | | |
1800 | | - | |
| 1740 | + | |
1801 | 1741 | | |
1802 | 1742 | | |
1803 | 1743 | | |
| |||
1914 | 1854 | | |
1915 | 1855 | | |
1916 | 1856 | | |
1917 | | - | |
1918 | | - | |
| 1857 | + | |
| 1858 | + | |
1919 | 1859 | | |
1920 | 1860 | | |
1921 | 1861 | | |
| |||
1969 | 1909 | | |
1970 | 1910 | | |
1971 | 1911 | | |
1972 | | - | |
| 1912 | + | |
1973 | 1913 | | |
1974 | 1914 | | |
1975 | 1915 | | |
| |||
1983 | 1923 | | |
1984 | 1924 | | |
1985 | 1925 | | |
1986 | | - | |
| 1926 | + | |
1987 | 1927 | | |
1988 | 1928 | | |
1989 | 1929 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
| |||
77 | 75 | | |
78 | 76 | | |
79 | 77 | | |
80 | | - | |
81 | 78 | | |
82 | 79 | | |
83 | 80 | | |
| |||
116 | 113 | | |
117 | 114 | | |
118 | 115 | | |
119 | | - | |
| 116 | + | |
120 | 117 | | |
121 | 118 | | |
122 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
186 | | - | |
| 184 | + | |
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
190 | | - | |
191 | | - | |
| 188 | + | |
192 | 189 | | |
193 | 190 | | |
194 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1407 | 1407 | | |
1408 | 1408 | | |
1409 | 1409 | | |
1410 | | - | |
| 1410 | + | |
1411 | 1411 | | |
1412 | 1412 | | |
1413 | 1413 | | |
| |||
0 commit comments