-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel API changes IO acct, global_page_state, etc #6635
Conversation
32a5759
to
88f89f1
Compare
a38d5e0
to
95a6122
Compare
95a6122
to
f9fb806
Compare
It's early days, but the The summary of those fixes is that with the Linux API change introduced by torvalds/linux@599d0c9, our free memory calcs were based on completely the wrong thing. E.g. where we're looking at This also goes a long way towards explaining various |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally this looks good. Just a little suggested refactoring. I completely agree with @chrisrd , it's really unfortunate the kernel changed this behavior so significantly in a way which didn't break the build. I'm just glad it's been caught. @chrisrd your graph looks much more like what I'd expect, thank you for the quick feedback!
module/zfs/vdev_disk.c
Outdated
dr->dr_bio[i]->bi_bdev = bdev; | ||
#else | ||
bio_set_dev(dr->dr_bio[i], bdev); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be more readable if we defined our own version of bio_set_dev()
in linux/blkdev_compat.h
when !HAVE_BIO_SET_DEV
. A similar thing was done for bio_set_op_attrs()
.
#ifndef HAVE_BIO_SET_DEV
static inline void
bio_set_dev(struct bio *bio, struct block_device *bdev)
{
bio->bi_bdev = bdev;
}
#endif /* !HAVE_BIO_SET_DEV */
module/zfs/vdev_disk.c
Outdated
bio->bi_bdev = bdev; | ||
#else | ||
bio_set_dev(bio, bdev); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use bio_set_dev()
which will now always be available.
generic_start_io_acct/generic_end_io_acct in the master branch of the linux kernel requires that the request_queue be provided. Move the logic from freemem in the spl to arc_free_memory in arc.c. Do this so we can take advantage of global_page_state interface checks in zfs. Upstream kernel replaced struct block_device with struct gendisk in struct bio. Determine if the function bio_set_dev exists during configure and have zfs use that if it exists. bio_set_dev torvalds/linux@74d4699 global_node_page_state torvalds/linux@75ef718 io acct torvalds/linux@d62e26b Signed-off-by: Giuseppe Di Natale <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
f9fb806
to
9623983
Compare
@dinatale2 I added a commit to this PR to add the |
generic_start_io_acct/generic_end_io_acct in the master branch of the linux kernel requires that the request_queue be provided. Move the logic from freemem in the spl to arc_free_memory in arc.c. Do this so we can take advantage of global_page_state interface checks in zfs. Upstream kernel replaced struct block_device with struct gendisk in struct bio. Determine if the function bio_set_dev exists during configure and have zfs use that if it exists. bio_set_dev torvalds/linux@74d4699 global_node_page_state torvalds/linux@75ef718 io acct torvalds/linux@d62e26b Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes openzfs#6635 Signed-off-by: Brian Behlendorf <[email protected]>
generic_start_io_acct/generic_end_io_acct in the master branch of the linux kernel requires that the request_queue be provided. Move the logic from freemem in the spl to arc_free_memory in arc.c. Do this so we can take advantage of global_page_state interface checks in zfs. Upstream kernel replaced struct block_device with struct gendisk in struct bio. Determine if the function bio_set_dev exists during configure and have zfs use that if it exists. bio_set_dev torvalds/linux@74d4699 global_node_page_state torvalds/linux@75ef718 io acct torvalds/linux@d62e26b Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #6635 Signed-off-by: Brian Behlendorf <[email protected]>
generic_start_io_acct/generic_end_io_acct in the master branch of the linux kernel requires that the request_queue be provided. Move the logic from freemem in the spl to arc_free_memory in arc.c. Do this so we can take advantage of global_page_state interface checks in zfs. Upstream kernel replaced struct block_device with struct gendisk in struct bio. Determine if the function bio_set_dev exists during configure and have zfs use that if it exists. bio_set_dev torvalds/linux@74d4699 global_node_page_state torvalds/linux@75ef718 io acct torvalds/linux@d62e26b Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes openzfs#6635 Signed-off-by: Brian Behlendorf <[email protected]>
Description
generic_start_io_acct/generic_end_io_acct in the master
branch of the linux kernel requires that the request_queue
be provided.
Move the logic from freemem in the spl to arc_free_memory
in arc.c. Do this so we can take advantage of global_page_state
interface checks in zfs.
Upstream kernel replaced struct block_device with
struct gendisk in struct bio. Determine if the
function bio_set_dev exists during configure
and have zfs use that if it exists.
Motivation and Context
Fix the Kernel builder in the ZFS buildbot.
How Has This Been Tested?
Builds in a VM locally. Going to see if buildbot builds work.
Types of changes
Checklist:
Signed-off-by
.