Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176895
b: refs/heads/master
c: 354bb65
h: refs/heads/master
i:
  176893: 697b651
  176891: 3333d30
  176887: d8a9f73
  176879: f39896d
  176863: d449073
  176831: 24b7220
  176767: e5de20b
  176639: c002ab4
v: v3
  • Loading branch information
KOSAKI Motohiro authored and David Woodhouse committed Dec 8, 2009
1 parent 4226595 commit 55d9bbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1672af1164d3d50ba8908014fd34cc0b58afdc1e
refs/heads/master: 354bb65e6e0df0aaae0e5b1ea33948d8e0b61418
25 changes: 3 additions & 22 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,33 +387,14 @@ static struct kmem_cache *iommu_domain_cache;
static struct kmem_cache *iommu_devinfo_cache;
static struct kmem_cache *iommu_iova_cache;

static inline void *iommu_kmem_cache_alloc(struct kmem_cache *cachep)
{
unsigned int flags;
void *vaddr;

/* trying to avoid low memory issues */
flags = current->flags & PF_MEMALLOC;
current->flags |= PF_MEMALLOC;
vaddr = kmem_cache_alloc(cachep, GFP_ATOMIC);
current->flags &= (~PF_MEMALLOC | flags);
return vaddr;
}


static inline void *alloc_pgtable_page(int node)
{
unsigned int flags;
struct page *page;
void *vaddr = NULL;

/* trying to avoid low memory issues */
flags = current->flags & PF_MEMALLOC;
current->flags |= PF_MEMALLOC;
page = alloc_pages_node(node, GFP_ATOMIC | __GFP_ZERO, 0);
if (page)
vaddr = page_address(page);
current->flags &= (~PF_MEMALLOC | flags);
return vaddr;
}

Expand All @@ -424,7 +405,7 @@ static inline void free_pgtable_page(void *vaddr)

static inline void *alloc_domain_mem(void)
{
return iommu_kmem_cache_alloc(iommu_domain_cache);
return kmem_cache_alloc(iommu_domain_cache, GFP_ATOMIC);
}

static void free_domain_mem(void *vaddr)
Expand All @@ -434,7 +415,7 @@ static void free_domain_mem(void *vaddr)

static inline void * alloc_devinfo_mem(void)
{
return iommu_kmem_cache_alloc(iommu_devinfo_cache);
return kmem_cache_alloc(iommu_devinfo_cache, GFP_ATOMIC);
}

static inline void free_devinfo_mem(void *vaddr)
Expand All @@ -444,7 +425,7 @@ static inline void free_devinfo_mem(void *vaddr)

struct iova *alloc_iova_mem(void)
{
return iommu_kmem_cache_alloc(iommu_iova_cache);
return kmem_cache_alloc(iommu_iova_cache, GFP_ATOMIC);
}

void free_iova_mem(struct iova *iova)
Expand Down

0 comments on commit 55d9bbb

Please sign in to comment.