Re: [ckrm-tech] [PATCH 0/5] Allow more than PAGESIZE data read inconfigfs

From: Paul Jackson
Date: Sun Oct 15 2006 - 15:08:00 EST


Joel, responding to Matt, wrote:
> > Hmm, that suggests a good point. While some one *can* do that or:
> >
> > ATTR=( $(cat /sys/kernel/config/ckrm/myresource/attr) )
> >
> > the space available for environment variables is limited. So attempting
> > to store a large (What's "large"?) attribute in an environment variable
> > is a potentially buggy practice. This is a significant problem affecting
> > large attributes in general.
>
> If you can't do it in sh, it's pretty much out of scope. This
> is a taste rule I use, because like to shell program. Sure, not the end
> of the world (not a hard rule, I guess), but worth thinking about.

I too like to shell program. Such potentially long vectors can
be worked in the shell, just not placed in a single command line
argument or environment variable.

Constructs that do work (using the list of process id's in the
file /dev/cpuset/tasks for these examples) include:

1. while read pid
do
... do something with each $pid ...
done < /dev/cpuset/tasks


2. < /dev/cpuset/tasks xargs ps -flp


3. sed -un p < /dev/cpuset/foo/tasks > /dev/cpuset/tasks

Such shell constructs for dealing with vectors that might be longer
than argument or environment length limits have been needed and known
for decades.

In an earlier message, Joel wrote:
> You're effectively suggesting that a specific attribute type of
> "repeated value of type X". No mixed types, no exploded structures,
> just a "list of this attr" sort of thing. This does fit my personal
> requirement of avoiding a generic, abusable system.

Yes - what I call above a "vector."

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.925.600.0401
-
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/