Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 29 Jul 2002 20:28:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 29 Jul 2002 20:28:24 -0400 Received: from penguin.e-mind.com ([195.223.140.120]:14628 "EHLO penguin.e-mind.com") by vger.kernel.org with ESMTP id ; Mon, 29 Jul 2002 20:28:23 -0400 Date: Tue, 30 Jul 2002 02:32:48 +0200 From: Andrea Arcangeli To: "J.A. Magallon" Cc: Rik van Riel , Alan Cox , Andrew Theurer , linux-kernel@vger.kernel.org, Marcelo Tosatti Subject: Re: Linux 2.4.19-rc3 (hyperthreading) Message-ID: <20020730003248.GP1201@dualathlon.random> References: <20020730000912.GA6406@714-cm.cps.unizar.es> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020730000912.GA6406@714-cm.cps.unizar.es> User-Agent: Mutt/1.3.27i X-GnuPG-Key-URL: http://e-mind.com/~andrea/aa.gnupg.asc X-PGP-Key-URL: http://e-mind.com/~andrea/aa.asc Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 851 Lines: 29 On Tue, Jul 30, 2002 at 02:09:12AM +0200, J.A. Magallon wrote: > How about this version (gcc-3.2 generates the same amount of assembler): > > int find(int this_cpu) > { > int i; > > for ( i = (this_cpu+1)%smp_num_cpus; > i != this_cpu; > i = (i+1)%smp_num_cpus ) > { > int physical = cpu_logical_map(i); > int sibling = cpu_sibling_map[physical]; > > if (idle_cpu(physical) && idle_cpu(sibling)) > return physical; > } > return -1; > } I also find the above a bit more readable, I'll rediff once more time then. Andrea - 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/