[PATCH] hdparm utilizes shared memory for no good reason ?

Tito farmatito at tiscali.it
Tue May 16 13:23:44 PDT 2006


On Tuesday 16 May 2006 17:59, Mike Frysinger wrote:
> On Tuesday 16 May 2006 07:49, Tito wrote:
> > On Tuesday 16 May 2006 08:19, Mike Frysinger wrote:
> > > was trying to use `hdparm -t` on a uClinux host when it failed with:
> > > could not allocate sharedmem buf
> > >
> > > this is because hdparm uses shm* functions to get a buffer of memory ...
> > > but afaict, there's no reason a buffer created on the stack/heap wouldnt
> > > work just as well
> > >
> > > could someone enlighten me as to why the shm* stuff is needed ?
> >
> > It is what  the real hdparm does,  after Rob applies my pending shrinkage
> > and bugfix patch I can try to write a fix for that ... if you haven't one
> > already.
> 
> i have not done anything beyond looking into why it failed
> 
> if you wouldnt mind seeing about dropping the shm* stuff, i'd love you long 
> time ;)
> -mike
> 

Hi, attached are 2 patches to resolve this hdparm shared memory problem.

the first patch adds a config option to disable the use of shared memory segments when performing
timings on devices and substitute them with static or  malloced buffers.

the second alternative patch removes the use of shm* calls totally.

The patches are both tested and seem to work on my system, but
don't ask why this shm* stuff was used because I don't know 

;-P

(hints are wellcome or should we mail the hdparm maintainer about it).

Rob, you have the choice.......

BTW: make bloatcheck returns this error
 make bloatcheck
make[1]: *** No rule to make target `busybox_old', needed by `bloatcheck'.  Stop.
make: *** [bloatcheck] Error 2

Maybe I'm too stupid to use it ?!?

Ciao,
Tito
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hdparm_no_shm_alternative.patch
Type: text/x-diff
Size: 1418 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20060516/920d8014/hdparm_no_shm_alternative.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hdparm_no_shm.patch
Type: text/x-diff
Size: 1893 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20060516/920d8014/hdparm_no_shm.bin


More information about the busybox mailing list