From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752547AbZDMUGX (ORCPT ); Mon, 13 Apr 2009 16:06:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751715AbZDMUGN (ORCPT ); Mon, 13 Apr 2009 16:06:13 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:41282 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281AbZDMUGK (ORCPT ); Mon, 13 Apr 2009 16:06:10 -0400 Date: Mon, 13 Apr 2009 12:57:50 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Ying Han cc: linux-mm@kvack.org, linux-kernel , akpm , Ingo Molnar , Mike Waychison , Rohit Seth , Hugh Dickins , Peter Zijlstra , "H. Peter Anvin" , =?ISO-8859-15?Q?T=F6r=F6k_Edwin?= , Lee Schermerhorn , Nick Piggin , Wu Fengguang Subject: Re: [V4][PATCH 0/4]page fault retry with NOPAGE_RETRY In-Reply-To: <604427e00904131244y68fa7e62x85d599f588776eee@mail.gmail.com> Message-ID: References: <604427e00904131244y68fa7e62x85d599f588776eee@mail.gmail.com> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Apr 2009, Ying Han wrote: > > Benchmarks: > case 1. one application has a high count of threads each faulting in > different pages of a hugefile. Benchmark indicate that this double data > structure walking in case of major fault results in << 1% performance hit. > > case 2. add another thread in the above application which in a tight loop > of mmap()/munmap(). Here we measure loop count in the new thread while other > threads doing the same amount of work as case one. we got << 3% performance > hit on the Complete Time(benchmark value for case one) and 10% performance > improvement on the mmap()/munmap() counter. > > This patch helps a lot in cases we have writer which is waitting behind all > readers, so it could execute much faster. Hmm. I normally think of "<<" as "much smaller than", but the way you use it makes me wonder. In particular, "<< 3%" sounds very odd. If it's much smaller than 3%, I'd have expected "<< 1%" again. So it probably isn't. > benchmarks from Wufengguang: > Just tested the sparse-random-read-on-sparse-file case, and found the > performance impact to be 0.4% (8.706s vs 8.744s) in the worst case. > Kind of acceptable. Well, have you tried the obvious optimization of _not_ doing the RETRY path when atomic_read(&mm->counter) == 1? After all, if it's not a threaded app, and it doesn't have a possibility of concurrent mmap/fault, then why release the lock? Linus