Re: Slow USB storage device?

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

 



On Mon, Jan 18, 2010 at 06:33:25PM -0800, Linus Torvalds wrote:
> >  It means 1056 bytes for your disk image! Looks like a nice
> >  improvement ;-) The change is pushed to the repository, so "git pull"
> >  is your friend.
> 
> Ok, so the above is fine, but since we do end up doing all reads as whole 
> blocks anyway (and we always round up to a page size in order to do 
> caching well), it doesn't really matter _that_ much once you get down to a 
> single page (4kB) reads.
> 
> Of course, depending on alignment etc, smaller reads can still be better 
> (ie if that avoids crossing a page boundary), but realistically there are 
> very much diminishing returns. A 4kB-aligned 4kB block is going to do as 
> much IO as a 32-byte block does (assuming the 32-byte one doesn't cross a 
> page).
> 
> Also, I suspect that it's not a great idea to optimize for a totally empty 
> medium. Sure, it's not a totally uncommon case, but I suspect that it's 

 The FS label (name) is usually the first entry in the root directory.
 It means that read 32 bytes should be enough for non-empty disks too.
 The problem is when there is not a FS label, then it reads all
 entries.

> less common than having a couple of root directory entries (camera devices 
> will almost always have exactly one subdirectory entry etc).
> 
> But what you quote above will certainly work well for my case.
>
> Realistically, I'd suggest going for a 4kB blocking factor, though. That's 
> likely a good mid-way point between "read all of it whether it's useful or 
> not" and "assume it's almost empty".

 Yes, I thought about it. Maybe I'll try it.

> > > However, the real problem is that you didn't fix the whole-disk case:
> > 
> >  Yes, ignore this problem for now. The ideal solution is not to call
> >  blkid for the whole disk. We have to resolve this problem.
> 
> So in the meantime, what's a good rule to disable it on a per-machine 
> basis? 

 I hope I will disable UDF and UFS probing for small devices and then
 blkid for your whole-disk will read 2048 bytes only.

 If you want to disable it at all you need to modify udev rules :-(
 Ask Kay for more details...

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
--
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