diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-07-01 07:36:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 12:56:00 -0400 |
commit | 0ed9a4a0b6df0548f9ccadb62add2c0155d5262c (patch) | |
tree | 8652f891b78b8c7048ff6d75d272fdab6a2ddaee /drivers | |
parent | a40f55fc333cc20d85af92887334f41f7844e0c2 (diff) |
[PATCH] IB/ipath: use more appropriate gfp flags
This helps us to survive better when memory is fragmented.
Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_file_ops.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c index cd2d5cd05e88..03689dbe1a9e 100644 --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c | |||
@@ -705,6 +705,15 @@ static int ipath_create_user_egr(struct ipath_portdata *pd) | |||
705 | unsigned e, egrcnt, alloced, egrperchunk, chunk, egrsize, egroff; | 705 | unsigned e, egrcnt, alloced, egrperchunk, chunk, egrsize, egroff; |
706 | size_t size; | 706 | size_t size; |
707 | int ret; | 707 | int ret; |
708 | gfp_t gfp_flags; | ||
709 | |||
710 | /* | ||
711 | * GFP_USER, but without GFP_FS, so buffer cache can be | ||
712 | * coalesced (we hope); otherwise, even at order 4, | ||
713 | * heavy filesystem activity makes these fail, and we can | ||
714 | * use compound pages. | ||
715 | */ | ||
716 | gfp_flags = __GFP_WAIT | __GFP_IO | __GFP_COMP; | ||
708 | 717 | ||
709 | egrcnt = dd->ipath_rcvegrcnt; | 718 | egrcnt = dd->ipath_rcvegrcnt; |
710 | /* TID number offset for this port */ | 719 | /* TID number offset for this port */ |
@@ -721,10 +730,8 @@ static int ipath_create_user_egr(struct ipath_portdata *pd) | |||
721 | * memory pressure (creating large files and then copying them over | 730 | * memory pressure (creating large files and then copying them over |
722 | * NFS while doing lots of MPI jobs), we hit some allocation | 731 | * NFS while doing lots of MPI jobs), we hit some allocation |
723 | * failures, even though we can sleep... (2.6.10) Still get | 732 | * failures, even though we can sleep... (2.6.10) Still get |
724 | * failures at 64K. 32K is the lowest we can go without waiting | 733 | * failures at 64K. 32K is the lowest we can go without wasting |
725 | * more memory again. It seems likely that the coalescing in | 734 | * additional memory. |
726 | * free_pages, etc. still has issues (as it has had previously | ||
727 | * during 2.6.x development). | ||
728 | */ | 735 | */ |
729 | size = 0x8000; | 736 | size = 0x8000; |
730 | alloced = ALIGN(egrsize * egrcnt, size); | 737 | alloced = ALIGN(egrsize * egrcnt, size); |
@@ -745,12 +752,6 @@ static int ipath_create_user_egr(struct ipath_portdata *pd) | |||
745 | goto bail_rcvegrbuf; | 752 | goto bail_rcvegrbuf; |
746 | } | 753 | } |
747 | for (e = 0; e < pd->port_rcvegrbuf_chunks; e++) { | 754 | for (e = 0; e < pd->port_rcvegrbuf_chunks; e++) { |
748 | /* | ||
749 | * GFP_USER, but without GFP_FS, so buffer cache can be | ||
750 | * coalesced (we hope); otherwise, even at order 4, | ||
751 | * heavy filesystem activity makes these fail | ||
752 | */ | ||
753 | gfp_t gfp_flags = __GFP_WAIT | __GFP_IO | __GFP_COMP; | ||
754 | 755 | ||
755 | pd->port_rcvegrbuf[e] = dma_alloc_coherent( | 756 | pd->port_rcvegrbuf[e] = dma_alloc_coherent( |
756 | &dd->pcidev->dev, size, &pd->port_rcvegrbuf_phys[e], | 757 | &dd->pcidev->dev, size, &pd->port_rcvegrbuf_phys[e], |
@@ -1167,9 +1168,10 @@ static int ipath_mmap(struct file *fp, struct vm_area_struct *vma) | |||
1167 | 1168 | ||
1168 | ureg = dd->ipath_uregbase + dd->ipath_palign * pd->port_port; | 1169 | ureg = dd->ipath_uregbase + dd->ipath_palign * pd->port_port; |
1169 | 1170 | ||
1170 | ipath_cdbg(MM, "ushare: pgaddr %llx vm_start=%lx, vmlen %lx\n", | 1171 | ipath_cdbg(MM, "pgaddr %llx vm_start=%lx len %lx port %u:%u\n", |
1171 | (unsigned long long) pgaddr, vma->vm_start, | 1172 | (unsigned long long) pgaddr, vma->vm_start, |
1172 | vma->vm_end - vma->vm_start); | 1173 | vma->vm_end - vma->vm_start, dd->ipath_unit, |
1174 | pd->port_port); | ||
1173 | 1175 | ||
1174 | if (pgaddr == ureg) | 1176 | if (pgaddr == ureg) |
1175 | ret = mmap_ureg(vma, dd, ureg); | 1177 | ret = mmap_ureg(vma, dd, ureg); |