Received: by oss.sgi.com id ; Sun, 17 Dec 2000 19:28:13 -0800 Received: from perninha.conectiva.com.br ([200.250.58.156]:9732 "EHLO perninha.conectiva.com.br") by oss.sgi.com with ESMTP id ; Sun, 17 Dec 2000 19:27:43 -0800 Received: from freak.distro.conectiva (freak.distro.conectiva [10.0.17.22]) by perninha.conectiva.com.br (8.9.3/8.9.3) with ESMTP id BAA27809 for ; Mon, 18 Dec 2000 01:27:37 -0200 Date: Sun, 17 Dec 2000 23:34:25 -0200 (BRST) From: Marcelo Tosatti X-Sender: marcelo@freak.distro.conectiva To: linux-xfs@oss.sgi.com Subject: set_buffer_dirty_uptodate Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-xfs@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;linux-xfs-outgoing Hi, I was looking at the pagebuf code while I noted that set_buffer_dirty_uptodate (pagebuf/page_buf_io.c:1188) may sleep waiting for bdflush to clean some dirty buffers because it calls balance_dirty(). set_buffer_dirty_update is called by functions which are part of the XFS's writepage codepath, which basically starts at linvfs_write_full_page (xfs/linux/xfs_iops.c). The issue is that linvfs_write_full_page() is taking a vnode lock before going through this codepath, meaning that it can sleep waiting for bdflush while holding this lock which seems to be unecessary. If this "vnode lock" suffers from contention because processes sleep while holding it, we can fix it by calling balance_dirty() _after_ we drop the vnode lock. In practice, this vnode lock is a being used concurrently by a lot of users? Thanks!