DragonFly bugs List (threaded) for 2008-01
DragonFly BSD
DragonFly bugs List (threaded) for 2008-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: softdep panic while low on memory during "make buildworld"


From: "Nicolas Thery" <nthery@xxxxxxxxx>
Date: Sat, 26 Jan 2008 16:45:43 +0100

2008/1/26, Nicolas Thery <nthery@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.



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]