softdep panic while low on memory during "make buildworld"

Nicolas Thery nthery at gmail.com
Sat Jan 26 07:46:29 PST 2008


2008/1/26, Nicolas Thery <nthery at gmail.com>:
>  static void
>  softdep_deallocate_dependencies(struct buf *bp)
>  {
> +       /* XXX */
> +       if (LIST_EMPTY(&bp->b_dep))
> +               return;
> +
>         if ((bp->b_flags & B_ERROR) == 0)
>                 panic("softdep_deallocate_dependencies: dangling deps");
>         softdep_error(bp->b_vp->v_mount->mnt_stat.f_mntfromname, bp->b_error);
>
> Should that hypothesis proves true, it may be better to reset
> bp->b_ops when the last dependency is resolved.
>
> Let's wait for that buildworld to complete or panic ...

No panic with this patch.

Upon closer inspection, the other calls to buf_deallocate() (in
brelse() and getnewbuf()) are done if and only if b_dep is not empty.
So a better patch would be:

Index: src2/sys/kern/vfs_bio.c
===================================================================
--- src2.orig/sys/kern/vfs_bio.c	2008-01-20 19:27:54.000000000 +0100
+++ src2/sys/kern/vfs_bio.c	2008-01-22 17:58:05.000000000 +0100
@@ -1085,7 +1085,8 @@
 	if (bp->b_flags & (B_DELWRI | B_LOCKED)) {
 		bp->b_flags &= ~B_RELBUF;
 	} else if (vm_page_count_severe()) {
-		buf_deallocate(bp);
+		if (LIST_FIRST(&bp->b_dep) != NULL)
+			buf_deallocate(bp);
 		if (bp->b_flags & (B_DELWRI | B_LOCKED))
 			bp->b_flags &= ~B_RELBUF;
 		else

If there are no objections, I'll commit this on sunday.





More information about the Bugs mailing list