oops in 2.4.1-pre8
Quoted 9 lines
Quoted 3 lines
Ethernet is compiled into the kernel as is smbfs (not as modules). I've compiled this kernel with 4GB bigmem support (otherwise I only get 8xxMB total).
The smbfs cache code in 2.4.0 doesn't work with bigmem. For now disable bigmem or don't use smbfs, it's oopsing all the time.
Rainer Mager reported the same thing yesterday ("Oops with 4GB memory setting in 2.4.0 stable" if you want to read the thread).
I think that I found source of problem. I have no simple solution :-(
You are using 'page_cache_entry()' function three times. But you are using it on kmap()ped memory (cachep, in this oops example). So it returns almost random value, which caused 'mapping' to be set to NULL when doing grab_page_cache(), which caused oops later in add_to_page_cache_unique...
But I'm not 100% sure, as this would mean that you do not kunmap/UnlockPage/page_cache_release any >1GB page at all in smb_free_cache_blocks(), as page pointer obtained by page_cache_entry() points to some random page (to couple just below 1GB boundary) instead of to correct one, so smbfs should die as soon as it finds first highmem page... Is it possible?
Same problem is in smb_free_dircache.
You can try using __find_get_page() with index to get 'struct *page' (it should always suceed, as you have all pages locked...), instead of page_cache_entry(), but better solution is using couple { page, page_address } instead of page_address alone.
So your system has couple of chances to deadlock - either on out of kmaps, or on locked directory cache root (cachep), or on some of locked directory cache pages (blocks)...
And one nonfatal ;-) In smb_add_to_cache you have:
page_off = PAGE_SIZE + (cachep->idx << PAGE_SHIFT); page = grab_cache_page(mapping, page_off >> PAGE_CACHE_SHIFT);
This does not look correct to me. You should use PAGE_CACHE_SHIFT and PAGE_CACHE_SIZE, as otherwise you'll receive same page for idx=1 and 2 when cache will use 8KB pages, but CPU 4KB ones. Using only first 4KB of each cache page is better solution, than using same page for two different indexes, I think... But as currently PAGE_CACHE_SIZE == PAGE_SIZE...
Best regards,
Petr Vandrovec [email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
Quoted 5 lines · Petr Vandrovec
Quoted 2 lines
Rainer Mager reported the same thing yesterday ("Oops with 4GB memory setting in 2.4.0 stable" if you want to read the thread).
I think that I found source of problem. I have no simple solution :-(
I think the source of the problem is that this code was changed without anyone being capable of actively maintaining it (time, knowledge, motivation, ...). And later maintainers (me) haven't known or seen anything wrong with it.
Quoted 6 lines
But I'm not 100% sure, as this would mean that you do not kunmap/UnlockPage/page_cache_release any >1GB page at all in
smb_free_cache_blocks(), as page pointer obtained bypage_cache_entry()points to some random page (to couple just below 1GB boundary) instead of to correct one, so smbfs should die as soon as it finds first highmem page... Is it possible?
It sounds possible from the reports, where it has died as soon as it is touched on a highmem mmachine.
Quoted 3 lines
So your system has couple of chances to deadlock - either on out of kmaps, or on locked directory cache root (cachep), or on some of locked directory cache pages (blocks)...
Thanks for looking. I haven't begun to verify any of your previous suggestions.
Copying the ncpfs cache code seems so much better. It's possibly a bigger change (currently 20k diff -u) than to fix the cache.c code to do whatever is right but the end result should be a lot better (I hope). Fixed size cache entries makes lookups simpler, creating dentry/inode from the info returned by the findfirst/findnext smb calls avoids extra calls on some common(?) usage patterns.
Assuming your code is correct, and I'm sure it is, this should be a faster way to do it than for me to figure out how the existing smbfs cahce can be made to work. The differences are not that great between ncpfs and smbfs, both are networked dos-ish filesystems. :)
My new code oopsed on me last night (and then I realized what time it was). But so far the ncpfs code is fitting quite nicely.
/Urban
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/