Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 29 Jan 2002 20:34:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 29 Jan 2002 20:34:01 -0500 Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:47115 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id ; Tue, 29 Jan 2002 20:33:53 -0500 Message-ID: <3C574BD1.E5343312@zip.com.au> Date: Tue, 29 Jan 2002 17:26:41 -0800 From: Andrew Morton X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.18-pre7 i686) X-Accept-Language: en MIME-Version: 1.0 To: Robert Love CC: Linus Torvalds , viro@math.psu.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH] 2.5: push BKL out of llseek In-Reply-To: , <1012351309.813.56.camel@phantasy> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Robert Love wrote: > > @@ -84,9 +84,9 @@ > fn = default_llseek; > if (file->f_op && file->f_op->llseek) > fn = file->f_op->llseek; > - lock_kernel(); > + down(&file->f_dentry->d_inode->i_sem); > retval = fn(file, offset, origin); > - unlock_kernel(); > + up(&file->f_dentry->d_inode->i_sem); > return retval; > } Just a little word of caution here. Remember the apache-flock-synchronisation fiasco, where removal of the BKL halved Apache throughput on 8-way x86. This was because the BKL removal turned serialisation on a quick codepath from a spinlock into a schedule(). So... I'd suggest that changes such as this should be benchmarked in isolation; otherwise we end up spending quite some time hunting down mysterious reports of performance regression, and having to rethink stuff. And llseek is *fast*. If we're seeing significant lock contention in there then adding a schedule() is likely to turn Anton into one unhappy dbencher. - - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/