[LU-8210] OST Read Cache does not work in Centos7 platform Created: 27/May/16  Updated: 14/Jun/18  Resolved: 02/Jun/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.9.0
Fix Version/s: Lustre 2.9.0

Type: Bug Priority: Major
Reporter: Wang Shilong (Inactive) Assignee: Yang Sheng
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Duplicate
Related
is related to LU-8056 Support for linux 4.5 kernels Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

sanity:156 test failed in rhel7 plataform for writecache disable
and readcache enabled.

12288 bytes (12 kB) copied, 0.00750388 s, 1.6 MB/s
cache hits:: before: 4142, after: 4142
Read again; it should be satisfied from the cache.
sanity test_156: @@@@@@ FAIL: NOT IN CACHE: before: 4142, after: 4142
Trace dump:
= /usr/lib64/lustre/tests/test-framework.sh:4730:error_noexit()
= /usr/lib64/lustre/tests/test-framework.sh:4761:error()
= /usr/lib64/lustre/tests/sanity.sh:10271:test_156()
= /usr/lib64/lustre/tests/test-framework.sh:5008:run_one()
= /usr/lib64/lustre/tests/test-framework.sh:5045:run_one_logged()
= /usr/lib64/lustre/tests/test-framework.sh:4910:run_test()
= /usr/lib64/lustre/tests/sanity.sh:10278:main()



 Comments   
Comment by Gerrit Updater [ 27/May/16 ]

Wang Shilong (wshilong@ddn.com) uploaded a new patch: http://review.whamcloud.com/20478
Subject: LU-8210 osd-ldiskfs: fix setting pages PageUptodate state
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f8630c9a585c97550405fa5cbb9f0d48ff4a37c8

Comment by Wang Shilong (Inactive) [ 27/May/16 ]

Intresting thing is that we should always reproduce this problem in rhel7 platform, but I don't see
it reproduced in Intel autotest platform, but we could reproduce it in our environment.

Comment by Wang Shilong (Inactive) [ 27/May/16 ]
53  * drivers should _never_ use the all version - the bio may have been split
154  * before it got to the driver and the driver won't own all of it
155  */
156 #define bio_for_each_segment_all(bvl, bio, i)                           \
157         for (i = 0;                                                     \
158              bvl = bio_iovec_idx((bio), (i)), i < (bio)->bi_vcnt;       \
159              i++)
160 
161 #define bio_for_each_segment(bvl, bio, i)                               \
162         for (i = (bio)->bi_idx;                                         \
163              bvl = bio_iovec_idx((bio), (i)), i < (bio)->bi_vcnt;       \
164              i++)

Here is difference between two interface, bio_for_each_segment_all() start from index,0
while bio_for_each_segment start from @bi_idx, while @bi_idx might change in bio_advance()
during IO handling.

Aslo Looking from How Current upstream Filesystem handle page state updates
in end IO:
[root@server11 fs]# git grep bio_for_each_segment_all
btrfs/compression.c:            bio_for_each_segment_all(bvec, cb->orig_bio, i)
btrfs/disk-io.c:        bio_for_each_segment_all(bvec, bio, i) {
btrfs/extent_io.c:      bio_for_each_segment_all(bvec, bio, i) {
btrfs/extent_io.c:      bio_for_each_segment_all(bvec, bio, i) {
btrfs/extent_io.c:      bio_for_each_segment_all(bvec, bio, i) {
btrfs/inode.c:  bio_for_each_segment_all(bvec, bio, i)
btrfs/inode.c:  bio_for_each_segment_all(bvec, &io_bio->bio, i) {
btrfs/inode.c:  bio_for_each_segment_all(bvec, bio, i) {
btrfs/inode.c:  bio_for_each_segment_all(bvec, &io_bio->bio, i) {
crypto/crypto.c:        bio_for_each_segment_all(bv, bio, i) {
direct-io.c:            bio_for_each_segment_all(bvec, bio, i) {
exofs/ore.c:    bio_for_each_segment_all(bv, bio, i) {
exofs/ore_raid.c:               bio_for_each_segment_all(bv, bio, i) {
ext4/page-io.c: bio_for_each_segment_all(bvec, bio, i) {
ext4/readpage.c:        bio_for_each_segment_all(bv, bio, i) {
ext4/readpage.c:        bio_for_each_segment_all(bv, bio, i) {
f2fs/data.c:    bio_for_each_segment_all(bvec, bio, i) {
f2fs/data.c:    bio_for_each_segment_all(bvec, bio, i) {
f2fs/data.c:    bio_for_each_segment_all(bvec, io->bio, i) {
gfs2/lops.c:    bio_for_each_segment_all(bvec, bio, i) {
gfs2/meta_io.c: bio_for_each_segment_all(bvec, bio, i) {
logfs/dev_bdev.c:       bio_for_each_segment_all(bvec, bio, i) {
mpage.c:        bio_for_each_segment_all(bv, bio, i) {
Comment by Wang Shilong (Inactive) [ 27/May/16 ]

I am still wondering why Intel autotest could pass this test, maybe I miss something here...........

Comment by Wang Shilong (Inactive) [ 27/May/16 ]

I see from Documentation/block/biodoc.txt

  • Drivers which can't process a large bio in one shot can use the bi_idx
    484 field to keep track of the next bio_vec entry to process.
    485 (e.g a 1MB bio_vec needs to be handled in max 128kB chunks for IDE)
    486 [TBD: Should preferably also have a bi_voffset and bi_vlen to avoid modifying
    487 bi_offset an len fields]

So this problem might be related to Specific Driver which can explain
why we could reproduce it in our environment, however, we still need fix this issue
In Lustre.

Comment by Peter Jones [ 27/May/16 ]

Yang Sheng

Could you please advise on this issue?

Thanks

Peter

Comment by Yang Sheng [ 31/May/16 ]

Hi, Wang,

Do you mind provide which type disk driver apply in your test environment. I am interesting to do a reproduction.

Thanks,
YangSheng

Comment by Wang Shilong (Inactive) [ 31/May/16 ]

Hi Sheng,

Qemu configurations something like this:

<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/home/vms/autotest-el7.2-vm5b.img'/>
<target dev='sdb' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</disk>

Regards,
Shilong

Comment by Yang Sheng [ 01/Jun/16 ]

Many thanks for your help.

Thanks,
YangSheng

Comment by Gerrit Updater [ 02/Jun/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/20478/
Subject: LU-8210 osd-ldiskfs: fix setting pages PageUptodate state
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 5e5e4ae2be4bc377f0f896163ae59bf338c4250c

Comment by Peter Jones [ 02/Jun/16 ]

Landed for 2.9

Comment by James A Simmons [ 03/Jun/16 ]

This patch breaks support with the latest kernels Is the lloop driver that breaks.

Comment by Andreas Dilger [ 03/Jun/16 ]

Luckily I thought we are deleting lloop, so that would be the easiest fix?

Comment by James A Simmons [ 03/Jun/16 ]

The default loop doesn't support direct I/O until the 4.6 kernel if I remember right. So we still need the fix for kernels between 3.16 <-> 4.5

Generated at Sat Feb 10 02:15:35 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.