Closed nosammai closed 1 year ago
This is an interesting one because I am unable to reproduce this kernel panic on a stock Ubuntu Server 22.04 running a [most current] 5.15.0-69 kernel. There must be something unique going on with the 5.15.0-1031-gcp kernel in the Google image. I will need to find access to a Google Cloud environment and rerun.
I swapped out xfs for ext4 and could couldn't repro the crash so it seems like it has something to do with the interaction of the gcp kernel/xfs/rapiddisk. Let me know if there's anything else that you'd like me to test out!
OK. Some initial thoughts but no fix yet.
What version of RapidDisk are you using? I would like to try something out with a patch. Does the behavior change when you manually apply the following changes?
@@ -270,10 +274,7 @@ static struct page *rdsk_insert_page(struct rdsk_device *rdsk, sector_t sector)
* If XIP was reworked to use pfns and kmap throughout, this
* restriction might be able to be lifted.
*/
- gfp_flags = GFP_NOIO | __GFP_ZERO;
-#ifndef CONFIG_BLK_DEV_XIP
- gfp_flags |= __GFP_HIGHMEM;
-#endif
+ gfp_flags = GFP_NOIO | __GFP_ZERO | __GFP_HIGHMEM;
page = alloc_page(gfp_flags);
if (!page)
return NULL;
@@ -285,13 +286,12 @@ static struct page *rdsk_insert_page(struct rdsk_device *rdsk, sector_t sector)
spin_lock(&rdsk->rdsk_lock);
idx = sector >> PAGE_SECTORS_SHIFT;
+ page->index = idx;
if (radix_tree_insert(&rdsk->rdsk_pages, idx, page)) {
__free_page(page);
page = radix_tree_lookup(&rdsk->rdsk_pages, idx);
BUG_ON(!page);
BUG_ON(page->index != idx);
- } else {
- page->index = idx;
}
spin_unlock(&rdsk->rdsk_lock);
EDIT - If you are uncomfortable applying the changes, you can try to use the kernel module from this branch: https://github.com/pkoutoupis/rapiddisk/tree/feature/bcc-scripts
EDIT 2 - Just make sure you do a git pull
in the repo before or after you checkout the branch: git checkout feature/bcc-scripts
.
EDIT 3 - The code in question is now merged into master and you can either clone the master branch or download the 9.1.0 tag: https://github.com/pkoutoupis/rapiddisk/releases/tag/9.1.0
Tested with latest master branch and confirmed the crash no longer occurs. Thank you for the quick fix!
Nice! I will close this issue then. If you stumble on anything, just open up a new issue. Thanks!
Hi I just compiled latest master branch, and when I try to run fio on a ramdisk with a larger filesize I get a crash/kernel panic. I can reproduce this pretty consistently.
This is running on GCP n2-standard-32 machine running a Google ubuntu 22.04 image compiled on the same machine that is running the test.
Repro steps: