Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 18 Jun 2002 16:27:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 18 Jun 2002 16:27:38 -0400 Received: from pixpat.austin.ibm.com ([192.35.232.241]:9236 "EHLO wagner.rustcorp.com.au") by vger.kernel.org with ESMTP id ; Tue, 18 Jun 2002 16:27:37 -0400 From: Rusty Russell To: Linus Torvalds Cc: Robert Love , Linux Kernel Mailing List Subject: Re: latest linus-2.5 BK broken In-reply-to: Your message of "Tue, 18 Jun 2002 13:05:51 MST." Date: Wed, 19 Jun 2002 06:31:46 +1000 Message-Id: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1761 Lines: 54 In message you writ e: > On Wed, 19 Jun 2002, Rusty Russell wrote: > > > > NO. They want to be node-affine. They don't want to specify what > > CPUs they attach to. > > So you're going to have separate interfaces for that? Gag me with a volvo, > but that's idiotic. No, you have accepted a non-portable userspace interface and put it in generic code. THAT is idiotic. So any program that doesn't use the following is broken: #include #define BITS_PER_LONG (sizeof(long)*CHAR_BIT) int set_cpu(int cpu) { size_t size = sizeof(unsigned long); unsigned long *bitmask = NULL; int ret; do { size *= 2; bitmask = realloc(bitmask, size); memset(bitmask, 0, size); bitmask[cpu / BITS_PER_LONG] = (1 << (cpu % BITS_PER_LONG); ret = sched_setaffinity(getpid(), size, bitmask); } while (ret < 0 && errno = -EINVAL); return ret; } > Besides, even that would be broken. You want bitmaps, because bitmaps is > really what it is all about. It's NOT about "I must run on this CPU", it > can equally well be "I mustn't run on those two CPU's that are hosting the > RT part of this thing" or something like that. Just bind to a cpu != those two CPUs. I could come up with contrived examples too, but I'm trying to save userspace programmers and those who have to port to new architectures. If you don't know how to do it well, do it simply. Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - 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/