[LU-6254] Fix OFD/OSD prefetch for osd-ldiskfs and osd-zfs Created: 17/Feb/15 Updated: 29/Jan/22 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.8.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Andreas Dilger | Assignee: | Alex Zhuravlev |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | patch | ||
| Issue Links: |
|
||||||||||||||||
| Severity: | 3 | ||||||||||||||||
| Rank (Obsolete): | 17511 | ||||||||||||||||
| Description |
|
The ladvise code from It would be best for ladvise on ZFS if it were possible to just call dmu_prefetch() on the specified range and not have to actually set up the pages and drop them again immediately. On ldiskfs, it appears that osd_read_prep() seems somewhat broken since it is removing pages from cache just before they are read: for (i = 0; i < npages; i++) {
if (cache == 0)
generic_error_remove_page(inode->i_mapping,
lnb[i].lnb_page);
}
which means that prefetching the page into OSS cache will be mostly useless, if it is discarded during the read phase immediately before reading it. I can understand dropping pages from cache for writes, but I'd think for reads it makes sense to leave them in cache if they are about to be used, especially if they are being explicitly prefetched. |
| Comments |
| Comment by Bruno Faccini (Inactive) [ 17/Feb/15 ] |
|
But concerning the pages unmap from cache in ldiskf:osd_read_prep(), I understand it will only occur if /proc/fs/lustre/osd-ldiskfs/<DEV>/read_cache_enable has been deliberately unset from its default value. Or did I miss something here? |
| Comment by Andreas Dilger [ 17/Feb/15 ] |
|
That is true, but I don't think it is the job of "read prep" to remove pages from cache if they are already IN cache. At most it should only remove pages from cache AFTER read. Otherwise, it isn't possible to prefetch pages into cache manually via ladvise(WILLNEED) when cache is disabled, nor is it possible to implement NOREUSE semantics. |
| Comment by Gerrit Updater [ 06/Mar/15 ] |
|
Li Xi (lixi@ddn.com) uploaded a new patch: http://review.whamcloud.com/13996 |
| Comment by Li Xi (Inactive) [ 20/Jul/17 ] |
|
As far as we test, the patch improves performance: We see 15-20% improved for read performace and ~5% write performace dropped with OSS So, please reconsider the patch again. |
| Comment by Li Xi (Inactive) [ 20/Jul/17 ] |
|
A cluster with 5000 clients were used to test this patch, and no problem was found. |