From owner-svn-src-stable@FreeBSD.ORG Tue May 5 10:46:49 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E99AA106567B; Tue, 5 May 2009 10:46:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAEF38FC17; Tue, 5 May 2009 10:46:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n45Akn6E079095; Tue, 5 May 2009 10:46:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n45Akn7l079094; Tue, 5 May 2009 10:46:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200905051046.n45Akn7l079094@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 May 2009 10:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191815 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2009 10:46:50 -0000 Author: kib Date: Tue May 5 10:46:49 2009 New Revision: 191815 URL: http://svn.freebsd.org/changeset/base/191815 Log: MFC r191136: In flushbufqueues(), do not allocate sentinel buffer on the stack, struct buf is large. Use sleeping malloc(9) call, and zero the allocated buf as a debugging feature. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/vfs_bio.c Modified: stable/7/sys/kern/vfs_bio.c ============================================================================== --- stable/7/sys/kern/vfs_bio.c Tue May 5 10:43:14 2009 (r191814) +++ stable/7/sys/kern/vfs_bio.c Tue May 5 10:46:49 2009 (r191815) @@ -2187,7 +2187,7 @@ static int flushbufqueues(struct vnode *lvp, int queue, int flushdeps) { struct thread *td = curthread; - struct buf sentinel; + struct buf *sentinel; struct vnode *vp; struct mount *mp; struct buf *bp; @@ -2203,14 +2203,15 @@ flushbufqueues(struct vnode *lvp, int qu target = flushbufqtarget; flushed = 0; bp = NULL; - sentinel.b_qindex = QUEUE_SENTINEL; + sentinel = malloc(sizeof(struct buf), M_TEMP, M_WAITOK | M_ZERO); + sentinel->b_qindex = QUEUE_SENTINEL; mtx_lock(&bqlock); - TAILQ_INSERT_HEAD(&bufqueues[queue], &sentinel, b_freelist); + TAILQ_INSERT_HEAD(&bufqueues[queue], sentinel, b_freelist); while (flushed != target) { - bp = TAILQ_NEXT(&sentinel, b_freelist); + bp = TAILQ_NEXT(sentinel, b_freelist); if (bp != NULL) { - TAILQ_REMOVE(&bufqueues[queue], &sentinel, b_freelist); - TAILQ_INSERT_AFTER(&bufqueues[queue], bp, &sentinel, + TAILQ_REMOVE(&bufqueues[queue], sentinel, b_freelist); + TAILQ_INSERT_AFTER(&bufqueues[queue], bp, sentinel, b_freelist); } else break; @@ -2303,8 +2304,9 @@ flushbufqueues(struct vnode *lvp, int qu vn_finished_write(mp); BUF_UNLOCK(bp); } - TAILQ_REMOVE(&bufqueues[queue], &sentinel, b_freelist); + TAILQ_REMOVE(&bufqueues[queue], sentinel, b_freelist); mtx_unlock(&bqlock); + free(sentinel, M_TEMP); return (flushed); }