Re: [PATCH] PROC_FS: get and set the smp affinity of tasks by read-write /proc/<pid>/smp_affinity
From: rae l
Date: Wed Jan 09 2008 - 21:25:37 EST
On Jan 10, 2008 8:33 AM, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, 4 Jan 2008 15:03:41 +0800
> Denis Cheng <crquan@xxxxxxxxx> wrote:
>
> > this adds a read-write /proc/<pid>/smp_affinity entry,
> > just like what /proc/irq/<irq>/smp_affinity does,
> > so now we can get and set the affinity of tasks by procfs,
> > this is especially useful used in shell scripts.
> >
> > this also adds a read-write /proc/<pid>/tasks/<tid>/smp_affinity
> > for the same purpose.
>
> Why not use /usr/bin/taskset?
I know /usr/bin/tasklet is another way to set smp affinity of a task,
it uses the sched_{set,get}affinity system call binary interface, but
add a /proc/<pid>/smp_affinity could give a new choice; and this keeps
consistency with /proc/irq/<irq>/smp_affinity, will be familiar to
most people.
Another way, the sysctl system call binary interface has been marked
deprecated recently, only /proc/sys/ operating interface left; I
wonder this this would be a tendency of virtual filesystem interface
to replace binary interface? In my opinion, vfs text interface is
always better than system call binary interface.
>
--
Denis Cheng
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/