mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
RDMA/core: not to set page dirty bit if it's already set.
This change will optimize kernel memory deregistration operations. __ib_umem_release() used to call set_page_dirty_lock() against every writable page in its memory region. Its purpose is to keep data synced between CPU and DMA device when swapping happens after mem deregistration ops. Now we choose not to set page dirty bit if it's already set by kernel prior to calling __ib_umem_release(). This reduces memory deregistration time by half or even more when we ran application simulation test program. Signed-off-by: Qing Huang <qing.huang@oracle.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
f937d93a91
commit
53376fedb9
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int d
|
||||||
for_each_sg(umem->sg_head.sgl, sg, umem->npages, i) {
|
for_each_sg(umem->sg_head.sgl, sg, umem->npages, i) {
|
||||||
|
|
||||||
page = sg_page(sg);
|
page = sg_page(sg);
|
||||||
if (umem->writable && dirty)
|
if (!PageDirty(page) && umem->writable && dirty)
|
||||||
set_page_dirty_lock(page);
|
set_page_dirty_lock(page);
|
||||||
put_page(page);
|
put_page(page);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue