Chris Mason <chris.mason@oracle.com> wrote:I'm not sure what you're asking. When the cache is cold, we determine that we can't read from the cache very quickly. We then read data from the server and, in the background, create the metadata in the cache and store the data to it (by copying netfs pages to backingfs pages). When the cache is warm, we read the data from the cache, copying the data from the backingfs pages to the netfs pages. We use bmap() to ascertain that there is data to be read, otherwise we detect a hole and fallback to reading from the server. Looking up cache object involves a sequence of lookup() ops and getxattr() ops on the backingfs. Should an object not exist, we defer creation of that object to a background thread and do lookups(), mkdirs() and setxattrs() and a create() to manufacture the object. We read data from an object by calling readpages() on the backingfs to bring the data into the pagecache. We monitor the PG_lock bits to find out when each page is read or has completed with an error. Writing pages to the cache is done completely in the background. PG_fscache_write is set on a page when it is handed to fscache to storage, then at some point a background thread wakes up and calls write_one_page() in the backingfs to write that page to the cache file. At the moment, this copies the data into a backingfs page which is then marked PG_dirty, and the VM writes it out in the usual way. BTRFS might not be doing any writing at all here - apart from local atimes (used by cache culling), that is. What it does have to do is lots of lookups, reads and getxattrs, all of which are synchronous. David - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| David Miller | [GIT]: Networking |
| Fred . | Please add ZFS support (from GPL sources) |
| Linus Torvalds | Linux 2.6.26-rc4 |
| Jan Engelhardt | Re: why does x86 "make defconfig" build a single, lonely module? |
git: | |
| Jörg Sommer | [PATCH 2/4] Rework redo_merge |
| Matthieu Moy | git push to a non-bare repository |
| Michael Dressel | git merge --no-commit <branch>; does commit |
| Joakim Tjernlund | [FEATURE REQUEST] git clone, just clone selected branches? |
| Daniel Ouellet | identifying sparse files and get ride of them trick available? |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Unix Fan | Re: Vulnerability Note VU#800113 - Multiple DNS implementations vulnerable to cach... |
| Ihar Hrachyshka | Re: That whole "Linux stealing our code" thing |
| Daniel Brewer | Re: fsync performance hit on 1.6.1 |
| YAMAMOTO Takashi | yamt-km branch |
| der Mouse | Re: mjf-devfs2 branch |
| Ian Zagorskih | POSIX timer_settime() dosn't set timer in some cases (lost accuracy) |
