Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 30 Jul 2002 23:12:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 30 Jul 2002 23:12:13 -0400 Received: from tmr-02.dsl.thebiz.net ([216.238.38.204]:49933 "EHLO gatekeeper.tmr.com") by vger.kernel.org with ESMTP id ; Tue, 30 Jul 2002 23:12:12 -0400 Date: Tue, 30 Jul 2002 23:08:19 -0400 (EDT) From: Bill Davidsen To: "J.A. Magallon" cc: Rik van Riel , Andrea Arcangeli , Alan Cox , Andrew Theurer , linux-kernel@vger.kernel.org, Marcelo Tosatti Subject: Re: Linux 2.4.19-rc3 (hyperthreading) In-Reply-To: <20020730000912.GA6406@714-cm.cps.unizar.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 900 Lines: 33 On Tue, 30 Jul 2002, J.A. Magallon wrote: > How about this version (gcc-3.2 generates the same amount of assembler): Now *that* is readable code! > 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; > } -- bill davidsen CTO, TMR Associates, Inc Doing interesting things with little computers since 1979. - 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/