Some queries about NFS

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

 



Hi list,

I have been trying to understand NFS's working - focusing mainly on the way 
I/O (write back) is performed. But after a lot of tries I am stuck at some 
very stupid issues which I am unable to sort out. I would really appreciate if 
someone can give a pointer or two. Please correct me wherever my understanding 
is not right.

Also, I had posted this same message on linux.nfs list but I suppose people 
there were qutie busy and I did not get any response (or possibly these are 
very stupid questions) - so posting here in hope that someone might be able to 
help me out.

I apologize for the length of this mail.
-----------------------------------------

I am using stock 2.6.16.21 kernel for understanding purpose (and NOT focusing 
on NFS v4)

Problem:

1) As per my understanding NFS_INO_INVALID_DATA flag means that if it is set, 
flush the data which is in the write back list.

For writing, nfs_file_write calls nfs_revalidate_mapping function. Which in 
turn calls nfs_sync_mapping if it is a regular file in question and if 
INO_INVALID_DATA flag is set. nfs_sync_mapping calls nfs_wb_all which would 
flush back all the pages to be written back (for any pervious I/O).

Is it that:
a) if invalid data is set means that data should be flushed back - always.
b) invalidating data (with flag) does *not* mean that it should NOT be : 
written back and page_cache_release(d). <-- is there any such condition 
(situation) in which such a step has to be taken (assuming NON SYNC 
operations).

2) I created a module which would scan the list of pages associated with an 
Inode. I ran this for an I/O done over NFS for checking page flags like:
Uptodate, Dirty, Writeback, Buffered and Private. My observation was:

2.1) Only Buffered and private bits are on for any I/O (unflushed i.e. not 
executed using SYNC).
2.2) All the pages had there Uptodate flag set - and no page was NOT(uptodate).
2.3) Same was the case for Dirty flag of the page.

Hence, is it that:
a) Pages used, refered by NFS are *always* Uptodate. Hence, kernel would be 
able to read pages without flushing them (without the knowledge of NFS).
If the above is true, THEN:
--> Assuming a read calls comes for a file which had pending write 
--> backs. Read
call is for same pages which were to be written back (and are in cache with 
Uptodate flag ON).
--> Then, kernel would simply read all the pages which are uptodate and 
--> copy
them back to the user space. (do_generic_mapping_read function).HOW does NFS 
handle such a request? (it never gets the control of the read request which is 
returned from the kernel itself) OR, it is OK to read from pages which are in 
writeback list of pages?

Also, I could infer that:
nfs_readpage function would NEVER be called for any page which is uptodate (in
cache) even if has to be written back. Still there is a check for pending 
writes
(nfs_wb_all) in this function which would be redundant.

Regards
Shreyansh


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux