Re: blklimits: new command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 14, 2010 at 11:47:37AM +0100, Pádraig Brady wrote:
> On 14/05/10 11:22, Karel Zak wrote:
> > On Thu, May 13, 2010 at 02:14:32PM -0400, Phillip Susi wrote:
> >> On 5/13/2010 6:42 AM, Karel Zak wrote:
> >>>  I'm not sure if link blockdev(8) against libblkid is a good idea.
> >>>  From my point of view is blockdev(8) simple wrapper for ioctls.
> >>>
> >>>  (I'm not happy with another new command, so suggestions are welcomed.)
> >>
> >> If blockdev is a wrapper for block device ioctls, and blkid is a simple
> >> interface to libblkid, then it seems a new feature in libblkid should be
> >> exported by blkid.
> > 
> >  Yes, it's probably the best compromise.
> > 
> >  Implemented & committed:
> > 
> >  -i  Display I/O Limits (aka I/O topology) information. The ’export’ 
> >      output format is automatically enabled.
> > 
> >  for example:
> > 
> >     # blkid -i /dev/sdb
> >     MINIMUM_IO_SIZE=512
> >     OPTIMAL_IO_SIZE=32768
> >     PHYSICAL_SECTOR_SIZE=512
> >     LOGICAL_SECTOR_SIZE=512
> > 
> > 
> >  The same thing without libblkid (already released in 2.17):
> > 
> >     # blockdev --getiomin --getioopt --getpbsz --getss /dev/sdb 
> >     512
> >     32768
> >     512
> >     512
> > 
> > 
> >  So we have two ways (first is portable and second is fast).
> 
> Mainly for my reference, with the above, the way to get these
> values from a shell script, covering most kernel/util-linux-ng versions is:
> 
>  OPTIMAL_IO_SIZE=$(blockdev --getioopt $disk 2>/dev/null)
>  [ "$OPTIMAL_IO_SIZE" ] || eval $(blkid -i $disk 2>/dev/null)
>  [ "$OPTIMAL_IO_SIZE" ] || OPTIMAL_IO_SIZE=32768
>
> while keeping these attributes just in `blockdev` would have required:
> 
>  OPTIMAL_IO_SIZE=$(blockdev --getioopt $disk 2>/dev/null || echo 32768)

 Well, my plan was to export I/O Limits to command-line by blockdev(8)
 *only*. I think it's enough for almost all users. (You can also use
 /sys.)

 The reason why we have the same thing exported from libblkid is that
 it was requested by developers who depends on libblkid. They need a 
 simple way how to debug problems related to the library. 
 
 If I good remember nobody (except XFS) cares about DM/MD/EVMS/LVM 
 on old kernels. (Christoph had libdisk for this task.)
 
 That's the whole story.

 I'm happy that blokdev(8) is still simple and stupid and we don't
 have any new command (e.g. blklimits), because the thing was added to
 blkid(8). Thanks for suggestion and commands.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux