Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 903117 | Differences between
and this patch

Collapse All | Expand All

(-)a/config/kernel-generic_io_acct.m4 (-37 / +61 lines)
Lines 2-8 Link Here
2
dnl # Check for generic io accounting interface.
2
dnl # Check for generic io accounting interface.
3
dnl #
3
dnl #
4
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
4
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
5
	ZFS_LINUX_TEST_SRC([bdev_io_acct], [
5
	ZFS_LINUX_TEST_SRC([bdev_io_acct_63], [
6
		#include <linux/blkdev.h>
7
	], [
8
		struct block_device *bdev = NULL;
9
		struct bio *bio = NULL;
10
		unsigned long passed_time = 0;
11
		unsigned long start_time;
12
13
		start_time = bdev_start_io_acct(bdev, bio_op(bio),
14
		    passed_time);
15
		bdev_end_io_acct(bdev, bio_op(bio), bio_sectors(bio), start_time);
16
	])
17
18
	ZFS_LINUX_TEST_SRC([bdev_io_acct_old], [
6
		#include <linux/blkdev.h>
19
		#include <linux/blkdev.h>
7
	], [
20
	], [
8
		struct block_device *bdev = NULL;
21
		struct block_device *bdev = NULL;
Lines 63-136 Link Here
63
76
64
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
77
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
65
	dnl #
78
	dnl #
66
	dnl # 5.19 API,
79
	dnl # Linux 6.3, and then backports thereof, changed
80
	dnl # the signatures on bdev_start_io_acct/bdev_end_io_acct
67
	dnl #
81
	dnl #
68
	dnl # disk_start_io_acct() and disk_end_io_acct() have been replaced by
82
	AC_MSG_CHECKING([whether 6.3+ bdev_*_io_acct() are available])
69
	dnl # bdev_start_io_acct() and bdev_end_io_acct().
83
	ZFS_LINUX_TEST_RESULT([bdev_io_acct_63], [
70
	dnl #
71
	AC_MSG_CHECKING([whether generic bdev_*_io_acct() are available])
72
	ZFS_LINUX_TEST_RESULT([bdev_io_acct], [
73
		AC_MSG_RESULT(yes)
84
		AC_MSG_RESULT(yes)
74
		AC_DEFINE(HAVE_BDEV_IO_ACCT, 1, [bdev_*_io_acct() available])
85
		AC_DEFINE(HAVE_BDEV_IO_ACCT_63, 1, [bdev_*_io_acct() available])
75
	], [
86
	], [
76
		AC_MSG_RESULT(no)
87
		AC_MSG_RESULT(no)
77
88
78
		dnl #
89
		dnl #
79
		dnl # 5.12 API,
90
		dnl # 5.19 API,
80
		dnl #
91
		dnl #
81
		dnl # bio_start_io_acct() and bio_end_io_acct() became GPL-exported
92
		dnl # disk_start_io_acct() and disk_end_io_acct() have been replaced by
82
		dnl # so use disk_start_io_acct() and disk_end_io_acct() instead
93
		dnl # bdev_start_io_acct() and bdev_end_io_acct().
83
		dnl #
94
		dnl #
84
		AC_MSG_CHECKING([whether generic disk_*_io_acct() are available])
95
		AC_MSG_CHECKING([whether pre-6.3 bdev_*_io_acct() are available])
85
		ZFS_LINUX_TEST_RESULT([disk_io_acct], [
96
		ZFS_LINUX_TEST_RESULT([bdev_io_acct_old], [
86
			AC_MSG_RESULT(yes)
97
			AC_MSG_RESULT(yes)
87
			AC_DEFINE(HAVE_DISK_IO_ACCT, 1, [disk_*_io_acct() available])
98
			AC_DEFINE(HAVE_BDEV_IO_ACCT_OLD, 1, [bdev_*_io_acct() available])
88
		], [
99
		], [
89
			AC_MSG_RESULT(no)
100
			AC_MSG_RESULT(no)
90
91
			dnl #
101
			dnl #
92
			dnl # 5.7 API,
102
			dnl # 5.12 API,
93
			dnl #
103
			dnl #
94
			dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers.
104
			dnl # bio_start_io_acct() and bio_end_io_acct() became GPL-exported
105
			dnl # so use disk_start_io_acct() and disk_end_io_acct() instead
95
			dnl #
106
			dnl #
96
			AC_MSG_CHECKING([whether generic bio_*_io_acct() are available])
107
			AC_MSG_CHECKING([whether generic disk_*_io_acct() are available])
97
			ZFS_LINUX_TEST_RESULT([bio_io_acct], [
108
			ZFS_LINUX_TEST_RESULT([disk_io_acct], [
98
				AC_MSG_RESULT(yes)
109
				AC_MSG_RESULT(yes)
99
				AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
110
				AC_DEFINE(HAVE_DISK_IO_ACCT, 1, [disk_*_io_acct() available])
100
			], [
111
			], [
101
				AC_MSG_RESULT(no)
112
				AC_MSG_RESULT(no)
102
113
103
				dnl #
114
				dnl #
104
				dnl # 4.14 API,
115
				dnl # 5.7 API,
105
				dnl #
116
				dnl #
106
				dnl # generic_start_io_acct/generic_end_io_acct now require
117
				dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers.
107
				dnl # request_queue to be provided. No functional changes,
108
				dnl # but preparation for inflight accounting.
109
				dnl #
118
				dnl #
110
				AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args])
119
				AC_MSG_CHECKING([whether generic bio_*_io_acct() are available])
111
				ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
120
				ZFS_LINUX_TEST_RESULT([bio_io_acct], [
112
				    [generic_start_io_acct], [block/bio.c], [
113
					AC_MSG_RESULT(yes)
121
					AC_MSG_RESULT(yes)
114
					AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
122
					AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
115
					    [generic_*_io_acct() 4 arg available])
116
				], [
123
				], [
117
					AC_MSG_RESULT(no)
124
					AC_MSG_RESULT(no)
118
125
119
					dnl #
126
					dnl #
120
					dnl # 3.19 API addition
127
					dnl # 4.14 API,
121
					dnl #
128
					dnl #
122
					dnl # torvalds/linux@394ffa50 allows us to increment
129
					dnl # generic_start_io_acct/generic_end_io_acct now require
123
					dnl # iostat counters without generic_make_request().
130
					dnl # request_queue to be provided. No functional changes,
131
					dnl # but preparation for inflight accounting.
124
					dnl #
132
					dnl #
125
					AC_MSG_CHECKING(
133
					AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args])
126
					    [whether generic_*_io_acct wants 3 args])
134
					ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
127
					ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
128
					    [generic_start_io_acct], [block/bio.c], [
135
					    [generic_start_io_acct], [block/bio.c], [
129
						AC_MSG_RESULT(yes)
136
						AC_MSG_RESULT(yes)
130
						AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
137
						AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
131
						    [generic_*_io_acct() 3 arg available])
138
						    [generic_*_io_acct() 4 arg available])
132
					], [
139
					], [
133
						AC_MSG_RESULT(no)
140
						AC_MSG_RESULT(no)
141
142
						dnl #
143
						dnl # 3.19 API addition
144
						dnl #
145
						dnl # torvalds/linux@394ffa50 allows us to increment
146
						dnl # iostat counters without generic_make_request().
147
						dnl #
148
						AC_MSG_CHECKING(
149
						    [whether generic_*_io_acct wants 3 args])
150
						ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
151
						    [generic_start_io_acct], [block/bio.c], [
152
							AC_MSG_RESULT(yes)
153
							AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
154
							    [generic_*_io_acct() 3 arg available])
155
						], [
156
							AC_MSG_RESULT(no)
157
						])
134
					])
158
					])
135
				])
159
				])
136
			])
160
			])
