[PATCH] remove shm* from hdparm

Tito farmatito at tiscali.it
Thu May 18 12:40:13 UTC 2006


On Wednesday 17 May 2006 06:00, you wrote:
> On Tuesday 16 May 2006 4:23 pm, Tito wrote:
> > > 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 second, definitely. :)
> 
> > 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
> 
> I'm guessing that the shared memory segment is an attempt to get it not to 
> swap the data out under memory pressure.  A poorman's madvise(MADV_DONTSWAP).
> 
> > ;-P
> >
> > (hints are wellcome or should we mail the hdparm maintainer about it).
> >
> > Rob, you have the choice.......
> 
> I'll look at it in the morning, it's midnight and my laptop is STILL backing 
> up.  (The downside of having a 60 gig drive...)

Hi, this patch removes shm* stuff from hdparm.c and substitutes it with ~=

RESERVE_CONFIG_BUFFER(buf, TIMING_BUF_BYTES);
mlock(buf, TIMING_BUF_BYTES);

munlock(buf, TIMING_BUF_BYTES);
RELEASE_CONFIG_BUFFER(buf);

It seems to work for me.
Please take a look at it (it's small ;-)  ) and apply if you like it.

> > 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 ?!?
> 
> Nah, it needs documentation.
> 
> It compares busybox_old with busybox_unstripped.  So you need to make the old 
> version, mv busybox_unstripped busybox_old, then make the new version, then 
> make bloatcheck.
> 
> It doesn't create busybox_old.  You have to supply that.  It'll create 
> busybox_unstripped if necessary...
 Couldn't this be automated by the script

 cp busybox_unstripped busybox_old

Ciao,
Tito
> 
> Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hdparm_no_shm02.patch
Type: text/x-diff
Size: 1847 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060518/8640d84c/attachment.bin 


More information about the busybox mailing list