Re: [PATCH 0/6] Add strict cache mode (try #4)

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

 



2010/11/29 Suresh Jayaraman <sjayaraman@xxxxxxx>:
> On 11/29/2010 04:30 PM, Pavel Shilovsky wrote:
>> 2010/11/29 Suresh Jayaraman <sjayaraman@xxxxxxx>:
>>> On 11/28/2010 01:42 PM, Pavel Shilovsky wrote:
>>>> Re-posting the whole set of strict cache patches.
>>>
>>> I try to explain here the "strict cache" semantics as I'm not sure
>>> whether I understand it clearly. Please correct me if I'm wrong.
>>>
>>> Strict cache semantics
>>>
>>> ïo provides stricter cache coherency among cifs clients that access
>>> ï ïthe same files.
>>> ïo The clients will read data from the Server always, except when they
>>> ï ïhold read oplock or Level II oplock on the file.
>>> ïo The clients will write data to the Server always, except when they
>>> ï ïhold exclusive oplock on the file.
>>> ïo When we close the last filehandle of the inode, file should be
>>> ï ïmarked for revalidation as it is possible for the client to access
>>> ï ïstale data from the cache when we open it again with a read
>>> ï ïoplock.
>>> ïo On fsync/mmap, invalidate inode if read oplock has not been set.
>>>
>>>
>>> Is this the semantics being proposed? Did I miss anything?
>>
>> Yes, you are right - it is exactly what I mean.
>>
>
> Also, would be good to know what level of testing these patches have
> undergone. Could you share the test results as well?
>

I don't run big stress tests over it but I have tree small tests that
shows the problem this mode is going to fix.

-- 
Best regards,
Pavel Shilovsky.
#!/bin/env python
#
# We have to mount the same share to test, test1, test2 directories that locate in the directory we
# execute this script from.

from os import open, close, O_RDWR, O_CREAT, write, read, O_RDONLY, O_WRONLY, O_TRUNC, lseek, SEEK_END, SEEK_SET

f = open('test/_test4321_', O_RDWR | O_CREAT | O_TRUNC)
close(f)

f1 = open('test1/_test4321_', O_RDWR)
write(f1, 'a')
close(f1)

f2 = open('test2/_test4321_', O_WRONLY)
write(f2, 'x')
close(f2)

f3 = open('test1/_test4321_', O_RDONLY)
print 'must be x:', read(f3, 1)

close(f3)
#!/bin/env python
#
# We have to mount the same share to test, test1, test2 directories that locate in the directory we
# execute this script from.

from os import open, close, O_RDWR, O_CREAT, write, read, O_RDONLY, O_WRONLY, O_TRUNC, lseek, SEEK_END, SEEK_SET

f = open('test/_test4321_', O_RDWR | O_CREAT | O_TRUNC)
close(f)

f1 = open('test1/_test4321_', O_RDWR)
write(f1, 'a')

f2 = open('test2/_test4321_', O_WRONLY)
write(f2, 'x')

f3 = open('test1/_test4321_', O_RDONLY)
print 'must be x:', read(f3, 1)

close(f1)
close(f2)
close(f3)
#!/bin/env python
#
# We have to mount the same share to test, test1, test2 directories that locate in the directory we
# execute this script from.

from os import open, close, O_RDWR, O_CREAT, write, read, O_RDONLY, O_WRONLY, O_TRUNC, lseek

f = open('test/_test4321_', O_RDWR | O_CREAT | O_TRUNC)
write(f, ''.join('a' for _ in range(4096)))
close(f)

f1 = open('test1/_test4321_', O_RDWR)
f2 = open('test2/_test4321_', O_RDWR)

write(f1, 'x')
print 'x is written through f1'
print '%c is read from f2' % read(f2, 1)

write(f1, 'y')
print 'y is written through f1'
print '%c is read from f2' % read(f2, 1)

write(f1, 'z')
print 'z is written through f1'
print '%c is read from f2' % read(f2, 1)

close(f1)
close(f2)

[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux