From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763703AbYDVPYe (ORCPT ); Tue, 22 Apr 2008 11:24:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756780AbYDVPYY (ORCPT ); Tue, 22 Apr 2008 11:24:24 -0400 Received: from bzq-179-150-194.static.bezeqint.net ([212.179.150.194]:44967 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754919AbYDVPYX (ORCPT ); Tue, 22 Apr 2008 11:24:23 -0400 Message-ID: <480E0324.6050006@qumranet.com> Date: Tue, 22 Apr 2008 18:24:20 +0300 From: Avi Kivity User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: Andrea Arcangeli CC: Eric Dumazet , Christoph Lameter , Nick Piggin , Jack Steiner , Peter Zijlstra , kvm-devel@lists.sourceforge.net, Kanoj Sarcar , Roland Dreier , Steve Wise , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Robin Holt , general@lists.openfabrics.org, Hugh Dickins , akpm@linux-foundation.org, Rusty Russell Subject: Re: [PATCH 01 of 12] Core of mmu notifiers References: <480DFC8A.8040105@cosmosbay.com> <20080422151529.GE24536@duo.random> In-Reply-To: <20080422151529.GE24536@duo.random> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrea Arcangeli wrote: > On Tue, Apr 22, 2008 at 04:56:10PM +0200, Eric Dumazet wrote: > >> Andrea Arcangeli a écrit : >> >>> + >>> +static int mm_lock_cmp(const void *a, const void *b) >>> +{ >>> + cond_resched(); >>> + if ((unsigned long)*(spinlock_t **)a < >>> + (unsigned long)*(spinlock_t **)b) >>> + return -1; >>> + else if (a == b) >>> + return 0; >>> + else >>> + return 1; >>> +} >>> + >>> >> This compare function looks unusual... >> It should work, but sort() could be faster if the >> if (a == b) test had a chance to be true eventually... >> > > Hmm, are you saying my mm_lock_cmp won't return 0 if a==b? > > You need to compare *a to *b (at least, that's what you're doing for the < case). -- error compiling committee.c: too many arguments to function