(-)a/include/os/linux/kernel/linux/blkdev_compat.h (-2 / +8 lines)
Lines 555-561 Link Here
555
    struct gendisk *disk __attribute__((unused)),
555
    struct gendisk *disk __attribute__((unused)),
556
    int rw __attribute__((unused)), struct bio *bio)
556
    int rw __attribute__((unused)), struct bio *bio)
557
{
557
{
558
#if defined(HAVE_BDEV_IO_ACCT)
558
#if defined(HAVE_BDEV_IO_ACCT_63)
559
	return (bdev_start_io_acct(bio->bi_bdev, bio_op(bio),
560
	    jiffies));
561
#elif defined(HAVE_BDEV_IO_ACCT_OLD)
559
	return (bdev_start_io_acct(bio->bi_bdev, bio_sectors(bio),
562
	return (bdev_start_io_acct(bio->bi_bdev, bio_sectors(bio),
560
	    bio_op(bio), jiffies));
563
	    bio_op(bio), jiffies));
561
#elif defined(HAVE_DISK_IO_ACCT)
564
#elif defined(HAVE_DISK_IO_ACCT)
Lines 581-587 Link Here
581
    struct gendisk *disk __attribute__((unused)),
584
    struct gendisk *disk __attribute__((unused)),
582
    int rw __attribute__((unused)), struct bio *bio, unsigned long start_time)
585
    int rw __attribute__((unused)), struct bio *bio, unsigned long start_time)
583
{
586
{
584
#if defined(HAVE_BDEV_IO_ACCT)
587
#if defined(HAVE_BDEV_IO_ACCT_63)
588
	bdev_end_io_acct(bio->bi_bdev, bio_op(bio), bio_sectors(bio),
589
	    start_time);
590
#elif defined(HAVE_BDEV_IO_ACCT_OLD)
585
	bdev_end_io_acct(bio->bi_bdev, bio_op(bio), start_time);
591
	bdev_end_io_acct(bio->bi_bdev, bio_op(bio), start_time);
586
#elif defined(HAVE_DISK_IO_ACCT)
592
#elif defined(HAVE_DISK_IO_ACCT)
587
	disk_end_io_acct(disk, bio_op(bio), start_time);
593
	disk_end_io_acct(disk, bio_op(bio), start_time);

Return to bug 903117