Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 27 Nov 2001 01:28:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 27 Nov 2001 01:28:49 -0500 Received: from mx2.elte.hu ([157.181.151.9]:62947 "HELO mx2.elte.hu") by vger.kernel.org with SMTP id ; Tue, 27 Nov 2001 01:28:39 -0500 Date: Tue, 27 Nov 2001 09:26:17 +0100 (CET) From: Ingo Molnar Reply-To: To: Linux maillist account Cc: Robert Love , linux-kernel Subject: Re: a nohup-like interface to cpu affinity In-Reply-To: <5.0.2.1.2.20011126231737.009f0ec0@pop.mindspring.com> 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 On Mon, 26 Nov 2001, Linux maillist account wrote: > A nohup-like interface to the cpu affinity service would be useful. It > could work like the > following example: > > $ cpuselect -c 1,3-5 gcc -c module.c yep, this can be done via the chaff utility i posted: gcc -c module.c & ./chaff $! 0x6 or, it can be done by changing the affinity of the current shell, every new child process will inherit it: ./chaff $$ 0x6; gcc -c module.c (or a cpuselect utility can be written.) > On another subject -- capabilities -- any process should be able to > reduce the number of cpus in its own cpu affinity mask without any > special permission. To add cpus to a reduced mask, or to change the > cpu affinity mask of other processes, should require the appropriate > capability, be it CAP_SYS_NICE, CAP_SYS_ADMIN, or whatever is decided. yep, this is how sched_set_affinity() is workig - it allows the setting of affinities if either CAP_SYS_NICE is set, or the process' uid/gid matches that of the target process' effective uid/gid. Ingo - 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/