From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [RESEND] [PATCH] lseek: remove i_mutex Date: Thu, 5 Feb 2009 12:05:19 -0800 Message-ID: <20090205120519.a62e8c4f.akpm@linux-foundation.org> References: <6.0.0.20.2.20090203165430.06ae1cd8@172.19.0.2> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Hisashi Hifumi Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:55339 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750990AbZBEUFv (ORCPT ); Thu, 5 Feb 2009 15:05:51 -0500 In-Reply-To: <6.0.0.20.2.20090203165430.06ae1cd8@172.19.0.2> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 03 Feb 2009 17:04:40 +0900 Hisashi Hifumi wrote: > I removed i_mutex from generic_file_llseek. > I think that the reason of protecting lseek with i_mutex is just > touching i_size atomically. > > So I introduce i_size_read here so i_mutex is no longer needed. > > Following patch removes i_mutex from generic_file_llseek, and deletes > generic_file_llseek_nolock totally. > > Currently there is i_mutex contention not only around lseek, but also fsync or write. > So, I think we can mitigate i_mutex contention between fsync lseek and write by > removing i_mutex. Prior to this change, generic_file_llseek() modified file->f_pos atomically with respect to other i_mutex holders. After this change, it doesn't.