From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin LaHaise Subject: Re: [PATCH] get_empty_filp tweaks, inline epoll_init_file() Date: Mon, 23 Jan 2006 21:49:54 -0800 Message-ID: <20060124054954.GB16694@linux.intel.com> References: <20060124052820.GA16694@linux.intel.com> <20060123214451.7e2fc885.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from fmr21.intel.com ([143.183.121.13]:13962 "EHLO scsfmr001.sc.intel.com") by vger.kernel.org with ESMTP id S1030290AbWAXF6v (ORCPT ); Tue, 24 Jan 2006 00:58:51 -0500 To: Andrew Morton Content-Disposition: inline In-Reply-To: <20060123214451.7e2fc885.akpm@osdl.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Jan 23, 2006 at 09:44:51PM -0800, Andrew Morton wrote: > Benjamin LaHaise wrote: > > > > This patch eliminates a handful of cache references by keeping current > > in a register instead of reloading (helps x86) > > Are you sure it helps? I was checking that the other day and found that the > compiler caches current quite competently. I was looking at the code on x86-64 where it reloads from %gs:0, but x86 reloads current too. 0xc015599b : mov $0xfffff000,%eax 0xc01559a0 : and %esp,%eax - eax is current_thread_info() 0xc01559a2 : mov (%eax),%edx - dereference to get current 0xc01559a4 : mov 0x174(%edx),%edx - load current->fsuid 0xc01559aa : mov %edx,0x48(%esi) - store in file->f_uid 0xc01559ad : mov (%eax),%eax - reload current 0xc01559af : mov 0x184(%eax),%eax - load current->fsgid 0xc01559b5 : mov %eax,0x4c(%esi) - store in file->f_gid -ben