git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Sort of a feature proposal

From
David Kastrup <dak@gnu.org>
Date
May 7, 2008, 17:39 UTC
Message-ID
<86k5i6rp23.fsf@lola.quinscape.zz>
In-Reply-To
<alpine.LFD.1.10.0805070924300.3024@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 18 quoted lines
> On Wed, 7 May 2008, David Kastrup wrote:
>> 
>> Hi, I have some large git repositories on a USB drive (ext3 file
>> system).  That means that when replugging the drive, the recorded st_dev
>> data in the index is off, meaning that the whole repo directory
>> structure gets reread as the stat data of all directories has changed.
>> 
>> That's a nuisance.  Can't we have some heuristic or configuration option
>> where we, say, record the st_dev of the _index_ file, and if that has
>> changed, we propagate that change to the st_dev of its contents?  I'd
>> like to see something that works more efficiently than rescanning the
>> whole disk every time I hibernate my computer.
>
> Hmm. We shouldn't even be using st_dev any more.
>
> How did you compile your git version? By default USE_STDEV should be off, 
> and it's been that way for a long time (because st_dev is also not 
> reliable on NFS etc).

Looks that way in my Makefile. Maybe I am confused: I just did some timings (this is ext3 on a USB drive) and got

    git svn rebase
    Current branch master is up to date.
    dak@lisa:/lisa/texlive$ time git svn rebase
    Current branch master is up to date.
    real	0m4.581s
    user	0m2.244s
    sys	0m1.492s
    dak@lisa:/lisa/texlive$ cd
    dak@lisa:~$ sudo umount /lisa;sudo mount /dev/mapper/Medion-reps /lisa;cd /lisa/texlive;time git svn rebase
    Current branch master is up to date.
    real	0m53.588s
    user	0m2.248s
    sys	0m2.388s
    dak@lisa:/lisa/texlive$ cd;sudo umount /lisa;sudo dmsetup remove /dev/mapper/Medion-reps
[Unplug and replug the USB drive]
    dak@lisa:~$ sudo mount /dev/mapper/Medion-reps /lisa;cd /lisa/texlive;time git svn rebase
    Current branch master is up to date.
    real	0m53.101s
    user	0m2.324s
    sys	0m2.380s
    dak@lisa:/lisa/texlive$ 

If my guess that the device number of LVM does not change when merely un- and remounting, but does change when unplugging and replugging is correct, it would appear that my idea where the time went was wrong and that the device number has nothing whatsoever to do with the large amount of lookups (this is a USB2.0 device at High Speed).

Is there a way to completely invalidate the disk cache without unmounting? How do I verify device numbers?

Thanks,
-- 
David Kastrup
Previous: Linus TorvaldsNext: Dmitry Potapov
Message 6 of 8 in “Sort of a feature proposal”
  1. David KastrupMay 7, 2008
  2. Nicolas PitreMay 7, 2008
  3. Stephen R. van den BergMay 7, 2008
  4. Avery PennarunMay 7, 2008
  5. Linus TorvaldsMay 7, 2008
  6. David KastrupMay 7, 2008
  7. Dmitry PotapovMay 7, 2008
  8. David KastrupMay 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.